From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, 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: 

How do I stop Report Generation Toolkit from Changing Spreadsheet Cell Format?

Hello,
 
I am writing a bunch of data to an Excel Spreadsheet using Report Generation Toolkit.  I simply want to put data in the cells without changing the format of the cell, but everytime I write a new value to the cell, the cell  width changes.  Now I have been using the Excel Set Cell Dimensions Vi to put the cells back to the original width, but it seems I should be able to set it up so that the cell formatting doesn't change. 
 
Any ideas?
 
 
0 Kudos
Message 1 of 7
(3,524 Views)
Hello,
 
I see from the attached VI that you are using the Excel Easy Table.vi, which is great, but the answer to why that occurs with that particular VI is likely buried in a format setting somewhere inside the VI.  Your solution/workaround is reasonable and functional, and if you need help automating the reformatting for a number of cells, definitely repost.  Also, I am not sure why you have a single element sequence structure in your VI.  There are cases where that can be a useful structure, such as initializing a design pattern, however in your case the code will function the same without it.
 
Thank you,
 
Best Regards,
 
JLS
Best,
JLS
Sixclear
Message 2 of 7
(3,500 Views)
Thanks JLS,
 
To answer your question, seems I had some problem with the table vi. and a single element, so I set it up that way and viola no more problems so I left it that way.  It doesn't surprise me that its not the best.  I still get confused with the Labview Array stuff and I know just enough to make me dangerous.
 
Thanks again for the reply.  I really appreciate that!
 
Baker
0 Kudos
Message 3 of 7
(3,482 Views)
Hello,
 
Ok, no problem, and if you have questions about the array functions and manipulations in LabVIEW, feel free to repost!  Better yet you can start a new thread, and with the appropriate title you'll likely get answers from many people using those functions in a variety of similar applications!
 
Thanks for reposting and best regards!
 
JLS
Best,
JLS
Sixclear
0 Kudos
Message 4 of 7
(3,462 Views)
Bump--
I have the same original question.  It is frustrating that all data gets put in and the cell format changes.  I want to be able to just place data in an already existing, formatted template.
0 Kudos
Message 5 of 7
(3,349 Views)
OK, I made my own solution.  The attached VI only puts data in an Excel sheet, leaving all existing formatting alone.

I had to dig down a bit and pull the pieces I needed, so no guarantees this will continue to work if they ever update the toolkit.  Also, this is only for use with Excel reports.
0 Kudos
Message 6 of 7
(3,344 Views)

Late reply to this, but I hope I can help someone with the same issue.

 

If you change the default value of "column width (1)" to -1 in "NI_report.lvclass:Append Text Table to Report (wrap).vi", it will skip the column-editting case structure found in "NI_ReportGenerationToolkit.lvlib:Excel_Insert_Table.vi".  This means that you can print with the column widths saved in your Excel file, rather than LabVIEW changing them all to a constant width.

 

VI  Heirarchy:

NI_Report_GenerationToolkit.lvlib:Excel Easy Table (str).vi

NI_report.lvclass:Append Text Table to Report (wrap).vi

NI_Excel.lvclass:Append Text Table to Report.vi

NI_ReportGenerationToolkit.lvlib:Excel_Insert_Table.vi

 

This was done with LabVIEW 2012

Message 7 of 7
(2,920 Views)