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

Viewer shows only Report Header on first page

6 Answers 340 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
James Strope
Top achievements
Rank 1
James Strope asked on 09 Mar 2010, 09:36 PM
Hello all,

I have an issue perhaps you guys can solve, if I can explain it well enough.  I am using Telerik Reporting 2009_3_1211 for the web.  I have one report with subreports.  When generated to PDF, everything looks fine.  But in the viewer, there is an extra page at the front (page 1) that only shows the "outer" report's PageHeader.  If you navigate to page 2, you see the rest of the report.  Again, this doesn't happen when generated to PDF.  This is the general layout.

"outer" report:
    pageHeader
(an extra page is shown at the beginning with only this item)
    reportHeader (empty)
        detail - contains subreports
    pageFooter

subreport:
    
pageHeader (empty)
    reportHeader
    GroupHeader
        GroupHeader
            detail
        GroupFooter
    GroupFooter

Some notes:
- If I move the subreports to the reportHeader section, the extra page shows up at the end instead of the beginning (this one will also show in the PDF).
- I have messed with the KeepTogether flags in all sorts of combinations (in fact, the PDF was showing the extra Page 1 until I set the subReport's reportHeader's KeepTogether to false).
- No matter how big the report is, the viewer always shows only 2 pages.  Page 1 is the outer report's ReportHeader, and page 2 is everything else.
- In the html, I have the ReportViewer's Height set to 100%.
- I've checked for the following things that Steve @ Telerik mentioned in another recent post:
       - Report Width is greater than than the available page space (Page Width - Left Margin - Right Margin). 
       - There is a sub-report, which contains a report that is too wide, and while at design-time that is not obvious, at run-time it might cause the carry over to occur. 
       - There is a report item with boundaries going out to the right from its parent section.

With all that said... Any ideas?

6 Answers, 1 is accepted

Sort by
0
Steve
Telerik team
answered on 12 Mar 2010, 04:50 PM
Hi James Strope,

HTML rendering extension is used when the report is shown in the web report viewer, which has no concept of physical page and sections are kept together. On the other hand, PDF format is page oriented format and if there is not enough space to fit all subreport data, it is moved to next page (if it fits there).
HTML format does not respect KeepTogether, but if you alter your report design a bit, you should be able to avoid that. For example instead of using Report Header, you can create an unbound group (i.e. no grouping criteria) and move the report header data there.
Then from the Telerik menu in VS, choose Group Explorer and set the GroupKeepTogether property of the group you created to First Detail or All.
Different formats' peculiarities and limitations are described in Design Considerations for Report Rendering help section.

Greetings,
Steve
the Telerik team

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 Public Issue Tracking system and vote to affect the priority of the items.
0
James Strope
Top achievements
Rank 1
answered on 16 Mar 2010, 01:44 PM
Hi Steve and thanks for your reply.  Everything you say about the viewer makes sense.  I also figured out why I have that extra page at the end.  In my subreport, I had set the GroupFooter's PageBreak to After (so that each subsequent subreport would start on the next page).  But of course that includes the last subreport, resulting in an extra page. 

So my thought is to programmatically set this property on all subreports except the last (subreports are set Visible or Invisible at runtime based on the data, and thus I won't know which one is "last" until then).  But I can't figure out how to get to that GroupFooter in code.  In the report itself, I can simply refer to it by name, e.g. 
xxxGroupFooter.PageBreak = PageBreak.After; 

...but how do I do it from the container report?  I would like to do something like
subReport1.xxxGroupFooter.PageBreak = PageBreak.After; 

Is that possible?
0
Steve
Telerik team
answered on 19 Mar 2010, 10:06 AM
Hi James,

Actually such scenarios are handled internally by our rendering engine and if you have PageBreak=After applied on a section that would not generate empty last page. I've tried to reproduce this on my end but without success - please check the attached reports. I'm using Conditional Formatting to hide the subreport by default and show it only if certain value - in this case the last value so that we can test whether an empty page would be generated. But as you can see it does not, so we would appreciate if you provide more information about your scenario.

Best wishes,
Steve
the Telerik team

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 Public Issue Tracking system and vote to affect the priority of the items.
0
James Strope
Top achievements
Rank 1
answered on 19 Mar 2010, 01:46 PM
Hi Steve,

I can't reproduce this in a different project either.  It is definitely true in my main project, but I can't tell you why.  I thought it might be because I have my subreports in the group report's reportHeader instead of the detail (because of the issue in my original post), but I tried that same scenario in my tester project and it worked fine (no extra page in the PDF).

How about the programmatic option?  Is that still possible?
0
Steve
Telerik team
answered on 22 Mar 2010, 03:21 PM
Hi James,

The data processing and the paging are two separate processes. Furthermore, each rendering extension has a different paging mechanism which complicates the task even more, so setting this property conditionally with code is not a good idea.
The proper way is using Conditional formatting, and if you are having problem with a specific report only, you could review what differs in it compared to your other test reports that work. If you are unable to identify the issue, please provide us with the report (should be runnable) and we would be able to advise you once we review it.

All the best,
Steve
the Telerik team

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 Public Issue Tracking system and vote to affect the priority of the items.
0
James Strope
Top achievements
Rank 1
answered on 22 Mar 2010, 03:52 PM
Hi Steve,

Unfortunately, I can't provide you with a runnable report for a couple of reasons.
- you would need the datasource from which it pulls.
- There is a lot of extra server-side code that runs to hide/show data, reposition data, etc.

It looks like I'll just need to keep plugging at it.  Now that I know it's not normal behavior, I should be able to figure it out.
Tags
General Discussions
Asked by
James Strope
Top achievements
Rank 1
Answers by
Steve
Telerik team
James Strope
Top achievements
Rank 1
Share this question
or