This is a migrated thread and some comments may be shown as answers.

Multivalue report parameters in IE gives invalid parameter error

2 Answers 56 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Rick
Top achievements
Rank 1
Rick asked on 13 Sep 2016, 01:58 PM

Telerik HTML5 report viewer. I am passing in JSON data as parameters. Using ReportTypeResolver.  If the parameteres are not multivalue, the reports work in Chrome and IE. If the parameters are multivalue, The reports work in Chrome, but not IE. IE gives error: Missing or invalid parameter value. Please input valid data for all parameters.  

From another thread, I see that- Multivalue report parameters are evaluated as array of objects. Which is what I am passing.

My JSON data (Using jsonData.stringify writing to console) looks like this: 

{"ReportName":"Onshore_FieldServiceTicket","DisplayName":"Field Service Ticket By Client/Unit","SiteId":"f7602d89-eb50-479b-bd3d-bbfa146ff4be","StartDate":"8/1/2016 12:00:00 AM","EndDate":"9/30/2016 12:00:00 AM","StringInputClients":["FE56F7C8-FFD7-4D38-BF38-D5088FAEA93F"],"StringInputTrucks":["C19264F9-B411-4CE8-98F0-276C704AFC71"],"StringInputTickets":["CD024852-97C3-4861-9C9F-D73FBD09F642","9C9DD5DA-BED7-40BC-BA5A-F01129D8A046"]}

 

Again - if I run a report without the StringInputClients, StringInputTrucks, and StringInputTickets parameters, the report works in IE.

 

Any ideas as to why this is throwing an error in IE? 

 

1.reportSource: {
2.                            
3.     report: "ReportingLibrary." + ReportName + ", ReportingLibrary, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null",
4. 
5.parameters: jsonData,
6.
                        },     

2 Answers, 1 is accepted

Sort by
0
Stef
Telerik team
answered on 13 Sep 2016, 03:17 PM
Hello Rick,

If a multivalue report parameter has configured its AvailableValues, the passed values must exist in the specified Value Members. If you are working with GUID values, convert them to String in order to be able to map them to report parameters and to have comparisons working.

If the report is created via VS Report Designer, please use an event like ItemDataBinding to check what processing values are submitted for all report parameters - Using Report Events. Check also how the values are used in the report.


In order to provide you more accurate suggestions, please open a support ticket and send us a demo project that reproduces the problem.

Regards,
Stef
Telerik by Progress
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Rick
Top achievements
Rank 1
answered on 13 Sep 2016, 09:01 PM

For anyone else struggling with this. Turns out my data was being changed from array to object in IE. I was passing data to the html5 report viewer using $("body").data("jsonData", JSON.parse(json)); window.open(url, '_blank');  And then retrieving the data using: var jsonData = window.opener.$("body").data("jsonData");

This was not working. I was getting: "StringInputTickets":{"0":"CD024852-97C3-4861-9C9F-D73FBD09F642","1":"9C9DD5DA-BED7-40BC-BA5A-F01129D8A046"} in IE.

Working in Chrome with this data: "StringInputTickets":["CD024852-97C3-4861-9C9F-D73FBD09F642","9C9DD5DA-BED7-40BC-BA5A-F01129D8A046"]

----------------------------------------------------------

The fix. Use localStorage. localStorage.setItem("jsonDataVar",json); in the parent page. And 

var json = localStorage.getItem("jsonDataVar");
var jsonData = JSON.parse(json);

in the viewer.

//Not working
$("body").data("jsonData", JSON.parse(json));
window.open(url, '_blank');
 
//and in report viewer
var jsonData = window.opener.$("body").data("jsonData");
 
//WORKING
localStorage.setItem("jsonDataVar",json);
window.open(url, '_blank');
 
//and in report viewer
var json = localStorage.getItem("jsonDataVar");
var jsonData = JSON.parse(json);

 

 

Tags
General Discussions
Asked by
Rick
Top achievements
Rank 1
Answers by
Stef
Telerik team
Rick
Top achievements
Rank 1
Share this question
or