SSRS 2008 R2 Visibility Based on Report Parameter - ssrs-2008

I am having some issues with dynamically changing report item visibility based on a report parameter.
Visibility is set correctly during the initial report run but WILL NOT change visibility of report items after the initial report run, regardless of if the report parameter changes. The expression I have on the Hidden attribute is below.
=IIF(Parameters!sr_emt_filter.Value = "ALL" And Parameters!sr_emt_direct_filter.Value = "ALL", True, False)
These are true report parameters and not query parameters. I currently have the parameters set to NEVER refresh the data sets as my process for this report is to pull all data on the first run and then use report parameters to filter down the results on an ad-hoc basis without re-querying the database (no need to discuss if this is a good approach or not, it is a requirement for what I am doing).
Any thoughts?

Related

Multiple Parameters in crystal report

I have created a crystal report layout with 3 parameter.
The 3 parameters are
1.) Date range
2.) Supplier
3.) Location code
User will always give input to the date range but will select either of these remaining two parameters based on the usage.
Is it possible to configure in one single report with optional option in Crystal layout
Assuming you are not using a very old version of Crystal, when you create or edit a parameter, look at the list of parameter properties: one of them is 'Optional Prompt' -- simply change it from the default of False to True.
Then, in your record select logic you can use the HasValue() function to check whether the user provided a value for that parameter.

SSRS Dynamic Hypherlink

I have a report that list different report names, but I wanted to add a dynamic hyperlink that when the report name is clicked that report will run. Note that the report name is not always the same, it changes daily. So far, I only know how to add an Action either Go To Report or Go To URL and this is on a single instance.
You can put the report name in an expression for either the Go To Report or Go To Url Actions.
You can reference hard-coded values, or have the report name in a field in your data.
In this example, the Report Name field is used as the report to go to when the text is clicked.
You could also hard code the values and choose based on another condition using an IIF statement.
Then have an expression to inserst the desired report name into a string with the rest of your URL for the report server.
="http://sql01/Reports/Pages/Report.aspx?ItemPath=%2fDepartments%2fReporting%2f" & IIF(Fields!RECORD_TYPE.Value = 1, "Report1", "Report2")
How you do it would depend on where the logic is for choosing which report to show. Is your query going to return the report name or are you going to use other logic in the Go To Action to determine which report to go to?

Ssrs run only one of the subreports based on parameter

I have a report, and the report has 5 subreports. There is a parameter named "SubreportNumber". I want to run one of the subreports, based on that parameter. Just one of them should run. Effectivity is important in my case. Is this possible?
I'm using an IIF statement to hide (using visibility) my reports based on a parameter value, as described above.
Then I take the same approach when specifying the sub-report parameters.
This can basically be done on any one of the parameters, if the report should be showing then pass the parameter, else pass nothing. (If you pass NOTHING as a parameter to the report, it won't run the report, ie. performance increase...)
Example for Year parameter below:
=IIF(Parameters!SubreportNumber.Value = "1","YEAR(NOW)", Nothing)
You can hide the reports you dont want based on your parameter.
To do this: Go the Report's property, under visibility section. Set Show or hide report based on expression. You can write an expression to hide report depending upon your parameter.
This will just hide the reports. Make sure there are no stored procedure or they will be execute irrespective or whether the report is visible or not.

Dynamic Dependent Parameters in Crystal Report

I am looking to create a report based on two parameters, VENDOR and PONUMBERS.
I would like to create the report in such a way that on loading report when we choose a vendor
as First parameter it should show just the PONUMBERS for that vendor on second parameter. Is it possible in Crystal Reports ?
yes its possible...
While creating a parameters use dynamic parameters not static from the dropdown
select first parameter as Vendor and second parmeter as PONumber.
Now when you refresh the report second parameter will be filtered as per the selection of first parameter.

Crystal sub report stored procedure parameter

I'm using Crystal reports designer Version 11.
I have a report which calls a subreport and I have set up linked parameters.
The subreport is using a stored procedure.
I can't see how I feed to the parameters passed to the sub report into the stored procedure that is returning the data.
This is really late to the party, but I'm researching the same problem (I think) and have found a solution. In the main report, right-clck on the sub report and "Change Subreport Links".
In the top section, choose your parameter in the main report and click the right arrow to add to the "Field(s) to link to". In the bottom, sub-report section of the window, change the left side "Subreport parameter field to use" drop-down. It defaults to creating a new parameter in the sub report and you don't want to do that. You want to use an existing paramter (that was automatically added by using the stored procedure). In the drop-down choose that parameter that was auto created by the stored procedure.
Doing this means that you can have a parameter in the main report that you can automatically pass to the subreport which means you don't have to enter the same value for two separate parameters.
I hope this helps. It works great for me.
I understand this question is old but have found no satisfactory answer elsewhere. The simple solution I found is to implement the stored procedure from within a crystal command just like any other command sql. I could not get the parameters to show up in the bottom left drop downs no matter what. Something similar to below where ZNG_PROACTIVE_STREET_SWEEPS is the name of the stored procedure and the two parameters are what the stored procedure takes in.
[dbo].[ZNG_PROACTIVE_STREET_SWEEPS] #StartDate ={?begindate}, #EndDate = {?enddate}
After considering and then some searching, I take back my original answer.
Once you have parameters defined for the SQL Command, they are visible/available as parameters from outside the report. When you set up the links from the calling report to the subreport, the subreoprt parameters will be visible and available and you can link fields from the main report to those parameters.
A recent post in someone's blog covers the same activity with subreports driven from SQL Commands
Using SQL Commands and Parameters
I hope this helps and I hope that my original answer did not negatively affect your progress on your report.
Original answer
You cannot pass parameters to a stored procedure from report objects. The stored procedure will respond to CR Designer when you first reference the SP when you define the report. CR creates links to stored procedure parameters from the data source interface only, not from the report.
You will see an entry in the Parameters objects, but it will be read-only -- you can place it in the display section, but you cannot set it from report formulas, passed values, etc. Using formulas to process data before calling the stored procedure will not work, nor will trying to pass data through subreport links from the main report.
Using other design tools, you can have code that controls the data source interface, and processes data that is passed in parameters, but in CR Designer, you are pretty much left with the bare minimum options. You can right-click on the parameter and do things like set default values, set prompting text, set a pattern / mask for the format, but that's about it.