Reporting services cascading parameter not working - ssrs-2008

I want the report to pick default date time values based on a location parameter the user picks, but the problem is that the date time parameters don't update when the user picks a different location. I made sure to put the location parameter above the date time parameters but it is still not functioning as I expect, what am I doing wrong here?

Unfortunately this is "by design".
Microsoft Connect - SSRS - default not refreshed for cascading parameters.
Posted by Microsoft in 2007: "As described, this is not
a bug. We do not re-evaluate the default value for a subsequent
parameter unless the selected value is no longer in the valid values
list. We do not know whether the current value was specifically
requested by the user or it is there because of the default. You could
make a case to have control over this behavior through some sort of
property but it is currently working as designed."
I think this is a bug in SSRS. But Microsoft have closed the issue. Please log onto connect and vote this to be fixed if it is affecting you too
Microsoft Connect - Your feedback improving Microsoft products.
Workaround / hack is here: Boyan Penev - SSRS Cascading Parameters Refresh: Solved.
However the hack only works if the dependent parameter has a LIST of valid values, and other users report that it only works for the first dependent parameter.
If the dependent parameter is free-form entry or a date, the hack cannot be used at all.

Consider putting your datetime values in a dataset with logic based on the location parameter
SELECT CASE #Location WHEN 'Paris' THEN GETDATE()+10
WHEN 'Berlin' THEN GETDATE()+11
WHEN 'New York' THEN GETDATE()+8
ELSE GETDATE() END as DefaultDate
Then set the date parameter default value to this dataset.

Unfortunately, SSRS does not refresh cascading parameters once they have been set. Other than reloading the report, the only way that I am aware of is to create a custom UI using the ReportViewerDialog.

I have found that if you use a stored procedure to render the child parameter, by passing in the parent selection, the dataset will get refreshed

I've been having the same issue, and realized it was a simple mistake causing this issue. Posting here for OP and anyone else searching for this issue.
You need to ensure that all parameters, in SSRS, are set to the correct value field, not the display field. You can replicate the cascading parameter issue that many have identified by simply selecting a "Name" field in the parameter default values instead of the "Value" field requested. This will populate the drop down correctly but nothing will be selected, and the cascade will stop. It may then appear as though the cascading parameters are not refreshing because of the Closed be Design issue.
In SSRS In Report Data tab, right click parameter and select
Parameter Properties.
Select Default Values.
Ensure that Value Field is set to the correct value for your sproc, not the value that you present to report users.

Related

Jaspersoft Studio: Force input parameter of subreport to be entered manually

In my main report I get a (small) list of string values from the data base. I then want to use this list for selecting records in a subreport, along with other input parameters:
The user shall be able to select records based on a range of begin and end date -- this is easy using an input parameter of type java.util.Date with "Is For Prompting" set to true. Another criteria shall be one or more items from a list showing values from a data base field. I could define the list in the report template, but then I'd have hard-coded strings (filled from the data base, but at definition time only).
Now the dilemma is: If I define the input parameters in the main report, I cannot get the values for the list beforehand; if I define them in the subreport, I get no prompt at all, so there's no way to set any of them.
So the report requires values for start and end date, and a list of string values to select from (multiple itmes can be selected). This list shall be built from values from the data base. In the subreport all these values shall be joined into a filter for the records. A user shall be able to define the dates and select items from the list manually before executing the report.
Is there a way to achieve this?
After some more hours of trial & error, and some more research, of course, I found that the keyword is "Query-based Input Controls". This documentation describes their creation on the JasperReports Server. Such input controls can be edited in Jaspersoft Studio as well, however, they actually work on the server only. Anyway, this is the solution to my problem.

Set Default Current date in parameter fields Crystal Report

