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

Change Page Index of ReportViewer on Page_PostBack

5 Answers 174 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Sunny
Top achievements
Rank 1
Sunny asked on 25 Feb 2009, 09:26 AM
Hello,
          I want to change the PageIndex of ReportViewer when the Page is being Post_back.
          When I bind new data then, if i am viewing the 5th page & new data contains records for only
          4 pages,
                  then it generates an Error : Unspecified error while processing the report request.

          Please reply me how do i reset the page index of ReportViewer to its default when i bind data again
          to ReportViewer.
       

Thanks,
Jaspreet

5 Answers, 1 is accepted

Sort by
0
Steve
Telerik team
answered on 25 Feb 2009, 12:47 PM
Hi jaspreet,

The web report viewer is currently refreshed on postback and when you assign a new report to the viewer. However in your case, the viewer is not aware that you have changed the backend data and therefore you would need to force it to update by re-assigning the same report to it i.e:

(ReportViewer1.Report as MyReport).DataSource = <your_new_datasource>;
ReportViewer1.Report = new MyReport();


Greetings,
Steve
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Sunny
Top achievements
Rank 1
answered on 25 Feb 2009, 01:08 PM
Thanks,

             But I have used the Popup control to show the ReportViewer.
             Also i had assigned the datasourse to reportviewer by using the design report view.
             Please help me with example


Kind Regards,
Jaspreet

0
Accepted
Steve
Telerik team
answered on 25 Feb 2009, 02:11 PM
Hello jaspreet,

What control are you referring to when you say popup control and what does it have to do with the report refresh in the viewer - please elaborate.
The second things that comes to mind is how/when do you change the datasource? The error from your first post "Unspecified error while processing the report request" can only happen if you are changing the datasource from runtime i.e. from the calling application.

Sincerely yours,
Steve
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Sunny
Top achievements
Rank 1
answered on 26 Feb 2009, 09:32 AM
Hello Steve,

       I am passing parameter value for filter of Telerik Reporting on button click.
       So, I want to change the ReportViewer Page Index Set to its default every i
       click the Button..




Thanks,
Jaspreet
0
Steve
Telerik team
answered on 26 Feb 2009, 11:33 AM
Hello jaspreet,

It seems that we have a misunderstanding. My point from previous replies was that you cannot specify an exact page on which the report would be reloaded. You can only force it to refresh by setting the

ReportViewer1.Report = new MyReport()

on each button click, therefore it would always start from page 1. The viewer is refreshed automatically when you are using the built-in parameter area and you click the Preview button, but when you are doing this through external UI, you would need to force it to refresh.

All the best,
Steve
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
General Discussions
Asked by
Sunny
Top achievements
Rank 1
Answers by
Steve
Telerik team
Sunny
Top achievements
Rank 1
Share this question
or