From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Automatic Report Generation. How to Append.

Hello everyone! 

 

I am seeking for help with the annoying yet, I believe, simple problem. I am trying to create automatic reporting routine, that should add a report instance into the report file after each run of the program, that includes images of some FP-controls and text. In my previous question, I got a help on how to obtain a single .pdf report file. (here is the link https://forums.ni.com/t5/LabVIEW/PDF-reporting/m-p/4009796#M1146344). The problem is, that upon multiple runs file gets overwritten, so no appending. Then, I decided to switch back to the approach of my collegues and use HTML file to do the job. The Untitled1.vi shows a minimal working example with the block diagram here for your convenience: 

Untitled1.PNG

Now as you can see in the small case structure, this approach requires a reading of the whole previous HTML file as a text and then appending new "current run related" information, following by replacing the file. When we do continious measurements for 2-3 days, we are getting sometimes "Not Enough Memory to complete this operation" error, which stops the execution (this is annoying, especially when it happens in the middle of the night). I assume, it happens when the report file gets very big (hundreds of measurements), and the reading of the file actually uses quite a bit of memory (not sure here).

 

Is there a way to achieve similar behaviour, through "Appending the Report To a File", rather then replacing the file all the time, as it is possible with a normal text files?

I would prefer to get output into .pdf, not to strugle with a lot of images around HTML file, as described in the link above, but any solution is very welcome. I also attach a VI, with a creation of a single .pdf file (Untitled 3.vi)

Looking forward to your suggestions 🙂

Download All
0 Kudos
Message 1 of 3
(2,283 Views)

How about breaking the problem into two smaller (and simpler) tasks?

  • Write a Report with a unique name (you can use LabVIEW's "Create file with incrementing suffix").  This will be small, no memory problems.
  • Once this has finished, run a second routine that takes all of the Files and "concatenates" them.  You keep all of the small "daily" files safe in case something goes awry (something always goes awry).  I've not actually tried to append reports to each other (except using the RGT and Excel, where it worked like a charm) ...

Bob Schor

Message 2 of 3
(2,223 Views)

@Bob_Schor Might be a good idea, although I do not quite get "concatenating part". Could you please show an example? As I imagine, concateneting would mean reading files into memory and somehow combining, which, I assume, runs into the same problem as original Untitled1. Basically there, we are kind of concatenating files 1 by 1 with large file.

 

Or am I getting something wrong?

0 Kudos
Message 3 of 3
(2,184 Views)