I am trying to create a parameter with a drop down function in SSRS - ssrs-2017

The report parameter 'Region' has a DefaultValue or a ValidValue that depends on the report parameter "Region". Forward dependencies are not valid.
This is the error I keep receiving when trying to use this parameter.
I also have a DeliveryDate parameter which it just a standard DateTime type.
I have tried reordering my parameters and also adding a separate dataset in which to run each parameter off of. I'm pretty new to SSRS so any words of advice will help. Thanks!

The error is in the default value for the region parameter. You are probably using a dataset with the Region parameter in the filter/query. For more help, please provide more examples/queries/design and explain what you are trying to accomplish.

Related

Use SSRS report parameter to accept comma separated integer from ASP.NET web app

In SSRS I have a parameter which is of type integer.
Parameter values are bound from dataset, so that after the report gets loaded we can select parameter and run the report.
My situation is I have to pass the same parameter from web app without disturbing the existing functionality. Like "1,2,3" these are Id's which exists in the dropdown.
Elaborating the issue:
I have a query in SSRS dataset which takes a parameter employeeIds (this is a multi select parameter) query is something like this where EmployeeTable.Id in (#employeeIds)
When I used SQL profiler and saw the query executed against my database, it looks like this EmployeeTable.Id in (21,34,56,81)
Which is good, all works well till here. Now I need to call same report from a ASPX page without showing SSRS Filters pane (So I have to construct my params and pass to SSRS report)
Here is how I tried to passed the parameter
parameters(10) = New ReportParameter("employeeIds", "21,34,56,81")
This is throwing error as below
Cannot cast varchar to integer
If I change my Report parameter to string that will break SSRS Parameter filter logic, so I cannot do that. Without disturbing current working SSRS report how can I pass this param from code to Report?
Any help would be highly appreciated!
If I get it right you're trying to open the report in an aspx page and want to open it with your parameter employeeIds set to specific values. So you're looking into setting the parameter value of employeeIds to many values at once.
That could look like this:
parameters(10) = New ReportParameter("employeeIds", new string[] {"21","34","56","81"})
When providing multiple values to a parameter you need to put them in an Array. Have a look here for more info.

Crystal Report same parameter in different commands

I have to use same parameter(paramCompanyId) in both the commands.
I will be setting the parameter value on code.
crystalReportDocument.SetParameterValue("paramCompanyId",LoggedInMembersCompanyID);
Note:
command:crmleadsbycustomer => retrieves report data
command:crmopportunity => dynamic filter dropdown data
Issues:
If I use the same parameter it keeps on prompting without executing
the report.
I don’t want user to enter parameter on prompt so I am setting up in
code.
I don’t want to use separate parameters for each command (this way
works fine)
Edit parameter and change the list of values to "Dynamic" and under "Value", choose the companyID column from command "crmopportunity".
Create a new formula: {?paramCompanyId}=companyID column from command "crmleadsbycustomer".
In the Record Select Expert, use this formula to filter the records.

Set SSRS Report Parameter value with passed Querystring value in SSRS

I have one report, in which I have 13 parameters that fetch the data from Database. I want to set only one Parameter value from Query-string URL.
For example in my case I want to set UserID value to passed Query-string value in SSRS report.
Is it possible to set only one parameter from Query-string and rest of the parameters will be bind with report's Dataset.
can anyone please suggest me the best solution to achieve. Thanks!
It is possible to have some query parameters and some dataset parameters...but its always good idea to create in backend itself. The reason is your fetching all data from backend and filtering out in frontend..if data is more every time report need to pull all data from backend.
This is possible as long as you have default values for the other 12 parameters.
I was facing this issue because I have set two values in Available fields ="y" and ="n"
And In default values ="y"
This is why it was showing disabled. But after removing this " from each values it is working fine now.
So we just need to use Y and N

SSRS Sub-Report only using default parameter to create dataset, even though parameter is successfully being passed from the main report

I have been working with SSRS for the last year and a half or so. Everything I know from it has been learned by trial and error and google. So hopefully I get my terminology correct, but forgive me if I say something incorrectly.
I am using Visual Studios 2015, connecting to SQL 2012 server. I'm creating an asp.net/VB web application to display SSRS reports on a local site. All of my reports up to this point have been a single report with no sub-report. If "sup-report data" was desired, I created a drill-through, using an Action, to navigate to a completely separate page. This has been working really well for all my reports, but now I would like to get a little fancier.
I have been trying to create a SSRS report that contains a sub-report. The main report contains summary information about batches of a particular product that has been run (blue and white portion of the table in the picture).
If a user wants to view more specific details about the batch, they can click on the expand/collapse button of the "Process Order" column, and a sub-report below the summary line will appear with more specific information about the batch (sub report is the light grey/dark grey table).
I configured the properties on the main report to pass the ProcessOrder value as a parameter on the sub-report and create a parameter on the sub report to accept this parameter.
You can tell that this parameter is being passed successfully because I have the respective parameter being passed and displayed just above the table (and it matches the number on the main table). As you can see from the picture, I also have the Process Order number displayed on the sub-report table itself, and this number is different than what is being passed to the report. It is showing a "1", which is the default value that I gave to the SQLDataSource control on my aspx page to build the dataset. I've tried not setting a "Default value" but then I get the following error:
“Data retrieval failed for the subreport, 'test_Sub_Report2', located at: [location on hard drive] Please check the log files for more information.”
Has anyone encountered this problem before, or can anyone give me an idea of a direction to go from here? I feel like I’m very close since I’m getting the parameter successfully passed to the sub-report, but the dataset is just not using that parameter to go get the data from SQL, and I’m not sure how to tell it to do so.
I can add more details and post more of the actual code, just let me know what you need and I will do my best to get it to you. I would have included more screenshots, but I don't have enough rep points to do so yet.
You need to go into the DataSet that populates the sub-report, and go to the Parameters tab, and map the ProcessOrder parameter of the dataset to the Variable that you pass the ProcessOrder parameter to from the main report.
I ended up figuring out the answer. I used the answer from #Lazy Coder on this question: SubReport is not working after adding parameter I was adding the parameters to the sub-report incorrectly. I did have them passed to the sub-report through the table on my main report, which was getting the parameters to the sub-report, but the sub-report was not using these values to create the data set. On my test_page.aspx.vb file I had to change my SubReportProcessing Event Handler. I needed to explicitly set the parameters values there. Since the time that I originally posted this question, I added another parameter to my stored procedure as well, subTotalTime, to correctly filter my results.
Public Sub SetSubDataSource(sender As Object, e As SubreportProcessingEventArgs)
Dim report = DirectCast(sender, LocalReport).DataSources(0)
Dim subProcessOrder = e.Parameters("subProcessOrder").Values(0)
Dim subTotalTime = e.Parameters("subTotalTime").Values(0)
SqlDataSource_PPMS_test_Sub_Page.SelectParameters(1).DefaultValue = subProcessOrder
SqlDataSource_PPMS_test_Sub_Page.SelectParameters(2).DefaultValue = subTotalTime
e.DataSources.Add(New ReportDataSource("DataSet2", SqlDataSource_PPMS_test_Sub_Page))
End Sub
SqlDataSource_PPMS_test_Sub_Page is the id of my SqlDataSource object on my aspx page.

Bi Publisher - Report with 2 different Datasources

I have a Report that base on two different Datasoeurces. The Once is a sql-query with a parameter (in the WHERE clause) and the second is a XML-Data... Both (Parameter and XML-Data) I send over a httpRequest to the BI-Publisher. (I use the BI Webservice and use for the XML-Data the setReportData(byte[]) Method) and for the Parameter the setParameterNameValues(...) )... Now the problem is that the Publisher only use one of both. And only in my report are the values of the sql-query or the values of the XML-Data... So there is any solution to get all Vualues of both Datasources in my Report?
PLEASE can you help me? THANKS THANKS THANKS
you can build a data template for your report. In the data template, you can specify as many different data source as you want.
You could append the output of the SQL-query as XML, into the XML-file that you already have.
Ensure that the structure of the output is in sync with the existing XML structure.
And then, create a single report definition with data-source specified as XML-Data and run you report. This way - You will have both the data from the SQL-Query and the XML-data that you already have.

Resources