SSRS open report with a parameter in a new window - reporting-services

I'm trying to open a report with a parameter in a new window. I tried many things but it still doesn't work. It goes to the report window but it's asking to enter the parameter manually. If I hide the parameter, it says the parameters are missing.
My problem with passing the parameter is that It is a varchar(10) type value.
I checked other posts but they didn't help. The code that I'm using:
="javascript:void(window.open('http://www.report.utm.com/Reports/Pages/Report.aspx?ItemPath=%2fTechn+Info%2fConst_Tel&**ConstID=" & Fields!CONSTITUENTID.Value** & "','_blank'))"

Well, try using the following to see if that works for you?
="javascript:void(window.open('http://www.report.utm.com/Reports/Pages/Report.aspx&rs:Command=render&rc:Parameters=true&ConstID=" & Fields!CONSTITUENTID.Value & "','_blank','resizeable=1,toolbar=0,status=0,menu=0,top=20,left=20,width=1040,height=730'))"

I found the solution here: https://technet.microsoft.com/en-us/library/ms155391(v=sql.105).aspx
The below finally worked. I had to put reportserver? followed by the report path,
name and parameter.
="javascript:void(window.open('http://www.report.utm.com/reportserver?/Tech Info/Const_Tel&rs:Command=Render&ConstID=" & Fields!CONSTITUENTID.Value & "','_blank'))"
Thanks all for your help.

Try this :
="javascript:void window.open(" &"'"& Globals!ReportServerUrl &"/Pages/ReportViewer.aspx?"&Globals!ReportFolder &"/JournalVoucher&voucher_id="&Fields!account_voucher_id.Value &" ','_blank')"
 
JournalVoucher is my drilldown report and voucher_id is the parameter inside that report.
I pass the value of account_voucher_id from the column from the main report.
And if you have multiple parameters, use the following to add one parameter after another
="javascript:void window.open(" &"'"& Globals!ReportServerUrl &"/Pages/ReportViewer.aspx?"&Globals!ReportFolder &"/TrialBalanceSheetAcctCntrwise&user_id=" & Parameters!user_id.Value &"&acct_centre_id=" & Parameters!acct_centre_id.Value &"&led_id=" & Fields!lid.Value &"&from_dt=" & Parameters!frm.Value &"&to_dt=" & Parameters!to.Value & "','_blank')"

Related

DLookup in ControlSource property of a TextBox

I'm working on a little project in Access using VBA. I created a report with some data from three different tables. In the Report_Open method I want to assign a query to the ControlSource of a TextBox.
Here is my code
Me.textImpactP.ControlSource = DLookup("[ImpactText]", "Root_cause_basic_reports", "[Report_id] =" & rid & " And [Root_cause_basic_id] =" & rootCauseId)
When I run this I keep getting the dialog "Enter Parameter Value".
The parameter "people" is the result of my DLookup and is supposed to be the value of my TextBox on my report.
Does anyone have an idea how to get the parameter "people" as a value in my TextBox?
Enter Parameter value does not represent, what you think it does. It normally pops up when you try to open a Report whose record Source is based on a Query which requests a parameter. Check the Query again.

how do I show the parameters of a report in a textbox on the report?

I have a date range as parameters on my report, #dt_begin and #dt_end.
On the header of the report I would like to display "report run from #dt_begin to #dt_end".
with the actual date values in it, example:
"Report run from 14-Oct-2013 to 16-Oct-2013".
How can I do that?
thanks and regards
Marcelo
In expressions, refer to parameter values using Parameters!param.Value.
In your example, add an expression similar to this to a textbox in the header:
="Report run from " & Format(Parameters!dt_begin.Value, "dd-MMM-yyyy")
& " to "
& Format(Parameters!dt_end.Value, "dd-MMM-yyyy")
All it's doing is formatting your parameters and adding them to a larger string.

How to add a subreport in a new window?