I have a problem with Crytal Report (CR) 2013, my customer want to default current date in parameter fields in Crytal Report when they open it. I try to do it with many ways but it not work. i'm looking forward to ur help. Tks all.
Current form
The only way I know to set a current date to a report parameter is by adding your report as a subreport and passing a formula returning current date as a source for the parameter. You may add also a parameter for date in the main report and inside the formula check if the provided value is for example 1/1/1900 then use current date. This will work if you do not have subreports in your report ( Crystal does not support nested subreports) and the user should be aware that date 1/1/1900 should be selected for current date.
Generally speaking default values should be handled by the software , which is running the report. Ask your customer to try application like this one: http://www.r-tag.com/Pages/CommunityEdition.aspx.
I am posting the link because this software is free. My guess is that there are other applications , which are able to set default values for report parameters. You can do your research. Here is a sample video setting a default value for date: http://www.r-tag.com/Pages/Preview_ParameterTemplates.aspx
The video is for different report type, but Crystal reports will be handled in the same way.
I am a colleage of Hai Pham. I give you more information about this issue.
1. datasource: stored procedure
2. set current date is default value in import parameters popup
popup image
3. users can select another value
Thanks,
Dai Nguyen Quang.

Crystal Reports 2008: field shows as blank even when data is returned from the database?

Issue
I have a report in CR 2008 that I inherited from someone else
A sub-report in the report pulls its data from a database view
A field exists, "TRANSCBFLAG" in the view -- it's a string with values of "Y", "N", or "D"
The view has these values
The report displays every other value, but not this one field.
Attempted Resolutions
Suppression attribute? -- No, it's unchecked
Field type issue? -- No, it's a string
Font and background? -- No, it's black font / white background
Suppression / formatting formulas? -- no formulas on display or suppression in subreports or report
Space constraints? -- stretched the field out below all other fields -- still shows as blank
Check to make sure Crystal can see the data -- right-clicked field, select "Browse Field Data", and it came back with the three potential values. So, it can see them in the DB at least, and potentially even in the fields itself.
Just a local Crystal Issue? -- No; I uploaded the report to Business Objects XI for a test and all fields still display except that one.
Question
Where in the process could I be going wrong? It shows when I run the view directly from the database, and every other field shows perfectly in Crystal the first time.
I would assume you did 'Verify Database' but if not that's the first thing I would have tried.
And just a piece of advice... always, always, always run your reports off of a command you write yourself instead of using Crystal's GUI to let you select tables/views/procs. This allows you to make pretty much any kind of change to the query you want and even completely change the source from where your data is coming without wiping all your report controls away. If the modified query has the same field names it will always work seemlessly and if not it will give you a chance to redirect which fields are supposed to come from where. Otherwise... you will have to recreate everything as you just experienced.
There may be a more correct answer, but in a pinch, removing the view from my report (thus removing all fields), adding the view again, and redoing all fields caused the field to display correctly. Not sure how or why.
A further explanation would be appreciated, but for now, that's all I've got.
I had the same issue on a new report I'd created and finally found that the issue was in one of the parameters I used in my command SQL - it had double }} at the end. Eliminating one of the }s allowed the query to return data.
That said, go over the SQL in your database expert with a fine toothed comb, and you'll likely find the issue!

Parameters and Ranges of Values

I need to create a report in Crystal 2008 and I've haven't developed a report using Crystal in many years.
When the user runs the report, I want them to be able to enter a start date and end date. I assume I can do this by using parameters. My question is this. Can I do this with a single parameter value or will it require two parameter values? Ideally what I would like to do is to allow the user to enter a start and end date in one parameter/prompt combination. Is this possible?
Thanks - Randy
This is possible and what your talking about is a ranged parameter value.
Create an parameter in Crystal Reports
set the type to Date
In the options Area. you will see a option called Allow range values. Set this to true.

Can I assign a value for one parameter

I am using crystal reports 2008. I want to generate a report for which i will get one value from one subreport and i want to pass this value as a parameter so that i can include this value in the sql command.
For eg.
From my subreport i will get customerkey and i want to pass this value in the sql as
{?customerkey}
Sql is 'select card_number from customers where customerkey={?customerkey}'
For this i created parameter in the command and added like this.
But what my problem is this customerkey is getting from subreport(using shared variable).If i get a value customer_key from subreport how will i assign this value to {?customerkey}. I tried like assighning this value but i dont want to popup {?customerkey}this value as a parameter.
Can anyone help? Please
So you want the data shown in the main report to be based on a parameter passed to it from a subreport? I don't think this is possible - the Report Processing Model (described here) states that SubReports are in 'Pass 2', while data retrieval is in 'Pass 1'. This means that the parameter prompt will always appear first.
You might instead be able to have the main report contain TWO subreports, the first of which is used to retrieve the parameter and the second uses it. That can get very messy, especially when dealing with page headers and footers.