How would I properly format a very long report (one record spans multiple pages, with one section containing a table with multiple records) to work both in Preview and HTML Preview? I got it to work in HTML Preview, but I don't think I'm creating the report correctly. Only the middle portion of the report shows up in Preview Mode and in the PDF when I export it from the report viewer. The report is definitely bigger than the allowed page size. Also, I have one section of the report that I should keep in the detail section, as it is multiple records. It will work fine as far as HTML Preview (it formats correctly in my web application.)
Thanks you.
14 Answers, 1 is accepted
We're not sure we understand your inquiry and our suspicion from the provided information so far is that you probably do not consider the differences between logical (HTML Preview and web report viewer) and page oriented formats (Preview and PDF format).
The output of a report rendered in HTML and PDF differs because both medias are quite different. The 1st (HTML) is dedicated to displaying information on screen and the page is infinite by width and height; in contrast the 2nd format - PDF - supports physical pages and is meant not only for reading on screen but for printing.
According to whether the format supports physical pages, we separate the export formats on two groups: page-oriented (PDF, Image (print preview), print, XPS, RTF) and non-page oriented (HTML/MHTML, Excel, CSV).
For the page-oriented formats the content layout is on horizontal and vertical pages according the the page settings of the report, while for the rest of the formats take into considerations other characteristics of the media like the grid of the Excel worksheet.
For detailed information about specific rendering extension/format please refer to Design Considerations for Report Rendering help section in our documentation.
All the best,
Steve
the Telerik team
Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>
Example:
field 1 field 2 field 3
..
..
..
..
Table 1
record1
record2
record3
..
..
***** MAXIMUM Page size ends here *******
field 99 field 100 field101
field 102 field 103
...
..
..
field 125 field 126 field 127
The Table item being a single item would not be paged/separated in HTML rendering. This information is available in the Design Considerations for HTML Rendering help article i.e.: Due to the fact that HTML is not a page oriented format, all report items placed in a single section are rendered in a single page i.e. KeepTogether property is ignored.
So in this case, there is no way to force the web report viewer to page the report. What you can do is export to PDF directly and show it in the browser instead of using the web report viewer. The following KB contains the information how to do this (Exporting a report to PDF programmatically)
and if you want to skip the part where it ask you to open or save the PDF, simply remove the Response.AddHeader line from the code.
Best wishes,
Steve
the Telerik team
Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>
What I'm referring to is that you cannot get a 1:1 looking report both in HTML rendering (web report viewer) and PDF rendering. Using TextBoxes instead of Table items would allow the report to be logically paged based on the set of records occupying a page. The same is not applicable for the Table item, as it would grow to fit all records, but it remains a single item and thus as explained in previous post - would be rendered as a single page.
Kind regards,
Steve
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
If you have a table object (that is the only way I can get it to align with multiple fields vertically as well as horizontally.), you have to bind EACH and every table object to the datasource, as well as the report itself (if you have fields in the page header, or footer, etc.) so, it becomes very inefficient! What if you have 11 tables like I do? That's 11 duplicate records or datatables. To see what I mean, create a report with a table, and with fields in the page header. Now, at run time, bind the report to the report viewer, and bind the datasource to the report, and there will be NO data in the table. Now, you can see that you have duplicate data in the report, as you have to bind both the report, and each table to the same datatable.
I tried moving all 11 tables into the detail section, and then assign the datasource separately to each table, but that produces a 100+ page report with only 2 or 3 rows on each page!
Do you experience any troubles with blank pages? Generally blank pages are caused by report items that carry over the next page. In order to see which items/sections are causing the problem, simply change their background to a different, more contrasting color and export it to PDF. The rendered report will immediately give you a clue about the items which are at fault.
Generally there are several cases when an empty page may occur:
- The report detail section is a repeater and the detail section will be represented with one instance per every Report.DataSource record. Thus if you have unused detail section our suggestion is to set it's Visibility to False;
- Report Width is greater than the available page space (Page Width - Left Margin - Right Margin);
- There is a report item with boundaries going out to the right from its parent section.
For additional information check out the Problem: Telerik Reporting renders blank pages KB article.
Do you still experience the no data troubles and what do you mean by run-time binding? Do you use events, bindings or you set the data source from your application? If you still experience any issues please elaborate further.
About the Table layout without a Table item, please check out Dynamic Layout (Dock and Anchor) help article that elaborates on the topic.
Peter
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
my report is approximately 3 pages long (in Preview mode, Landscape). My report has almost 100 fields, which are divided into 11 sections for readability. Each section is a table object. There is one section that has multiple records, but all other sections have only one record. I used tables for alignment purposes, as no matter what I tried, I couldn't align textboxes vertically and horizontally, depending on what data was in each field. I also had to bind the same datatable 10 times to each table object in the report (and the 11th table, I bound to the datatable with multiple records), which seems very inefficient. but, it only takes 3 seconds to launch the report so, it doesn't affect performance too much. also, once I converted the entire report to use tables, the pagination worked perfectly. On the HTML Preview, the report was very long (which was expected), but after exporting to PDF, it came out to 3 pages, and formatted correctly.
The true print functionality of the Web Report Viewer and Silverlight Report Viewer depends on the Adobe PDF plug-in. Thus the result should be the same as of the exported to PDF report. Still we do have some suggestions/questions:
- What are the report's page settings?
- What page scaling is applied in the Adobe print dialog prior to printing?
- Do you experience the same behavior when printing the exported PDF report?
Greetings,
Peter
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>