3 Replies Latest reply: Dec 15, 2015 8:32 AM by Luke Chatterton RSS

    Dynamically Create/Delete Sheet In Excel

    Luke Chatterton

      Hi There,

       

      I'm using nPrinting to create tailored reports for customers that have multiple tabs in the spreadsheet.

       

      I then loop over specific customers and output an excel report with multiple tabs filtered for each customer.

       

      The requirement is more complicated than I'm going to describe but essentially I'd like to do the following.

       

      1. Have 1 master excel template with multiple tabs

      2. Depending on some data contained in qlikview (relating the the cycle loop over each client) either populate or delete the tab.

       

      Any ideas?

       

      Thanks

        • Re: Dynamically Create/Delete Sheet In Excel
          Adam Krepistman

          I am not aware of a way that NPrinting itself can delete a sheet - if that is to be done, I would think it would have to be done using an Excel function/feature/formula, if it is possible.

           

          If the sheet cannot be deleted, you can look at using conditions to display either data in the appropriate chart or a message/text saying there is no data for xyz.  This will ensure all reports have the same tabs and will let the user know there is no data for that tab as oppposed to the sheet showing sometimes and not others

            • Re: Dynamically Create/Delete Sheet In Excel
              Adam Krepistman

              another option would be to create a seperate report for the sheet that may or my not be created based on data.

               

              The report would consist of jsut the one sheet and the report can be conditional - you can have an object and based on the filter the object either has data or it does not - that can be the condition or you can also jsut use the filter and select verify option - this will then only create the report if there is data based on the filter

                • Re: Dynamically Create/Delete Sheet In Excel
                  Luke Chatterton

                  Thanks for your suggestions Adam.

                   

                  Must admit I was vaguely thinking along the lines of both of your suggestions. Was thinking perhaps of a macro at the end that deleted the blank tabs but macros can be a bit flaky and macro security can get annoying.

                   

                  Regarding the second option can I do each report as it's own standalone report then merge them at the end into 1 spreadsheet? Can nPrinting merge separate reports or again would I have to do that with some kind of macro?

                   

                  Luke