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

Export Grid with many columns to pdf

15 Answers 700 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Luca
Top achievements
Rank 1
Luca asked on 02 Mar 2011, 06:08 PM
Hi,

I'm trying to export a huge grid (20/25 columns more or less) to pdf, too large to fit within page width, so i was wondering if maybe i could split grid columns over two or more pages as needed. Up to now I have been using rad document and table object to accomplish the task, and then format provider class to export to pdf. I thought it would have been the best option and maybe it is in normal cases when the grid doesn't have too many columns. Unfortunately this approach doesn't work out when a great number of columns need to be exported to A4 paper. So my idea was to split columns over more then one page, but i could not find any way to do so.
Any suggestions? is it also possible to render pdf over more then one page horizontally, always by using table class and RadDocument?
if not, which other options are available?

Thanks

Luca 

15 Answers, 1 is accepted

Sort by
0
Ivailo Karamanolev
Telerik team
answered on 04 Mar 2011, 01:26 PM
Hello Luca,

Unfortunately, the PDF format provider does pagination using the RadDocument algorithm, which, just as MS Word, only supports vertical splitting. All you can do currently is change the page size, or if you really need A4, you can try using landscape. You can accomplish this by either setting the document section's orientation to landscape or simply settings the page size to 297x210mm instead of 210x297mm.
Let us know if you have any other questions.

All the best,
Ivailo
the Telerik team
Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
0
Matt
Top achievements
Rank 2
answered on 03 May 2012, 09:55 PM
This seems to be a fairly significant limitation on the PDF implementation. When will this issue be resolved?
0
Ivailo Karamanolev
Telerik team
answered on 08 May 2012, 08:55 AM
Hello,

This behavior is by design, as this format provider is used for exporting RadDocuments exclusively. RadDocument is a flow document format, so it cannot support both horizontal and vertical pagination of content. Unfortunately, this limitation cannot be overcome with the current solution stack.
Several other options that will make this easy-to-trivial to accomplish are being developed as we speak, but they will appear in the beginning of 2013 at the earliest, so I'm not at liberty to discuss them.
We're sorry we couldn't be of help. Let us know if we can assist you in any other way.

Regards,
Ivailo Karamanolev
the Telerik team

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

0
Matt
Top achievements
Rank 2
answered on 08 May 2012, 02:16 PM
Thanks for your reply. That's good to hear, I suppose, but without reliable printing performance in Silverlight and without a usable PDF export, I'm strongly suspecting that HTML 5 may be a much better alternative than Silverlight even with Telerik components.
0
F Beto
Top achievements
Rank 1
answered on 12 Jul 2013, 07:56 PM
Hello Ivailo,

I have a problem with PDF export. My problem is that I have a lot of columns, I mean the amount of RadGridView columns is created dinamically, for example I have the following data:

Column1   Column2   Column3   Column4   Column5   Column6   Column7 ................ ColumnN
data10       data20        data30       data40       data50       data60        data70    ................. dataN0
data11       data21        data31       data41       data51       data61        data71    ................. dataN1
data12       data22        data32       data42       data52       data62        data72    ................. dataN2
data13       data23        data33       data43       data53       data63        data73    ................. dataN3

At this point all the data are being set to the page. It's exporting something like this.

C  C  C ...............................
o   o  o
l    l    l
u  u   u
m m  m
n  n   n
1  2   3


All the data is being exporting in that way. So, I'd like to have this format.

Column1   Column2   Column3    
data10       data20        data30              
data11       data21        data31                            Page1
data12       data22        data32              
data13       data23        data33             

Column4   Column5   Column6
data40       data50       data60
data41       data51       data61                             Page2
data42       data52       data62
data43       data53       data63

Column7 ................ ColumnN
data70    ................. dataN0
data71    ................. dataN1                                 Page3
data72    ................. dataN2
data73    ................. dataN3

Is there any way that can do this operation automatically? do you have any suggestion or examples about this using DadDocument, and PdfFormatProvider?
I tried to fix it modifying the page size but you know that's is not a good fix.

Please! I need your help!!

Note: I attached the report that was exported with my app.

Thanks in advance!!
0
Petya
Telerik team
answered on 17 Jul 2013, 11:02 AM
Hello,

Other than the solution you found yourself, you can try to modify the logic of the export to "break" the table into several smaller tables. My suggestion is to try measuring the columns of your RadGridView and basically create separate tables from small sets of columns (as demonstrated in your example below). What you should be aware in this regard is that RadDocument's model does not allow consecutive tables, so you should make sure to add at least one empty paragraph between them.

