01-11-2014 08:15 AM
Hello Everyone,
I'm trying to generate an Excel sheet report for some readings using "Report Generation toolkit" But when trying to generate the report, the report generation part of code is executed and gives Error(7) and there is no report is generated.
The Code I use is atached in the following Link:
https://www.dropbox.com/s/9n4brimucsd0xts/Report%20Generation.rar
Can I get help please?
Thanks in advance 🙂
Solved! Go to Solution.
01-11-2014 10:53 AM
The downloaded rar is 30k in size and corrupt.
Is it just me?
01-11-2014 11:54 AM
No It works !
Please Try again 🙂
01-11-2014 12:06 PM
@ahmelsayed wrote:
No It works !
Please Try again 🙂
Same result: corrupt file is again 30k in size. I give up.
01-11-2014 01:02 PM
01-11-2014 01:12 PM
I was able to download and open your compressed file. I unpacked it into a folder.
There are numerous peculiarities that lead me to ask "Are you trying to learn LabVIEW on your own, without a mentor and without training and guidance"? Here are some of the things that I noticed:
Now to your specific question, Error 7. Do you know what this error means? If you click on Help, choose Explain Error, and put in 7, you will see this means "File Not Found". Well, there is an obvious place where a File is used, right when your program starts. I recommend that you put a Probe (do you know about Probes?) or an Indicator on the path going into the main For loop and see what File you are trying to open (hint -- there's an error in the way you build the path, but you should be able to figure out how to fix it).
Good luck. Hope these suggestions get you on a Better Path.
01-11-2014 01:27 PM - edited 01-11-2014 05:23 PM
@Bob_Schor wrote:
Good luck. Hope these suggestions get you on a Better Path.
Great points, Bob.
In addition, the use of Stop ("abort VI"), is ill advised. The VI will stop in its track, even if the consumer loop is still in the middle of doing something.
Also the General Error Handler after the lower loop will never show anything useful because (1) the code never gets there (remember you abort everything in the upper loop!) and (2) even if it gets there, the stop case does not output any error ever.
The VI will stop automatically once both loops have completed, and that's all you need. Remove the stop function.
It is not clear why you are reading "test/humidity/pressure/operator" from value property nodes in the report case while the actual controls sit disconnected in the "start" case. Why not place the controls in the report case and eliminate the property nodes entirely. Keep it simple.
01-12-2014 01:26 PM
Hi Bob_Schor,
Thanks for your Notes, They were very helpful to me :), The Problem has been solved and as you said it was a problem in building the path to the Excel Template !
I'm using the "Report Generation Toolkit" so there is a dependency problem due to calls for VIs and DLLS from the Toolkit and I've to search how to solve this one! If you can hel me with, It will be appreciated 🙂
Best Regards,
01-12-2014 01:31 PM
In addition, the use of Stop ("abort VI"), is ill advised. The VI will stop in its track, even if the consumer loop is still in the middle of doing something.
Also the General Error Handler after the lower loop will never show anything useful because (1) the code never gets there (remember you abort everything in the upper loop!) and (2) even if it gets there, the stop case does not output any error ever.
The VI will stop automatically once both loops have completed, and that's all you need. Remove the stop function.
Thank altenbach for your advice, I removed the stop function and It works fine and OK I'll always try to Keep it Simple 🙂
01-12-2014 02:14 PM
I'm using the "Report Generation Toolkit" so there is a dependency problem due to calls for VIs and DLLS from the Toolkit and I've to search how to solve this one! If you can hel me with, It will be appreciated 🙂
I'm happy to help, but puzzled by your comment about the dependency "problem". First question: What Version of LabVIEW are you using? Second question: What do you want to write to Excel? Third question: Are you writing to a new (unique) Excel file, or adding to an existing one?
My guess to the answer to Question 2 is that your data can be described as an array of clusters, each cluster being a data point with fields like "Temperature", "Weight", "Operator", "Date", and "Time", and that you can have 1 to several thousand of these to be written to Excel. My guess to the answer to Question 3 is "Write to a new file that I will name at Run Time".
Assuming that you are using a fairly recent version of LabVIEW, accomplishing these aims is not difficult. The basic idea is to use normal LabVIEW tools to create the data array, then use a few VIs from the Report Generation Toolkit to write the data into Excel.
If you can provide some answers to my questions, I'll try to work up a simple example for you.
BS