LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

creating multiple page report with single page excel template

Hi,

 

I have a created a single sheet excel template. When my LabVIEW program runs, I want to insert a data table in the excel report for each time the loop runs. Each time I add a new sheet in the report and add the data table. I want to get the same template in each new sheet. Please let me know how to insert the same template in each new sheet in the same file. Right now I need to create template file with 5-6 worksheets each with the same format.

 

Rashmi

0 Kudos
Message 1 of 6
(4,948 Views)

You need to use the ActiveX "copy" command on the Sheets object.  The image below is from the Report Generation toolkit for adding a new sheet to a workbook.  This needs to be modified to change the 'Add' method to 'Copy'.  You will then need to select the sheet index that you want to copy and tell the Copy method where to place the new sheet (Before or After).

 

Capture.PNG

aputman
0 Kudos
Message 2 of 6
(4,929 Views)

Thanks for your reply.

 

I tried to do the same you have suggested. As the "Save As" option does not work, I tried to copy the block diagram into a new vi but it gives the error. I am attaching here the screen shot of the same.

 

 

 

0 Kudos
Message 3 of 6
(4,913 Views)

I am not sure how you extend the functionality of the Report toolkit.  I was suggesting that you use this code as a starting point for your own VI.  You will have to create the Excel references, open your workbook, copy the worksheet, etc.

aputman
0 Kudos
Message 4 of 6
(4,897 Views)

I tried to copy the block diagram into a new vi but it gives the error


I'm no expert in OOPs but as little as i know you can't use any class on the block diagram of any VI.

A class is specific to a LabVIEW project or a templete

 

0 Kudos
Message 5 of 6
(4,893 Views)

I could not find any solution so I created the template programatically and used it as many times I want in the program. Its bit tedious but worked well.

Actually it would have been easy to create the template in excel and use it rather than creating programatically.

0 Kudos
Message 6 of 6
(4,841 Views)