I hope this is helpful! Let us know if you face any issues.
 
Regards,
Petya
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for SILVERLIGHT.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
0
F Beto
Top achievements
Rank 1
answered on 17 Jul 2013, 04:46 PM
Thank you for your replay!!!

As you mentioned, my first approach in order to fix this issue was Set large PageSize as you can see in the attached document. So, now I am trying the second approach that is as you mentioned. I'm modifying the logic of the export.

Thank you for your suggestion!!
0
César
Top achievements
Rank 1
answered on 24 Oct 2013, 09:17 AM
Hi telerik team

Please tell me if now there is a native solution to solve this problem.
I need to have both vertical and horizontal pagination exporting to PDF.

Best regards,
César Faria
0
Petya
Telerik team
answered on 29 Oct 2013, 09:25 AM
Hello César,

Horizontal pagination of RadDocument is not possible and it is not in our plans. The two solutions discussed in this thread are your only options at this time.

We are currently considering exposing printing functionality for the RadSpreadsheet control which will allow splitting the document horizontally. Worksheets are not flow documents, so they can be paginated both vertically and horizontally. We will do our best to implement the functionality for the Q1 2014 release and exporting to PDF in the same manner should be available soon after that.

Let us know if you have other questions.

Regards,
Petya
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for SILVERLIGHT.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
0
chandru
Top achievements
Rank 1
answered on 17 Jun 2014, 05:20 PM
Hi Telerik Team,

I am facing similar problem that F Beto has mentioned in this thread.
Please let me know if there is a way to have both vertical and horizontal pagination for exporting data from a Radgrid to PDF.
I am using the controls of Q1 2014 release.

Thanks
Chandru

0
chandru
Top achievements
Rank 1
answered on 18 Jun 2014, 10:49 AM
Hi Telerik Team,

I am facing similar problem that F Beto has mentioned in this thread.
Please let me know if there is a way to have both vertical and horizontal pagination for exporting data from a Radgrid to PDF.
I am using the controls of Q1 2014 release.

Thanks
Chandru
0
Svetoslav
Telerik team
answered on 20 Jun 2014, 04:12 PM
Hello Chandru,

Thank you for contacting us.

With our release form  Q2 2014 we have released a new component RadSpreadProcessing which allows you to create, load and modify  documents to Xlsx, Csv, Tab-delimited file formats as well as export them to Pdf format without using 3rd party libraries. You can learn more about it following this link: RadSpreadProcessing documentation article.

You may additionally see how to integrate RadGridView with RadSpreadProcessing and export it to Pdf in our online demo for Telerik UI for Silverlight..

You can learn more about customizing how the content is split into pages both vertically and horizontally on this link for WorksheetPageSetup.

I hope this helps. Don't hesitate to contact us again.

Regards,
Svetoslav
Telerik
 
Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
 
0
chandru
Top achievements
Rank 1
answered on 20 Jun 2014, 06:15 PM
Hi Svetoslav,

Thanks for your reply.

I am using Q1 2014 release of Telerik UI for Asp.net AJAX. Please let me know if we have the same functionality that is used in Silverlight. It would be also helpful if I get to see a demo.

Also, let me know when can i get the Q2 2014 on the latest internal builds ?

Thanks and Regards,
Chandru
0
Kostadin
Telerik team
answered on 25 Jun 2014, 07:00 AM
Hi Chandru,

Telerik UI for Asp.net AJAX provides a built-in export to PDF when using a RadGrid and RadTreeList. You could check out the following live example which demonstrates how to use the exporting feature.
Grid - Export to PDF
TreeList - Export Basics
Additionally more information is available under Related Resources tabs of the demos.

Regards,
Kostadin
Telerik
 
Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
 
0
Khiem
Top achievements
Rank 1
answered on 21 May 2019, 03:42 AM

Hi F Beto.

I have a solution for this case.
First, I had split a grid have many column to a list gird 

Second, I use recursion to export this grid to pdf 

I used hideColumn and showColumn to make column in grid before call function _drawPDF

Tags
GridView
Asked by
Luca
Top achievements
Rank 1
Answers by
Ivailo Karamanolev
Telerik team
Matt
Top achievements
Rank 2
F Beto
Top achievements
Rank 1
Petya
Telerik team
César
Top achievements
Rank 1
chandru
Top achievements
Rank 1
Svetoslav
Telerik team
Kostadin
Telerik team
Khiem
Top achievements
Rank 1
Share this question
or