Output to PDF, specific Worksheet

3 posts, 1 answers
  1. Joel Palmer
    Joel Palmer avatar
    164 posts
    Member since:
    May 2009

    Posted 17 Mar 2015 Link to this post

    Is there a way to output one specific worksheet to a PDF document?  Or, must I always rely on spreadsheet formatting?
  2. Answer
    Tanya
    Admin
    Tanya avatar
    404 posts

    Posted 18 Mar 2015 Link to this post

    Hello Joel,

    By default, the PdfFormatProvider exports the active worksheet only. If your goal is to export a specific worksheet you could set the Workbook's ActiveWorksheet property to point to it:
    workbook.ActiveWorksheet = workbook.Worksheets[1];

    If you would like to control what is exported in what page in the pdf, you can use the PdfExportSettings class, as is shown in the sample code in Example 2 in the Pdf Settings article. Each of the ranges specified in the code will be printed on a separate page.
     
    Hope this helps.

    Regards,
    Tanya
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  3. Joel Palmer
    Joel Palmer avatar
    164 posts
    Member since:
    May 2009

    Posted 18 Mar 2015 Link to this post

    Awesome.  I figured there had to be a way to do it.  I'll give it a try.

    Thanks for your help,
    Joel
Back to Top