how to pass the parameter 08-2019 in birt report - birt

how to pass the parameter 08-2019 in birt report I need to pass this month and year parameter which I marked

You do that with query parameters. You first need to exchange the date string in the query with questions marks (?). For your example, this will be 5 question marks.
Edit the Dataset, change the query, and then click Parameters on the left. Important: you need to add a parameter for each single question mark even if they all relate to the same value. Parameters will be added to your query in order of definition. If you have more or less parameters than question marks in your query, an exception will be raised. So keep these synchronized.
As you do have a specific date format, do use String as parameter type. You can use a report parameter as a reference and pass that string dynamically (which is most likely what you want).

Related

SSRS Report Parameters Interactive

I have a report that requires 3 parameters, all 3 has q query to pre populate them using a dataset for each, so the under their properties the available values is selected with the query. Default were also set to use the same query. This work fine.
My problem is when the user of the report wanted to enter the values themselves rather than going into the list populated by the query. Users know the value that they wanted to enter so it's faster for them to enter rather than select. SSRS report seems not to give you the ability to enter if you have set the available values and default values for some reason. Is their a way to go around this please?
Many thanks.
There is one straight forward way to use comma separated multi value parameter rather than list where user enters input.
Below link explains in detail, but I am quite sure you do not want to stick to below solution.
https://www.mssqltips.com/sqlservertip/3479/how-to-use-a-multi-valued-comma-delimited-input-parameter-for-an-ssrs-report/
Another thing you could do is keep your multi value parameter as list as it is and create a text input parameter.
Now if user want to simply choose from list fair enough you will have to handle second parameter as null because user chose from list.
Then on your dataset check and apply filter as 2nd parameter value as not null.
Same goes if user does text input then multi value parameter as not null.

Hidden Parameter is missing a value

In my report, i have created a xxx parameter which takes values from the report data set.
xxx parameter is not being passed to stored proc which is used to show the data for the report.
Now When the report does not have any data for other parameters, i get an error saying xxx parameter is missing a value.
I tried allowing blank values in the parameter properties.
Check that parameter's - Available Values by going to report parameters properties.
It must not be specified any values. So we should set it as None
Another way is,
Just add a blank space at Specify values - in Default values inside report parameters properties.
Third way
Ido an "if exists" statement for this to go away. It worked for me because it makes it always return a value even if that value is not need by my query.
if exists (my select query)
my select query
else
select '2'
// '2' would never be used, but it made ssrs stop giving me
// the stupid error and execute
This should help.

How to exclude values when passing multivalue parameters in Visual Studio?

I have an Action that opens another report and it passes a multivalue parameter. Is there a way to exclude for example, the first value of the multivalue parameter?
Assuming that you are using SQL Server for your queries.. when you pass the list of parameters into your subreport, I would take the parameter pass it to a splitstring function and then exclude the first row and then use the result in your where clause for your subreport parameter.
This way you have flexibility to exclude what ever row you want by passing the row number as a parameter as well.. just saying.. and you cal also check that you have more than one parameter selected before excluding it.. else you won't get a result back

How do I set an SSRS Parameter that doesn't have a value to something else?

I have an SSRs Report with a parameter that gets information from SQL. If it hasn't found anything, at the moment it is just empty. Is there anyway to set it such that if it's empty it will return a different value, say "Please Extend Date Ranges" and disable the parameter?
If you using it to fill it using the SQL and using it for only internal purposes then there is option to make the parameter internal and it will be hidden and it will does not prompt the user.
Make a change to the stored procedure or query that populates the parameter. Include some logic so that if no results are returned by the query you are using now, it adds a row with the default label you want.
But no, you can't disable the parameter dynamically, I don't believe.

VS Problems with Dateadd function using parameters in a query

I am creating a report in MS Visual Studio 2008 epxress. The dataset should be limited using parameters. I want the users to have the ability to choose a starting date and then name the number of years into the future they want to see the data.
I created 3 parameters
1. fromdate (Type:Date/Time; visible): This is where they choose a date
2. futureyears (Type: Integer; internal): This is where they should write the number of years into the future
3. todate (Type: Date/Time; internal): This is an internal parameter with the following function as the default value:
=dateadd(DateInterval.Year,Parameters!futureyears.Value,Parameters!fromdate.Value).
fromdate and todate are then used in the query of the dataset to limit the data.
The following error appears when I try to preview this:
"The DefaultValue expression for the report parameter 'todate' contains an error: The expression that references the parameter 'futureyears' does not exist in the parameters collection. Letters in the names of parameters must be use in the correct case"
The thing is: The parameter "futureyears" does exist, when I write the function for the default value of todate, I choose it from the parameters section. so it is there.
I tried to run this report without the futureyears parameter and typed in a random number in the dateadd function. Without the parameter in question, the report runs fine. the problem must be the parameter "futureyears", but I don't know where the problem is. Thank you for your help.
I just figured out the answer myself. Leaving this here in case anyone has a similar problem.
In the parameters folder, the "futureyears" parameter was listed UNDER the "todate" parameter.
All I needed to do for it to work was shift the futureyears parameter ABOVE the todate parameter. Now the report runs fine.

Resources