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

How to enable paging

5 Answers 494 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Rickard
Top achievements
Rank 1
Rickard asked on 30 Aug 2012, 12:02 PM
I'm using the web report viewer and for some reason, although the report has multiple pages, the paging controls (next, previous etc) in the report toolbar are disabled. Here's a screenshot to illustrate:

http://i.imgur.com/UeDyw.png 

It should be noted that the data for the report is generated in the aspx codebehind and bound to an ObjectDataSource. Something along the lines of:

var objectDataSource = new Telerik.Reporting.ObjectDataSource();
objectDataSource.DataSource = GetData();
 
var report = new Fuelomat.Reports.ConsumptionPerVehicleGroup();
report.DataSource = objectDataSource;
 
var reportSource = new InstanceReportSource {ReportDocument = report};
 
ReportViewer.ReportSource = reportSource;
ReportViewer.Visible = true;

The reason for this is that the data is combined from a web service and from a SQL database. Additionally, we couldn't use report parameters because the UI has no time picker in addition to the date picker. So we did our own UI in the aspx.

Anyone have any idea why the paging doesn't work?

Cheers,
Rickard

5 Answers, 1 is accepted

Sort by
0
Steve
Telerik team
answered on 03 Sep 2012, 02:25 PM
Hi Rickard,

"So we did our own UI in the aspx." - is the toolbar from the screenshot your own UI made to mimic our toolbar or is this the built-in toolbar? If the latter, please provide us with a project that exhibits this behavior as we have not been able to reproduce it in our local tests.

Additionally, if you only want to create UI for the report parameters, you do not need to replace the whole toolbar. You just need to set each report parameter to Visible=false, and then use your UI to pass values to the report parameters.

Regards,
Steve
the Telerik team

BLOGGERS WANTED! Write a review about Telerik Reporting or the new Report Designer, post it on your blog and get a complimentary license for Telerik Reporting. We’ll even promote your blog and help bring you a few fresh readers. Yes, it’s that simple. And it’s free. Get started today >

0
Rickard
Top achievements
Rank 1
answered on 05 Sep 2012, 01:28 PM
The toolbar in the screenshot is the built-in toolbar. I haven't made any modifications to that.

I created a tiny project that illustrates the issue. The project doesn't have any kind of custom UI. It's just an aspx page that generates a DataTable of data and provides the report with the data. Here's the result:

http://i.imgur.com/EGIAa.png

I've uploaded the source here:

http://rickardandersson.com/drop/PagingIssue.zip

PS. In the previous code snippet I posted, I was using a trial of Q2 2012, but have since reverted to Q3 2011 (for which we have a license). Both versions exhibit the same issue.
0
Rickard
Top achievements
Rank 1
answered on 10 Sep 2012, 01:18 PM
Hi Steve,

Did you by any change have time to look at this?

Cheers,
Rickard
0
Accepted
Peter
Telerik team
answered on 11 Sep 2012, 02:46 PM
Hello Rickard,

The unexpected behavior is caused by the ClientIDMode="Static" attribute. The ClientIDMode changes the IDs of the controls and the JavaScript is unable to find the elements it needs.

Our suggestion is to avoid ClientIDMode because the web report viewer uses JavaScript for a lot of its features including the page navigation buttons.

Kind regards,
Peter
the Telerik team

BLOGGERS WANTED! Write a review about Telerik Reporting or the new Report Designer, post it on your blog and get a complimentary license for Telerik Reporting. We’ll even promote your blog and help bring you a few fresh readers. Yes, it’s that simple. And it’s free. Get started today >

0
Rickard
Top achievements
Rank 1
answered on 12 Sep 2012, 08:15 AM
Aha! Thanks for looking into it. I removed ClientIDMode="Static" and now paging works.

Incidentally, I was using ClientIDMode="Static" to have a static ID to refer to from CSS and Javascript but I can just as well do that by setting a custom CssClass on the ReportViewer. The reason I need to refer to the ReportViewer from CSS and Javascript is to fix some appearance problems that occur when you use the viewer with Twitter Bootstrap.

Cheers,
Rickard
Tags
General Discussions
Asked by
Rickard
Top achievements
Rank 1
Answers by
Steve
Telerik team
Rickard
Top achievements
Rank 1
Peter
Telerik team
Share this question
or