I built two reports in SSRS: one master report and one subreport. The subreport is embedded in the master report. There are several parameters that the subreport takes: Begin date, end date, etc.
I then tried to run the master report and received error saying the subreport could not be shown. I googled about this error and discovered that the type of the parameter being passed to the subreport should match the type of parameter that the subreport accepts.
Bearing this in mind, I checked more than dozen times of the types of parameters passed to the subreport. No luck.
I answered my own question because I figured this out in the end without any luck finding the solution from google. Also I thought somebody else might have the same problem.
This problem is like a special case of the type issue. While the type of data being passed to the subreport should match the type of the parameter that subreport takes, the story changes when you are trying to pass type DATETIME.
Say your master report takes in some DATETIME type parameter (In my case my master report takes Begin Date and End Date, both of which are DATETIME type parameters). When you are calling the subreport that also takes DATETIME parameter, you NEED TO change the DATETIME type to TEXT type (in the context of SSRS), or string. Keeping DATETIME type will cause the error of not showing the subreport.
I figured this might be due to that DATETIME type that should have been accepted in the subreport is implicitly converted to TEXT type behind the scene.
UPDATE (12/05/2017): I should be more clear about this: by changing the datatype I don't mean you should change the type of parameter, but you should consider to use Format function in the expression when passing this DATETIME type parameter to the subreport so that this parameter will be formatted as a string.
Related
I need to pass a date parameter as per below url. I'm trying this from the browser:
http://Server1/ReportServer_SQLTest?/Accounting%20Statements
&rs:Command=Render
&rdt=1115
&prt=187
&edr=11%2f02%2f2021TO
&cdr=11%2f02%2f2021TO
&sdr=11%2f02%2f2021TO
&ed=11%2f02%2f2021
&cd=11%2f02%2f2021
&sd=11%2f02%2f2021
&Grp=45
&ReportFormat=consolidated
&filter1=3
&event=187
&StyleOption=1
&vis_usr=-9999
&call=51fc7815-18e6-4574-a59a-c8a9d223df64
&rs:Format=pdf
it threw an error
Default value or value provided for the report parameter 'edr' is not a valid value. (rsInvalidReportParameter)
I tried in various ways passing the edr date parameter. Still throws error. Any suggestions?
It would look like the issue is that your edr, cdr and sdr parameters all have TO at the end of the passed value, which is not part of any valid date format that I am aware of.
I solved the problem. In SSRS TO means Today; and YS means Yesterday. The SSRS validates if today is 11%2f02%2f2021TO; So I changed as below. I took these parameter values from existing db entries.
&edr=11%2f09%2f2021TO
&cdr=11%2f09%2f2021TO
&sdr=11%2f09%2f2021TO
I am having an issue with a parameter and the convert function when executing my query in Report Builder.
I am having the following in my code:
CONVERT(VARCHAR(11), COALESCE(Status.POBDate, Status.[Sched Collection Date]),(#DateFormat)) AS [Collection Date]
,CONVERT(VARCHAR(11), Status.[Act Del Date],(#DateFormat)) AS [Delivery Date]
The (#DateFormat) parametner has data type Integer and available values as per the bild below.
The funny thing is that I can run the query in SSMS without any problem, but when trying to apply some adjustments in Report Builder, and save the report, it is complaining about the invalind argument even though, the parament (#DateFormat) was not edited anyhow. The report worked perfect online and only after opening it in Report Builder it started to complain also when I do not apply any new adjustments.
Any idea what can be wrong and how I could solve it?
I have checked some ideas here on stackoverflow, but nothing worked out so far.
Tones of thanks in advance!
Your parameter type is text not integer and that causes the error.
You can verify it by casting the DateFormat parameter to INTEGER in your SQL code
CONVERT(VARCHAR(11), COALESCE(Status.POBDate, Status.[Sched Collection Date]),CAST(#DateFormat AS INTEGER)) AS [Collection Date]
As a suggestion use the parameter to format the dates inside the report.
How to do it:
Remove conversion from your SQL code
In your parameter set it to text and as values set the date format string
For US ="dd/MM/yyyy"
For UK ="MM/dd/yyyy"
For your date fields set the format expression to = Parameters!DateFormat.Value
Hi I am using SSRS 2008.
My set up is MainReport with dataset1 and 1 parameter - OrderID. One of the columns in dataset1 is ShippingID.
My other report called - SubReport has 1 multivalue paramter - ShippingID.
I am trying to use ShippingID from Main report as multi-value parameter for Subreport.
I tried different threads here but mostly they are diffrent than my scenario.
How do I go about setting this up, is that even possible?
I have been trying to set it up for whole day but unsuccessfully.
In my scenario one Order can be on multiple shipments.
One of the things I tried is creating new multi-value parameter in MainReport - call it shippingIDs_sub and mapping its default value to dataset1.ShippingID. But when I try to run report I get error "The 'shippingIDs_sub' parameter is missing value" - because my MainReport would sometimes return NULL in ShippingID column.
My scenario is very much similar to this
SSRS passing parameter to subreport
although I sometimes get NULLs in the column used as source for multi-value parameter.
Is there any way to filter out NULLs and run subreport only for existing IDs?
In the Action where you call the sub-report, where you map to shippingIDs_sub, use an expression to pass some valid value whenever the value in your dataset is NULL.
=IIF(IsNothing(Fields!ShippingID.value),"Some Valid Value",Fields!ShippingID.value)
As to this:
Is there any way to filter out NULLs and run subreport only for
existing IDs?
No, you can't turn off the ability to go to a subreport, but you can "hide" it by changing the appearance of whatever your user clicks on so that it doesn't look like it's clickable. For example, in our reports, when something is clickable, we make it underlined in blue. So if I don't want to user to click it, I just make it the same font color/style as all the other text. But it doesn't stop a determined user from clicking on it anyway if they want.
I have main matrix report and I want to navigate my sub report from main report by
Jump To URL:(Using below JavaScript function) method.
="javascript:void(window.open('http://localhost/ReportServer/Pages/ReportViewer.aspx?%2fKonsolidata_Data_Exporting_Project%2fEXPORT_REPORT_TEST&rs:Command=Render&RP_cntry="+Fields!STD_CTRY_NM.Value+"&RP_cll_typ_l1="+Join(Parameters!RP_cll_typ_l1.Value,",")+"'))"
It is ok for the Single valued but giving exception for the multivalued
Like
An error has occurred during report processing. (rsProcessingAborted)
Cannot read the next data row for the data set DS_GRID_DATA. (rsErrorReadingNextDataRow)
Conversion failed when converting the nvarchar value '1,2,3,4' to data type int.
Basically I have defined Parameters!RP_cll_typ_l1 as multivalued into my subreport as per ssrs multivalued parameter passing method.
The value is going on sub report as '1,2,3,4' (not understandable by data set)
It should be like as '1’,’2’,’3’,’4' or 1,2,3,4
How can I resolve this please help if any have solution?
Thanks
Kali Charan Tripathi(India)
tripathi_soft#yahoo.co.in
kalicharan.tripathi#in.schneider-electric.com
To use multvalue parameters via URLAccess in SSRS, you have to repeat the parameter names for each value
So instead of
...&RP_cll_typ_l1=1,2,3,4&...
you would have
...&RP_cll_typ_l1=1&RP_cll_typ_l1=2&RP_cll_typ_l1=3&RP_cll_typ_l1=4&...
I am new to reporting services and have a reporting services 2005 report that I am working on to use as a base report template for our organization. I am trying to place the date that the report was last modified on the report server into the page header of the report. However, I keep getting a 'ParamX' parameter is missing a value error when I try to This is what I have done:
Set up a Parameter ReportName with a default value of Globals!ReportName. It is also hidden and internal.
Set up a Dataset ReportHeader that calls a stored procedure that returns the date the report was last updated or another date, if the report is not on the report server. It has a parameter #ReportName assigned to the Parameter!ReportName.Value. The Dataset returns values when run on the dataset tab in the BI tool.
Set up a Parameter ReportVersion that has a default value Query From based on the dataset ReportHeader and picking the ModDate column. It is the last parameter in the report parameters list.
I assign a textbox to the parameter.
When I preview, I get "The 'ReportVersion' parameter is missing a value whether I place it in the report body or page header (which is where I want it). I have deleted and added the parameter again, toyed with the hidden and internal settings on it.
What does this error really mean, what I am missing, and can I even do this with parameters?
Thanks In Advance
Jim
If I understand what you're doing, it sounds like you want to be using a field where you're implementing a parameter...
You are returning the ModDate from the data source, correct? If you're doing this, you can simply throw a text box in there, and use something like this: =Fields!modDate.Value to display it.
Parameters are values that go in to the query, fields are what it returns.
Hope this helps...
EDIT:: OK so are you trying to retrieve the mod-date column value from the reportserver db? If that's what we're talking about, you'll need to add a few things to the report. Add a datasource to report db, a dataset containing the date (query below), a list object in the report linked to the dataset, and a textbox in said list object to display the field. If you hit the report server with a query like this:
SELECT MAX(ModifiedDate) AS ModDate FROM catalog WHERE name='myReportName'
That will return your modifieddate from the ReportSErvices Database as a field that you can use.