We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

Unable to set parameters with SetParamters method

Thread ID:

Created:

Updated:

Platform:

Replies:

128643 Feb 2,2017 07:10 AM Feb 6,2017 02:14 AM UWP 3
loading
Tags: SfReportViewer
Alexandru Pastor Opris
Asked On February 2, 2017 07:10 AM

Hello,

We're using Syncfusion 14.4.0.20 and a fresh UWP application which we started just to test out the SfReportViewer control following the steps indicated on the UWP documentation.
And we're trying to set parameters to a basic RDLC report which contains just one paramter and four fields as dummy. It has no Datasets or Data sources at all and everything is done programatically, except the control which is done via XAML.

We are not sure why on UWP the SetParameters or GetParameters methods breaks with the following output: Object reference not set to an instance of an object.
As we've created a simple List with a ReportParameter type and then tried to use SetParameters to pass the only parameter which we defined. Or when doing GetParameters it should return one parameter ClientField which we created on the RDLC.

As last step we also tried creating the same application on a WPF project doing exactly the same steps and almost exactly the same code and everything worked perfectly fine.
We would like to use RDLC reports on UWP.

One last problem which we found on UWP was while trying to use the ReportPath property instead of LoadReport, the SfReportViewer control seems to get stuck on an infinite loading loop while on WPF it works.

I've attached a rar containing both sample projects (UWP and WPF) so you can check it out and maybe see the misake which we made. Or maybe we could get a sample on UWP using RDLC reports.

Have a nice day.

Attachment: SyncfusionReports_89b6097b.rar

Vinoth Srinivasan [Syncfusion]
Replied On February 3, 2017 05:50 AM

Hi Alexandru, 
 
Thanks for contacting Syncfusion support. 
 
Query 
Response 
We are not sure why on UWP the SetParameters or GetParameters methods breaks with the following output: Object reference not set to an instance of an object. 
The report processing gets completed in WPF when report path value is given and ReportModel and parsing is done, so you can set parameter in WPF after reportpath property. But, UWP runs in asynchronous process, so models and parsing are done asynchronously due to this we need to set parameters in the “ReportLoaded” event of the SfReportViewer. We have modified your sample based on this and it can be downloaded from the below location. 
One last problem which we found on UWP was while trying to use the ReportPath property instead of LoadReport, the SfReportViewer control seems to get stuck on an infinite loading loop while on WPF it works. 
In UWP we cannot directly access the physical drive path, so we have used stream of reports embedded to the application. You can create WebApi service to load report using report path in our control. Please refer our UWP reportviewer UG documentation for loading report using service. 
 
Regards, 
Vinoth S. 


Alexandru Pastor Opris
Replied On February 3, 2017 08:01 AM

Hi Vinoth,

Thanks a lot for the answer and the updated sample, tried it and worked perfectly without any issue.

Have a nice day,
Alex.

Vinoth Srinivasan [Syncfusion]
Replied On February 6, 2017 02:14 AM

Hi Alexandru, 
 
Thanks for your update. Please let us know if you require any further assistance on this. 
 
Regards, 
Vinoth S. 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;