LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Custom name to save a report in word

Solved!
Go to solution

Hello!

I want to make a report in word but when i click on generate report, it should ask the destination to save it and then pops up the display of report in word with the name I specified.new_report is a template with a bookmark.See the untitled.vi.

Download All
0 Kudos
Message 1 of 7
(3,407 Views)

I don't understand what you are doing.  If I eliminate the Template and specify a File Path for the Save Report to File function, it works just fine.

 

What do you really want to do?  Incidentally, I recommend that you stick with HTML Reports.  I've used this Report Type when I wanted to make "documentation" (for example, run a series of tests and write a "Report" saying what worked and what didn't) for a LabVIEW Program.  Word I found too finicky, and the LabVIEW Interface somewhat difficult to use (but that's just my opinion).

 

Bob Schor

Message 2 of 7
(3,374 Views)

I thing the the query is not difficult....I am saying when I run my vi...I want my app to give me option to save a word file anywhere I want that's it with any name

0 Kudos
Message 3 of 7
(3,347 Views)
Solution
Accepted by topic author sets

Not sure I understand very well what you want but the following vi will do this when it's time to save the report:

  • Open a file dialog box that use the start path you provided in the Report File Path control (C:\Users\Faizan\Desktop) and use the default filename NewReportName.docx that you can edit.
  • It will then dispose the report but will leave the new Word saved file open.

Word Report Custom Name.png

The false case only contain a true constant.

Ben64

 

 

Message 4 of 7
(3,338 Views)

If you read the Help (or do some "experimentation" by seeing what happens when you run your VI, and specifically when the error pops up), you'll see that you need to have a File Path ready before calling Save Report to File.  Have you looked at the functions on the File I/O Palette?  Do you see anything that looks interesting and useful on the Advanced File Functions button?

 

If you are writing a Word Report, the usual "unit" would be text, that is a single string with lines of (you'll forgive the circular definition, please) "text" separated into separate units, "lines", by "End of Line Characters".  Look at the Word-specific functions on the Report Generator Palette and see if one looks more appropriate for saving Text in a Word Report (as opposed to a 2D array of strings, which is what you have in your code).

 

Bob Schor

Message 5 of 7
(3,337 Views)

I think my req was quite close to what you have proposed.All i need was a dialog box which u gave me.No inputs or paths are req as when i run VI it automatically pops up to enter a name and select a path.In the end i just added.docx to make a complete path.Thanks buddy!

0 Kudos
Message 6 of 7
(3,304 Views)

I think i have a simplier solution,

I tried it with template, it works well.

0 Kudos
Message 7 of 7
(3,141 Views)