2 Replies Latest reply on Jan 20, 2020 2:45 AM by Shweta Phillips

    Missing Sheet Headers When Converting View to PDF

    guy.felestian

      Hi,

       

      - I am using TSC library (tableauserverclient) - wrapper for Tableau REST API.

       

      - My code converts a specific view (A sheet to be precise)  to a PDF file ("populate_pdf.pdf") using populate_pdf

       

       

      import tableauserverclient as TSC
      tableau_auth = TSC.TableauAuth('%User%', '%Password%')
      server = TSC.Server('http://%TableauServer%', use_server_version=True) 
      with server.auth.sign_in(tableau_auth):
           pdf_req_option = TSC.PDFRequestOptions(page_type=TSC.PDFRequestOptions.PageType.A4, orientation=TSC.PDFRequestOptions.Orientation.Landscape)
      
           for view in TSC.Pager(server.views):
                if view.id == '17aca419-e5a8-49ea-b5d3-6c34806b70aa':
                       server.views.populate_pdf(view, pdf_req_option)
                       with open('./populate_pdf.pdf', 'wb') as f:
                          f.write(view.pdf)
                          f.close()
      
                if view.id == '17aca419-e5a8-49ea-b5d3-6c34806b70aa':
                     server.views.populate_image(view)
                     with open('./populate_image.image', 'wb') as f:      
                          f.write(view.image)
                          f.close()
           
      

               

       

      - The problem is that PDF output does not include the sheet headers.

       

      - By the way - when I use populate_image - headers do appear in the image file ("populate_image.image")!

       

      - Both files attached (PDF & Image)

       

      Any ideas of the why headers are missing when converting to PDF?

       

      Thanks!