Print to PDF

4 posts, 1 answers
  1. Alex Dybenko
    Alex Dybenko avatar
    161 posts
    Member since:
    Jan 2005

    Posted 21 Feb 2018 Link to this post

    Hi,

    I know about export to PDF, but is it possible to print PivotGrid directly to PDF file, with headers/footers/watermarks, etc?

    Thanks,

    Alex

     

  2. Answer
    Hristo
    Admin
    Hristo avatar
    1522 posts

    Posted 21 Feb 2018 Link to this post

    Hello Alex,

    As long as you have a PDF print driver you can print to PDF just like with any other printer. On Windows 10, you can achieve it this way: 
    PivotGridPrintStyle style = new PivotGridPrintStyle()
    {
        LayoutType = PivotLayout.Compact
    };
     
    this.radPivotGrid1.PrintStyle = style;
     
    PrinterSettings printerSettings = new PrinterSettings()
    {
        PrinterName = "Microsoft Print to PDF",
        PrintToFile = true,
        PrintFileName = @"test.pdf"
    };
     
    RadPrintDocument doc = new RadPrintDocument()
    {
        PrinterSettings = printerSettings,
        AssociatedObject = this.radPivotGrid1
    };
     
    doc.Print();

    For other operating systems you may need to install additional drivers. Let me know if you have other questions.


    Regards,
    Hristo
    Progress Telerik
    Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
  3. Alex Dybenko
    Alex Dybenko avatar
    161 posts
    Member since:
    Jan 2005

    Posted 22 Feb 2018 in reply to Hristo Link to this post

    Hi Hristo,

    I just thought that I can pass RadPrintDocument to something like Telerik.Windows.Documents.someobject for export :)

    Thanks,

    Alex

     

     

  4. Hristo
    Admin
    Hristo avatar
    1522 posts

    Posted 22 Feb 2018 Link to this post

    Hi Alex,

    We do not have a library to handle globally the printing of the different controls. Printing is handled individually according to the specifics of the control. The control needs to implement the IPrintable interface. The RadPrintDocument extends the standard PrintDocument class and adds API related to the controls in the suite.

    Let me know if you have other questions.

    Regards,
    Hristo
    Progress Telerik
    Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Back to Top