LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Using Word Easy Table Under Report Generation takes long time to add data points to table and generate report

Hi All,

 

We used report generation tool kit to generate the report on word and with other API 's under it,we get good reports .

 

But when the data points are more (> 100 on all channels) it take a long time  to write all data and create a table in the word and generate report.

 

Any sugegstions how to  make this happen in some seconds .

 

Please assist.Word Easy Table.PNG

0 Kudos
Message 1 of 13
(2,474 Views)

You say > 100 data points on all channels.  How many channels?  Can you post an example of your data?


aputman
LabVIEW 2017
LabVIEW Programming
0 Kudos
Message 2 of 13
(2,465 Views)

I simulated some text data with 8 columns and 63 rows and it took 15 seconds to write it to a table in Word.  Another reason why Word sucks.


aputman
LabVIEW 2017
LabVIEW Programming
0 Kudos
Message 3 of 13
(2,457 Views)

Hi,

 

total channels will be 24,but often 16 channels will be used .

 

idea is to read available channels data from XY graph (data type =Single ch.will be a cluster of X-time stamp and Y-will be data points) and generate report 

 

100 is an examples  here ,more than that we will use to generate report

 

gen report.PNG

0 Kudos
Message 4 of 13
(2,453 Views)

Can you generate the report in a separate loop as the data is being generated rather than pulling it out of a graph point by point at the end of the process? 


aputman
LabVIEW 2017
LabVIEW Programming
0 Kudos
Message 5 of 13
(2,448 Views)

I've used the Report Generation Toolkit quite a bit to read/write Excel Workbooks and to create HTML reports.  I never tried to create a Table (a "natural" thing for Excel to handle) in Word with LabVIEW.  I agree with aputman that it is quite unsatisfactory.

 

This may be a silly question, but why not use Excel for the table?  You should be able to create a 24-channel, 100-row "report" in Excel in a second or so (maybe less).  And it will "look pretty".  And, if you really do need to generate a Word report, write the table into Excel, then use Word Insert Object, whose help says "If the object is a Microsoft Office object such as an Excel worksheet or a PowerPoint presentation, the Word Insert Object VI embeds the object into the document."  [I'm assuming that Insert Object is faster than inserting all of those Table elements one at a time ...].

 

Bob Schor

0 Kudos
Message 6 of 13
(2,419 Views)
Hi Bob,
Generating report in word looks pretty for me..so I choose that always.

As you said ,will try embeding object options and let you know the output..

Thanks

Dskp..
0 Kudos
Message 7 of 13
(2,397 Views)

Well, I just tried my suggestion.  I simulated a 24-channel data producer (I actually generated 25 numbers -- the first number was the row number, followed by 24 random numbers) and generated 100 of these for a total of 2500 double-precision values.  I then saved this table to Excel and closed the file.  I then opened Word (all using RGT), wrote a single text line "Text with Excel", inserted the previously-created "Excel Object", and saved and closed Word.

 

First, it worked (sort of).  The Table in Word started on a new page, and was in a very tiny font (possibly trying to fit 25 columns on a page?  I didn't inspect it very carefully).  This is probably "too much data" to really try to write the whole table, unless you format it for, say, 3 significant figures.

 

Now, timing.  I ran this four times, two duplicate sets, one with Excel and Word in "normal" mode, one in "minimized".  To my surprise, this didn't make a lot of difference (minimized was less than 10% faster).  Here are the approximate times:

     Generate the data -- about 1 millisecond.

     Write the Excel Report -- about 1.5 seconds

     Write the Word Report -- about 10.5 seconds

 

Seems to me this is way faster than trying to do this directly in Word.

 

Bob Schor

0 Kudos
Message 8 of 13
(2,374 Views)

P.S. -- I realized I could add a "Pure Word" test to my existing code -- simply open Word again, save the 2500 numbers using Word Easy Table, and save with a different name.  Not sure of the timing -- Word crashed after about 30-40 seconds.  Running minimized didn't help.  Here is the error message:

Exception occured in Microsoft Word: Value out of rangeHelp Path is wdmain11.chm and context 37376 in NI_ReportGenerationToolkit.lvlib:Word_Insert_Table.vi->NI_Word.lvclass:Append Numeric Table to Report.vi->NI_report.lvclass:Append Numeric Table to Report (wrap).vi->NI_ReportGenerationToolkit.lvlib:Word Easy Table (num).vi->Excel and Word Test.vi

 

BS

0 Kudos
Message 9 of 13
(2,371 Views)

Word probably crashed because the table was too wide.  I experience the same thing when I tried generating data and populating a table directly to Word.  When i delete columns, so that they all fit on one page, it didn't crash.  


aputman
LabVIEW 2017
LabVIEW Programming
0 Kudos
Message 10 of 13
(2,339 Views)