1 2 3 Previous Next 41 Replies Latest reply on Aug 11, 2015 11:31 PM by Steve Martin

    tabcmd print pdf automation problem

    Steve Martin

      Hi All,

       

      I have an odd one with tabcmd misbehaving. The following is saved as a Windows batch file:

       

      @ECHO OFF
      
      cd C:\tabcmd\Command Line Utility
      
      tabcmd logout
      
      tabcmd login -s http://tableau:01 -u Micky -p Mouse
      
      tabcmd export "SuperstoreSales_test/Dashboard1?:embed=yes&:linktarget=_blank&toolbar=yes&tabs=yes&CustSeg=Consumer&Product=Furniture" --fullpdf --pagelayout landscape -f "C:\Superstore_Test.pdf" --timeout 600
      

       

      Open the the file and it executes perfectly apart from the minor inconvenience that the pdf returns blank.

       

      If however, I extract each line of code and execute them at their own command prompt as a separate command, the pdf returns fully populated.

       

      I should add the data for this is running against a db but during the test I have a copy of the workbook open which is correctly rendering to demonstrate that there is no issue with networking etc.

       

      Any ideas?

       

      Steve

        • 1. Re: tabcmd print pdf automation problem
          Jeff Strauss

          why do you have all the extra parameters (i.e. embed, target, toolbar...)?  have you tried it without just as a control test to see what occurs?  Also, what version of Tableau are you running.

          • 2. Re: tabcmd print pdf automation problem
            Steve Martin

            Extra parameters are whipped straight from the url however, the have no bearing on this as executing the the export manually at its own command prompt yields the expected output.

             

            Also, running Tableau desktop & server 8.3.3

            • 3. Re: tabcmd print pdf automation problem
              Steve Martin

              Looks as though the batch file needs some form of timeout / sleep command as I suspect tabcmd to maybe overrunning a buffer somewhere due to the rapid nature.

               

              attempts with

              timeout /t 3
              

               

              failed as tabcmd was unable to recognise the command.

               

              As I need to provide multiple cuts based on different parameter values, the route I may need to go is to create two separate batch commands in my SSIS package, the first to login with quite a hefty timeout, the second to actually execute the commands.

               

              Does anyone else have any other suggestions than my work-around?

              • 4. Re: tabcmd print pdf automation problem
                Jeff Strauss

                as a workaround you can try and add a "WAITFOR /T 60 dummy" into your command script.  This pauses the script for either 60 seconds or until a signal of "dummy" is received (whichever comes first).  Try it out, let me know if it helps.

                • 5. Re: tabcmd print pdf automation problem
                  Steve Martin

                  Thanks for your efforts but unfortunately just like 'timeout', 'waitfor' is not an included command within tabcmd so it too is not recognised thus ignored.

                   

                  At this rate, this is probably another of those things that Tableau need to add into the syntax

                  • 6. Re: tabcmd print pdf automation problem
                    Jeff Strauss

                    waitfor is a built-in windows command.  You can try inserting it between "tabcmd login" and "tabcmd export".

                     

                    Waitfor - delay in seconds | Windows CMD | SS64.com

                     

                     

                     

                    Does the export take a while?  You should be able to add a --timeout value to the end.


                    --timeout seconds Waits the specified number of seconds

                    for the server to complete processing the

                    command. By default the process will

                    timeout in 30 seconds.

                    • 7. Re: tabcmd print pdf automation problem
                      Steve Martin

                      I know it is a built in windows command as is timeout but neither are tabcmd functions so they are not recognised.

                      Do not forget, we are working with tabcmd here so only tabcmd functions appear to be available.

                      • 8. Re: tabcmd print pdf automation problem
                        Jeff Strauss

                        I don't understand because --timeout is a built-in tag within tabcmd.

                         

                         

                        And if you are running a windows script, then waitfor should be available too.

                        • 9. Re: tabcmd print pdf automation problem
                          Steve Martin

                          You are confusing --timeout which is a built-in function that can only be used in conjunction with a tabcmd command, it cannot be used to pause script execution, with the windows command timeout /t 10 which would normally pause script execution, in this example for ten seconds, also is not working as neither this nor waitfor are recognised tabcmd functions

                           

                          I need a function that will pause the script execution enough for the buffer to release.

                           

                          And no, this is not a windows script as it was originally going to be a SQL server SYS.XP_cmdshell automation but will now instead be an ssis batch execution instead

                          • 10. Re: tabcmd print pdf automation problem
                            Steve Martin

                            Having spent days of extensive testing, it appears that the issue lies not on needing to pause the script execution but rather the way the export function works.We do have another workbook though this runs exclusively from an extract which works fine, also, connecting to Superstore Sales but not creating an extract also works, I can run-off any number of reports with numerous amounts of parameters.

                             

                            This report connects live to a 2.2Bn record set, which takes around 30 seconds to get the data to the workbook before printing can occur; why this process works when ran manually but not when executed by batch, I am unsure; maybe the tabcmd product is not yet mature enough to be automated in such a manner when connecting to such a large set.

                             

                            But until proper time-outs are built into the product to pause printing until the workbook is properly rendered, this side of the tool seems incompatible with large-scale roll-outs.

                            • 11. Re: tabcmd print pdf automation problem
                              Toby Erkson

                              Steve Martin wrote:

                               

                              You are confusing --timeout which is a built-in function that can only be used in conjunction with a tabcmd command, it cannot be used to pause script execution, with the windows command timeout /t 10 which would normally pause script execution, in this example for ten seconds, also is not working as neither this nor waitfor are recognised tabcmd functions

                              I understand what Jeff is saying so let me try to say what he is but in another way:

                              
                              @ECHO OFF
                              cd C:\tabcmd\Command Line Utility
                              tabcmd logout
                              tabcmd login -s http://tableau:01 -u Micky -p Mouse
                              REM Pause for ten seconds
                                   timeout /t 10 /nobreak
                              REM Okay, let's continue on now
                              tabcmd export "SuperstoreSales_test/Dashboard1?:embed=yes&:linktarget=_blank&toolbar=yes&tabs=yes&CustSeg=Consumer&Product=Furniture" --fullpdf --pagelayout landscape -f "C:\Superstore_Test.pdf" --timeout 600
                              
                              
                              

                               

                              I used the "timeout" function in one of my DOS batch scripts and it works.  Just because you are executing tabcmd (or even tabadmin) commands does not mean you cannot use other DOS commands -- notice that you used @ECHO OFF which is not a tabcmd

                               

                              Also, you need to enclose the path in line 2 with quotes because the spaces act as command separators otherwise.

                              • 12. Re: tabcmd print pdf automation problem
                                Toby Erkson

                                Have you contacted Tableau Support for an answer?

                                • 13. Re: tabcmd print pdf automation problem
                                  Cristian Vasile

                                  "This report connects live to a 2.2Bn record set,"

                                   

                                  FYI

                                  Addressing Timeouts when Publishing or Viewing | Tableau Software

                                   

                                  Also try to increase the timeout setting from 600 (secs) to 7200 (secs or 2 hours), and see if is working

                                  aka replace --timeout 600 with --timeout 7200


                                  Regards,

                                  Cristian

                                  • 14. Re: tabcmd print pdf automation problem
                                    Cristian Vasile

                                    Steve,

                                     

                                    One more thing, try to export the image as .png not .pdf and see how well are you able to deal with.

                                    Regards,

                                    Cristian.

                                     

                                    tabcmd export "[workbook]/[view]" --png -f "folder\file.png" --timeout 7200


                                    OR add undocumented size parameter

                                    specifying image size for tabcmd export PNG?

                                    1 2 3 Previous Next