LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Report generation with datas from a loop

Team,

 

I try to use my old data acquisition VI to run in a loop (that part should work...at least, I hope so. I have not yet tested it).

 

The second part is using some datas out of that loop to fill an excel file by using the Express VI MS Office Report. There, there is still a lot that I have not yet understood about how it works.

 

I tried to modify my template according to my needs but, strangely, despite reloading the template, my lists doesn't update in the Express VI box. Could someone point me the error I made ?

 

Also, I try to take some value out of my loop (v1, v2, v1-v2) and to dump those into the excel report with each iterations until the operator hit the STOP button. Would such a VI work for that purpose ?

0 Kudos
Message 1 of 4
(411 Views)

Good morning, Gb.  I may be able to help.  Here are some suggestions:

  • When you attach VIs to your post (a Very Good Thing to do), you should (also?) attach a "Save for Previous Version" and use LabVIEW 2019 or 2021, as many older "experts" might not have the latest versions of LabVIEW and hence cannot examine your code.
  • When dealing with the Report Generation Toolkit and an Excel report, the term "Template" (on the Create Report VI) refers to a .xlsx file, an "ordinary" Excel Workbook, not an "Excel Template", or .xlst.  Even the Help explanation doesn't make this clear.
  • A decade ago, I posted on the Forums a Revised "Generate Excel Report" Example, which I'll attach below (though you can find it by starting to type "Revised Generate Excel Report" in the Forum's Search Bar on the first page).  It shows how to use the Template to put "pieces of your Report" (including an Excel plot of some data) on a Worksheet.  This Example doesn't use a Template, but it does show you how to put elements of your Report in specific locations (meaning "Rows and Columns") in a blank Report, basically "building the Template" as it adds in the data.  Note that this Example is from LabVIEW 2013, so you should be able to open it.  To get rid of the "what looks like an error", replace "New Report" with "Create Report", but the original will also work.
  • Hope these suggestions will get you started.  If you still have problems, post your code "Saved for previous Version".

Bob Schor

 

P.S. -- I'm attaching a "Revised Revised" example, saved in LabVIEW 2021, with New Report.  If you want to find the original, a search on the Forums, as I noted above, should find it ...

 

 

0 Kudos
Message 2 of 4
(373 Views)

Thank you very much, Bob !

I will look at your post to try to understand how to get it running; and I will come back with a saved for previous versions if needed 🙂

0 Kudos
Message 3 of 4
(359 Views)

I can't open your code. So I dropped down a MS Office Report express VI and configured it with your XLT file.  Everything works as expected for me.

aputman_0-1716386063973.png

If you want to populate the table with data using this Express VI, you'll need to store the data in an array or read it from a CSV file (or similar) into an array and write it all at once to the template.  This VI is not meant to be called repeatedly to append data to a file. 

Using RGT for that purpose is not typically recommended due to the overhead associated with ActiveX.  It's slow and depending on the rate at which your data is available, the write process may lag. 

aputman
------------------
Heads up! NI has moved LabVIEW to a mandatory SaaS subscription policy, along with a big price increase. Make your voice heard.
0 Kudos
Message 4 of 4
(348 Views)