3 Replies Latest reply on Jan 7, 2012 3:18 PM by Sorbsbuster

    Automate multiple XLS + PDF export

    nfer81

      Title

      Automate multiple XLS + PDF export

      Post

      Dear all,

      i need to export multiple XLS and PDF of selected records, sorted by an ID.

      The current scenario is as follow:

      Fields of DB: Author, Title, Country of Sale, Channel of Sale, Quantity, Client ID.

      When i want to get the data of Client ID #23, i simply look for that ID and export the data founded.

      But when i need to export ALL the existing client IDs (in both XLS and PDF format) the problem is that the Client IDs are more than 1.000: i need to export Client ID #1, #2, #3, manually performing a search and this takes ridicolous amount of time. I tried to script but i can't found a way to automate the search of ID#1, ID#2 etc...separately and without pauses.

      Thus i need to create a script where all the IDs are found and exported separately one by one, in XLS and PDF in an automated way.

      Thanks in advance for any help and assistance!

        • 1. Re: Automate multiple XLS + PDF export
          Sorbsbuster

          Do you mean you want each Excel file to contain only one ClientID?  If that's the case then you can simply find all the possible records you would be interested in, and create a loop which exports to pdf each record, one at a time.  You can use the 'Print (or Save) Current Record' option to do that.

          • 2. Re: Automate multiple XLS + PDF export
            nfer81

            Dear Sorbsbuster, thank you for your prompt reply.

            In my Database i have multiple records containing the same Client ID. (Example: 12 records of ID#1, 14 records of ID#2, etc.) 

            What i need is to perform an automated search (example: "search for ID 1 thru ID 1100") and export each group of record founded in XLS and PDF.

            Due to the large amount of Client ID i will need to script the "find" and "export" tasks.

            How do you create a loop script in order to export to PDF each ID, one at a time?

            Thanks once again for your time!

             

            • 3. Re: Automate multiple XLS + PDF export
              Sorbsbuster

              If the ClientIDs are truly sequential you can show a custom dialogue to ask the user the 'from... to...' ClientIDs they want to search for.  Trap those as $Variables: $ClientIDFrom and $ClientIDTo.  Set the variable $ClientID to be the first of those variables.  Create a loop that enters find mode, sets the ClientID to be the $ClientIDFrom, performs the find, prints the pdf, saves the Excel file, and updates the $ClientID to be the next one up.

              Run round the loop again, and exit when the $ClientID hits the upper limit.

              You should Set Error Capture [On] in case there are no records that match the particular ClientID.  Check for that in the loop and just do nothing and skip on through it.