I am developing a SSRS 2008 R2 RDL with a chart. Currently, I have a subreport built into this chart where if they click on a pie piece it goes directly to this subreport. It is currently configured as an action on the series via "Go to Report".
However, my customer wants it to instead open a new browser window so that they can still see original chart without having to rerun my report. Also, this subreport requires several input parameters. I tried the "Go to URL" Action link instead and entered the URL there. But this didn't work cause I couldn't pass in my input parameters. How can I do this?
This subreport takes multiple parameters. I have it configured as:
="javascript:void(window.open('http://evolvdb/Reports/Pages/Report.aspx?ItemPath=%2fIncoming%2fCensus_by_Date_Range2_Subreport&rs:Command=Render&startdate="+Parameters!startdate.Value+"&enddate="+Parameters!enddate.Value+"&region="+Parameters!region.Value+"&state="+Parameters!state.Value+"&office="+Parameters!office.Value+"&status="+Parameters!status.Value+"&program_hyperlink="+Fields!program_code.Value+"&funding_source_param="+Parameters!funding_source.Value+"'))"
But when I try to click this subreport it is not clickable.
I also tried this, but this exceeds the 255 character count:
="javascript:void(window.open('http://evolvdb/Reports/Pages/Report.aspx?ItemPath=%2fIncoming%2fCensus_by_Date_Range2_Subreport&rs:Command=Render&startdate=" & Parameters!startdate.Value & "&enddate=" & Parameters!enddate.Value & "&region=" & Parameters!region.Value & "&state=" & Parameters!state.Value & "&office=" & Parameters!office.Value & "&status=" & Parameters!status.Value & "&program_hyperlink=" & Fields!program_code.Value & "&funding_source_param=" & Parameters!funding_source.Value & "'))"
I also tried this, but this was not clickable either:
="javascript:void(window.open('http://evolvdb/Reports/Pages/Report.aspx?ItemPath=%2fIncoming%2fCensus_by_Date_Range2_Subreport&rs:Command=Render
&startdate="+Parameters!startdate.Value+"
&enddate="+Parameters!enddate.Value+"
&region="+Parameters!region.Value+"
&state="+Parameters!state.Value+"
&office="+Parameters!office.Value+"
&status="+Parameters!status.Value+"
&program_hyperlink="+Fields!program_code.Value+"
&funding_source_param="+Parameters!funding_source.Value+"'))"
I'm looking at the last code snippet that you tried and here is my feedback:
The report path doesn't look correct. Should be in the format http://evolvdb/ReportServer/Path/To/Report&Parameters=XX
You can't concatenate strings in SSRS with + and need to use & instead.
Example:
="javascript:void(window.open('http://evolvdb/ReportServer/Incoming%2fCensus_by_Date_Range2_Subreport&rs:Command=Render
&startdate=" & Parameters!startdate.Value & "
&enddate=" & Parameters!enddate.Value & "
&region=" & Parameters!region.Value & "
&state=" & Parameters!state.Value & "
&office=" & Parameters!office.Value & "
&status=" & Parameters!status.Value & "
&program_hyperlink=" & Fields!program_code.Value & "
&funding_source_param=" & Parameters!funding_source.Value & "'))"
My general advice for creating SSRS links is to take your browser and start there with zero programming. Ensure that your report path is correct, then manually add a parameter and ensure the report accepts the parameter value correctly. Once you have a working URL example, create a textbox in your report that spits out the URL string you are trying create. This is an easy way to ensure you are getting the expected output and you can compare to the URL that you manually crafted in the first step. Lastly, put the finished expression into the "Go to URL" action and you should most likely have a link that works as expected.

MS Access Parameter Query inside Subform Won't Print

Here's what I've done:
I created a Parameter Query in which one of the crtiterias is Between [Start Date] and [End Date]. I then put that Parameter Query along with other bound fields and created a subform. So far, no problems and it works great.
But I'm having issues when it comes to printing or trying to convert the form into a PDF. As soon as I ask it to print, for example, the pop-ups from the parameter query will pop up asking me the dates again and even after I enter them in (again), it keeps asking me multiple times and cancels the print job.
How do I keep the query from essentially running when I'm trying to print what's on the screen? The same thing happens if I'm trying to create a PDF.
In my not so humble opinion, parameters are handled badly in MS Access.
I think having to enter the values in the query whenever it is run (unless it is a one off experimental query) is just wrong headed. It would be so much easier to automate reports like that if you could just pass the parameters.
Typically, I create a report without the parameters in the where clause of the query, and then pass in your own where condition which gets added on Remou's answer here
You could also alter the query in the report before you call it, but that's pretty hackey.
-- Edit --
I see the confusion. I interpreted what you were doing as a report (not a form).
What's likely happening is you that when it tries to render/format the print job, it's having to make multiple calls to form's record source. And that why it keeps asking you for that data.
From what I understand in your question, you have a query that looks like this:
select foo
from bar
where
yaddah_date between [Start Date] and [End Date]
And then you've used that query as the record source for a form that you are trying to latter print as a PDF. First of all you should probably create a report that is an analogue of the form. And then open the report for printing with a filter on it:
DoCmd.OpenReport "myReport", , , , _
"yaddah_date between " & txtStartDate & _
" and " & txtEndDate
(the last part is basically the filter/where clause that report will apply to the results of the query that's generating its data).
If you MUST print the form, you can do something similar
DoCmd.OpenForm "foo", acNormal, , _
"yaddah_date between " & txtStartDate & _
" and " & txtEndDate
Or you can set the filter property of the form/subform.

how to overwrite a parameter default value in SSRS?

I'm using SSRS 2008 and I have two reports (A and B). B has 4 parameters for which I have assigned a default value. Both reports work fine on its own
The problem is that I want to be able to call report B from report A and use the selected value to overwrite one of those parameters in report B.
So far what happens is that Report B appears when it's called from Report A but the parameter that should be overwritten remains blank and causes the data not to load at all, the. The other parameters show the default values but the 4th one remains blank.
I have tried:
taking off the default value and didn't work.
order: I also read a post here about the order of the parameters and I chose to leave the one that needs to be overwritten last in report B.
data types match among the parameter being overwritten and the value being sent from the parent report (string).
the omit parameter expression is set to false which enables the value to pass through to the drill-down report.
Any thoughts?
I've done this recently by setting a click action in a tablix control. Essentially, I went to the Text Box Properties I went to Action and then set the action as Go to URL. I've then put an expression in for the following (which you can modify to your needs depending on the destination report name and parameters):
=IIf(
Parameters!p_hide_links.Value="y",
Nothing,
"javascript: void( window.open('http://' + window.location.host + '/ReportServer/Pages/ReportViewer.aspx?/Property+Management/" & replace(Parameters!i_this_report.Value, " ", "+") &
"&p_from_date=" & Parameters!p_from_date.Value &
"&p_to_date=" & Parameters!p_to_date.Value &
"&p_lease_exec=" & Fields!submitted_by.Value &
"&p_building_state=" & Parameters!p_building_state.Value &
"&p_division_id=" & Parameters!p_division_id.Value &
"&p_building_id=" & Parameters!p_building_id.Value &
"&p_view_type=d" &
"') );"
)