10-06-2015 05:34 AM - edited 10-06-2015 05:34 AM
HELLO..
i am trying to genertae report in excel format , i am getting the report properly. Now i want to generate reprot in new excel after some time, if i run the VI the report is updating in previous excel sheet only. i want to generate new report in new excel sheet.
i want to make a new report in new excel sheet after 24 HRS ,it should generate automatically for every 24 hrs.
could you suggest me a code plz.....
10-06-2015 06:26 AM
I'm reasonably sure (meaning "I think it's so, but don't quote me") that with LabVIEW's Report Generation Toolkit, you can have only one Excel Workbook open at a time. Furthermore, I know (from having done it) that "LabVIEW is faster than Excel", meaning if you do a Dispose Report to close Excel and then immediately do a New Report to re-open it, you will get an error.
The following process works for me (tested with RGT from LabVIEW 2012 and 2014):
If your goal is to generate reports continually, with a new report being generated every 24 hours, the brief "gap" shouldn't be much of an issue if you are using LabVIEW, as you can use a Producer/Consumer Design Pattern to allow the (Excel) Consumer to briefly pause the requisite amount of time to handle the switch-over.
Bob Schor
10-06-2015 07:43 AM
Hi,
Thanks for your reply,
I am not working on existing excel report, my intension is pretty clear that , to generate new excel report when ever i want (depends upon condition ).
It means if the condition is true then it should generate new excel report.
10-06-2015 08:00 AM
My instructions are the same whether reading or writing. The important point is you must end the "old" report with the sequence "Save Report", "Dispose Report", "Wait (ms)" (for some time, I suggest 100 msec). To generate the next report, you then begin again with "New Report".
Note that it is possible that you'll still get an error when opening the next New Report. If this happens, try increasing the time delay to give Excel more time to close and re-open. This may well depend on the speed of your machine, what version of Office, etc.
Bob Schor
10-06-2015 08:30 AM
@sridhar..reddy wrote:
HELLO..
i am trying to genertae report in excel format , i am getting the report properly. Now i want to generate reprot in new excel after some time, if i run the VI the report is updating in previous excel sheet only. i want to generate new report in new excel sheet.
i want to make a new report in new excel sheet after 24 HRS ,it should generate automatically for every 24 hrs.
could you suggest me a code plz.....
There is a bit of confusion here. You're talking about generating report in new Excel after some time. What do you mean by new Excel? New worksheet? New workbook?
Later you are talking about new report in new Excel sheet.
If you just want to add data to a new worksheet (of a single workbook) every 24hrs then you can do it using the Excel Get Worksheet.vi, Excel Add Worksheet.vi and Excel Rename Worksheet.vi (I would use this one to rename the worksheet to the date of the data capture). By default a workbook is created with 3 worksheets, you can use Excel Get Worksheet.vi to select them. If your test run for more than 3 days then use Excel Add Worksheet.vi to add a new worksheet every additional day. These vi are located in the Excel General and Excel Advanced palettes of the Report Generation Toolkit.
If you want to create a new workbook every 24 hrs, then follow Bob's instructions.
Ben64
10-06-2015 09:26 AM
I understood now .. Thankyou so much.
if you dont mind can you attach the sample code what you said about.
i want to know the code for adding a new work sheet after every 24 hrs .
10-06-2015 10:04 AM
sridhar..reddy wrote:
I understood now .. Thankyou so much.
if you dont mind can you attach the sample code what you said about.
i want to know the code for adding a new work sheet after every 24 hrs .
No, but if you make and post a test VI that you think does what I clearly explained, I'll be happy to make comments on your code. But be sure to post code, that is, attach a VI or embed a Snippet (and if you don't know about Snippets, just attach the VI). This way, if I want to indicate a change, I can change your code and re-post it.
Bob Schor
08-01-2017 07:28 AM
hi,
i am a new user for LabVIEW. I use LabVIEW 2012. I my company we manufacture the motor. my work is test the motor with reference of barcode and calculate power,power factor,RPM. The reading are i get it. But i don't know how to generate customized report. i have report generation toolkit for microsoft. please any one give example.
08-01-2017 08:09 AM
Hello ponkumar,
Go to example finder (Help > Find examples). In the Section Toolkits and Modules , You will find some report generation examples.
check this link Creating a Report in Microsoft Excel Using the LabVIEW Report Generation Toolkit
08-01-2017 09:13 PM
You can also find (what I think is an excellent) example by searching on this Forum for "Revised " (type the word Revised, a space, let the search find some things, then choose the one that "looks right" ...). Take a look, run the code and see what it does, make some changes to "play" with it, then try incorporating its ideas into your own code.
Note that this is for making "Excel" Reports, i.e. creating Excel Workbooks. You can also create HTML Reports (using slightly different Functions, of course) and Word Documents with the Report Generation Toolkit.
Bob Schor