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

RadDocument, PdfFormatProvider compressed columns

7 Answers 170 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Mark
Top achievements
Rank 1
Mark asked on 31 Aug 2012, 10:48 PM
I'm creating a PDF document from a RadGridView using a RadDocument with the PdfFormatProvider. It's working fine but the resultant PDF has all the grid columns compressed tightly so they all fit on one page. Is there a setting I'm missing?

            RadDocument document       = CreateDocument(BondGrid);

            document.LayoutMode        = DocumentLayoutMode.Paged;

            document.Measure(RadDocument.MAX_DOCUMENT_SIZE);
            document.Arrange(new RectangleF(PointF.Empty, document.DesiredSize));

            PdfFormatProvider provider = new PdfFormatProvider();

            MemoryStream output        = new MemoryStream();

            provider.Export(document, output);


7 Answers, 1 is accepted

Sort by
0
Dimitrina
Telerik team
answered on 03 Sep 2012, 08:27 AM
Hi,

 Generally you can print in Portrait and Landscape mode. May I ask you to clarify how exactly you would like to have your document printed?

All the best,
Didie
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Mark
Top achievements
Rank 1
answered on 04 Sep 2012, 04:30 PM
If we could compress it so it all fits, that might be one approach. But when we export to Excel and then convert to PDF from Excel it pages the columns so 2 pages of grid data might end up in 6 PDF pages with columns spanning 3
0
Dimitrina
Telerik team
answered on 06 Sep 2012, 01:29 PM
Hi,

I am not sure that I understand the statement "then convert to PDF from Excel it pages the columns". If you are referring to horizontal paging, RadDocument does not have an implementation of this type of paging. 

Regards,
Didie
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
F Beto
Top achievements
Rank 1
answered on 12 Jul 2013, 07:44 PM
Hello Didie,

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?
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:01 AM
Hello,

As Didie previously said, horizontal paging is currently not supported and we have no immediate plans for its implementation.

Regarding the issue you are facing, there are two possible solutions:
  1. Set large PageSIze to the document, so that the generated table has more space.
  2. 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:47 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
Sekh
Top achievements
Rank 1
answered on 09 Nov 2013, 03:05 PM
Hi Beto,
I have the exactly same problem that you have at the time of printing  .You said   you are going to try with Petya's second approach.
Could you please help me your implemented code.I will be very much thankful to you.Please please help me....It is very very urgent...



Regards,
Sekh
Tags
GridView
Asked by
Mark
Top achievements
Rank 1
Answers by
Dimitrina
Telerik team
Mark
Top achievements
Rank 1
F Beto
Top achievements
Rank 1
Petya
Telerik team
Sekh
Top achievements
Rank 1
Share this question
or