Multiple Parameters in crystal report - crystal-reports

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.

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.

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.

SSRS Report Subscription Parameters (Date Values)

I am looking to setup a report subscription in SSRS 2008 R2 where the client user can set the date parameter to whatever the individual user would like. I have been reading multiple suggestions to use =Today() in the parameters but this syntax does not work for me. Does anyone know whether is is possible to set my from date to "Today -30 days" and my to date to "today"? What is the syntax used in the subscription parameters?
Settings:
Error:
As described in the above link provided by praveen the solution became to create two parameters in the report containing integer values with a label that describes the periods i would like to use in my subscription. These parameters can easily be set to "Hidden" so they are not showing when you would like to run the report by hand. I also chose to set the default value for both parameters to 1 which is my value for Today(). This mean my report will start out with having today's date selected in both of the visible date parameters.
In the two date parameters that are shown in the report you can then set the default value to a switch of the values you are able to pick in your hidden date parameters. You can now setup a subscription that will work and that looks like the following:

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.