LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

MS office report

Hi, I am trying to generate a report using the MS office express vi and after follow the instructions in the manuals and check the examples I cant fill a table predefined in my own template!! and I get an error

 

 

Error -41110 occurred at NI_ReportGenerationToolkit.lvlib:ex_RGT_Append Anything To Report.vi -> NI_ReportGenerationToolkit.lvlib:subMS Office Report Block.vi -> test_report.vi:MS Office Report.vi-> test_report.vi

while processing the module_ID input.

 

I am using labview 2011. attached is a vi  that I wrote to study only the report generation.

 

 

I appreciate any suggestion.

 

Download All
0 Kudos
Message 1 of 15
(4,346 Views)

Where are you generating the Report?  I don't see anything happening in the VIs you submitted.  I don't understand what Report Base Info does, where is "Create report and finish", and is there a top level VI somewhere?

 

BS

0 Kudos
Message 2 of 15
(4,339 Views)

Hi Bob_Schor

 

sorry I forget many details.

 

I am getting all the information from other vi's , from a dialog box in the "promp user for input" (additional comments) and also from the "report base info"  where the user have to enter some info.  The "create report and finish" is a buttom in the main vi (the top level vi)

 

the code I attached is just a simple code to reproduce the report generation.

 

thank

0 Kudos
Message 3 of 15
(4,328 Views)

also note that the ms office report express vi is confugured to open the report wihtout seve it.

 

thanks

0 Kudos
Message 4 of 15
(4,327 Views)

also note that the ms office report express vi is configured to open the report wihtout save it.

 

thanks

0 Kudos
Message 5 of 15
(4,326 Views)

@jmonroy wrote:

also note that the ms office report express vi is confugured to open the report wihtout seve it.

 

thanks


Which VI has the MS Office Report Express VI?  I didn't see it in any of the attachments -- without seeing any Report code, it's extremely difficult to figure out how to help you.  Help us help you.

 

BS

0 Kudos
Message 6 of 15
(4,298 Views)

Hi Bob_Schor 

I'm so sorry again I had a confusion with the names of the programs,  attached is the program: generate report.

 

thank you very much your time. 

 

 

0 Kudos
Message 7 of 15
(4,258 Views)

Thank you, now I see what you are doing.  I must confess that I'd never heard of an Express MS Office Report -- one of the first things that I do when I configure LabVIEW for myself is to "hide" the Express Palette so that I never even know that it is available!

 

I'd strongly recommend that you stop using the Express MS Office Report, and instead use the Report Functions found on the Programming Palette.  It takes a few more steps, but you have a lot more control over what is happening, and can generally customize the Report quite easily by doing it one element at a time.

 

I've not (yet) made Word reports using LabVIEW, but I've done quite a bit with Excel (both reading data from Workbooks and writing data to Worksheets in a Workbook) and HTML (I use this as the output for a Test Report that I generate while checking the validity of an Excel Worksheet designed to run a test protocol).  I'd imagine that generating a Word Report would be similar to generating an HTML report -- you'd "start at the top" and generate elements as you go down the page, formatting as you go (it would, of course, all be text ...).

 

Can you see the Programming Palette, and the Report Generation sub-Palette on your system?  Can you explore the New Report, Easy Text Report, the various Append functions, and the Word-specific sub-sub-Palette?  Again, avoid the Express VIs!  [I see that I'm so averse to using them that I never noticed that they also show up on the Programming Palette ...]

 

Do you have a (simple) example of what you want in your report?  [It helps, sometimes, to "start small" with a few elements of the report, instead of everything all-at-once ...].

 

BS

 

 

0 Kudos
Message 8 of 15
(4,227 Views)
I can work with the report palette but I have used the express vi because this is a little more faster to fill than the individual functions. Could you upload as an example one of the program's you have made please! It is not clear to me how to fill a table using these functions. You can see the report template in the attachments. Thanks
0 Kudos
Message 9 of 15
(4,210 Views)

Well, you have certainly picked a fairly challenging task for LabVIEW to undertake!  I've thought about how I would do this (or even if I would do this), and have some observations.

  • A Word Template does not necessarily make life easier if you are "driving" Word from LabVIEW.  It is designed for human interaction, with the (human) ability to tab around and ensure that the cursor is in the correct field for inserting an element.
  • In particular, your Parts List does not "tab nicely".  In particular, it will expect exactly 1 entry in the UNL Batch No., and precisely 4 Parts entries (as you tab around, notice you enter the Batch No. field four times).
  • If I were doing this, I would generate the entire Report "on the fly", that is, I'd start with a blank Report, generate the heading ("Manufacturing of modules ..."), generate a Report Header Table (Date, Start, Finish, Operator, etc.), generate a Parts List table, and generate a Comments section.
  • I would certainly "encapsulate" the messy code for each of these steps in its own sub-VI.  Thus my Report would look something like this:Word Report.png
  • Each of the sub-VIs generate part of the Report.  Header generates the static text at the top.  Report Info generates the Date, Time, Operator, etc. part of the report, Parts List generates the Parts List table, and Comments generates the Comments at the end.
  • The Report "data" is encapsulated in four variables:
    • Report Info is a cluster with entries Date, Start Time, Finish Time, Operator, etc.
    • Parts List is an array of clusters (UNL Batch, BBM ID, and HDI S/N).
    • Comments is a cluster with entries Orientation, Glueing, etc.
    • Report Path is the path and name of the output Word document.
  • Report Info can be formatted as a table of two columns.  Each entry has a fixed string (for example, "Date:") and a variable (the value in Report Info.Date, the cluster element).  You can format the table with top and bottom borders if you want that look.
  • Parts List is fairly complicated.  It has some "pure text" (the string "List id of parts ...") and a Table.  The Table is fairly straight-forward, with a fixed Header and a style for borders and lines.  To get the UNL Batch formatting as a single cell, you can try to merge cells (based on where the UNL Batch values remain constant).
  • Comments can just be treated as ordinary text, with "header strings" (such as "Orientation:") written before the value in the corresponding Comment cluster element (e.g. Orientation) is written.

I can say, with some confidence, that the Snippet above will, in fact, produce a Report that follows your Template, once you handle the "details" of coding those four sub-VIs.  Take a look at the Word-specific sub-Palette in the Report Generation Palette, and in the Word Tables sub-sub-Palette.  

 

Bob Schor

0 Kudos
Message 10 of 15
(4,159 Views)