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

Export to RadDocument (TableHader over multiple pages?)

4 Answers 215 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Felix
Top achievements
Rank 1
Felix asked on 02 Jul 2012, 09:00 AM
Hi,
I export the RadGridView via the Democode to a RadDocument.
The table in the RadDocument is could be quiet big. 
I want on every page the the TableHeader printed again.
Also i want some basic header and footer (I already could add pagenumber / logo ..)

But i have no chance to make the repeatable TableHeader, and if there are too many columns that it continues on the next page. 

Is this even possible with RadDocument or do I have to use Reporting for this?

kind regards
felix

4 Answers, 1 is accepted

Sort by
0
Dimitrina
Telerik team
answered on 02 Jul 2012, 10:39 AM
Hello,

In order to add a print header to every page - you can create a header section and assign it to the HeaderFooterUIContext of the editor. Something like so:

Section firstSection = this.editor.Document.Sections.First;
Header header = newHeader();
header.Body = CreateRadDocumentForHeader(); //RadDocument to show in the header
this.editor.HeaderFooterUIContext.UpdateHeader(firstSection, HeaderFooterType.Default, header);

Please check this help article on creating a document table in code behind.  This feature still needs improvement until it is fully implemented, but you may review how it fits to your case.

For more complex scenarios I would recommend you to use Telerik Reporting.

All the best,
Didie
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
Felix
Top achievements
Rank 1
answered on 02 Jul 2012, 11:50 AM
Table header works..

but real problem is with big tables.. (lot of columns)

With the less columns example the table is stretched and looks nice.
less columns

But with a lot of columns it gets very ugly.. is there a method to put the overflow in a separate page?
a lot of columns

I figured out reporting is not very good, because we work with variable number of columns. In the reporting we have to type the values hard for every column, so not really our case....

I hope my problem is now more understandable :-)

kind regards
felix
0
Felix
Top achievements
Rank 1
answered on 03 Jul 2012, 11:57 AM
Not possible with RadDocument?
0
Iva Toteva
Telerik team
answered on 04 Jul 2012, 01:53 PM
Hello Felix,

In RadDocument, it is possible to increase the size of the page in order to make it wide enough to show all columns correctly. This can be done by setting the PageSize property of the Section you have created in code-behind to a new Size(width, height).

The documents will be exported to PDF using the size specified in the section. As for printing, RadRichTextBox and RadDocument do not have an implementation of horizontal overflow.

Greetings,
Iva Toteva
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Tags
GridView
Asked by
Felix
Top achievements
Rank 1
Answers by
Dimitrina
Telerik team
Felix
Top achievements
Rank 1
Iva Toteva
Telerik team
Share this question
or