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.

Change Report Path during Running

Thread ID:

Created:

Updated:

Platform:

Replies:

128483 Jan 25,2017 06:38 AM Jan 27,2017 12:05 AM ASP.NET MVC 3
loading
Tags: ReportViewer
Anas Alwindawee
Asked On January 25, 2017 06:38 AM

Hello Dears,

I just wonder if you help me regard my below query.

I have a report viewer rendered with specific rdlc report, I want to change the rdlc report and keep the same dataset and datascource during running and without get back to controller action, where my both reports are with the same dataset, is that possible.

BR

Yuvaraj Devarajan [Syncfusion]
Replied On January 26, 2017 02:53 AM

Hi Anas, 

Thanks for contacting Syncfusion support. 

We can dynamically change the Report RDLC file in viewer page by changing the report name in reportpath property and we can pass the datasource value in WebAPI controller as shown in below code example.  

   <script>       
        function onChange(args) { 
            var url = document.URL;                                  
              $("#container").ejReportViewer( 
              { 
                  reportServiceUrl: url + 'api/ReportApi', 
                  processingMode: ej.ReportViewer.ProcessingMode.Local, 
                  reportPath: '~/App_Data/' + args.selectedText                   
              });           
        } 
    </script> 

public void OnInitReportOptions(ReportViewerOptions reportOption) 
        { 
            reportOption.ReportModel.DataSources.Clear(); 
            reportOption.ReportModel.DataSources.Add(new ReportDataSource { Name = "Sales", Value = SalesDetails.GetData() }); 
        } 

We have prepared a sample and it can be downloaded from, 

Regards, 
Yuvaraj D. 


Anas Alwindawee
Replied On January 26, 2017 04:03 AM

Hi Yuvara,

Thanks for your kind support, it's work perfectly.

BR

Yuvaraj Devarajan [Syncfusion]
Replied On January 27, 2017 12:05 AM

Hi Anas, 
 
Thanks for the update. We are happy to hear that your issue is resolved. 
 
Regards, 
Yuvaraj D 
 


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.

;