RadDocument, PdfFormatProvider compressed columns

8 posts, 0 answers
  1. Mark
    Mark avatar
    13 posts
    Member since:
    Aug 2012

    Posted 31 Aug 2012 Link to this post

    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);


  2. Dimitrina
    Admin
    Dimitrina avatar
    3769 posts

    Posted 03 Sep 2012 Link to this post

    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.

  3. DevCraft banner
  4. Mark
    Mark avatar
    13 posts
    Member since:
    Aug 2012

    Posted 04 Sep 2012 Link to this post

    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
  5. Dimitrina
    Admin
    Dimitrina avatar
    3769 posts

    Posted 06 Sep 2012 Link to this post

    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.

  6. F Beto
    F Beto avatar
    11 posts
    Member since:
    Nov 2012

    Posted 12 Jul 2013 Link to this post

    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!!
  7. Petya
    Admin
    Petya avatar
    975 posts

    Posted 17 Jul 2013 Link to this post

    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 >>
  8. F Beto
    F Beto avatar
    11 posts
    Member since:
    Nov 2012

    Posted 17 Jul 2013 Link to this post

    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!!
  9. Sekh
    Sekh avatar
    6 posts
    Member since:
    Oct 2013

    Posted 09 Nov 2013 Link to this post

    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
Back to Top
DevCraft banner