07-15-2015 09:21 PM
To clarify -- do not simply post a JPG picture of a tiny piece of your code -- we need to see the whole thing, and in executable form (i.e. as a .vi, or at least as a Snippet), so we can understand the context of what you are trying to do.
BS
07-16-2015 08:35 AM
Hi all,
I already have a working code that generates .xls file. It is a subvi in a larger application. The issue here is that some users wanted a csv file so I'm trying to modify my subvi code to do that. See attached zip file.
Thanks
07-16-2015 08:55 AM
07-16-2015 09:49 AM
As long as you are using the Report Generation Toolkit, there is no need to use ActiveX for the purpose of saving the Excel file -- Save Report will do that for you. You can then export (as text) all of the Excel data and use the Write Spreadsheet File to make the .CSV file. Here is how I would rewrite the final bits of your code --
I cleaned up the wires around Excel Easy Table a bit. You'll see I made a VI Icon for Replace Filename, which does (I think) a nicer job of self-documenting than showing its Label. To make the filename, add the correct extension (.xlsx for Excel, .csv for CSV), use Build Path to combine Folder and Filename, and wire to Save Report.
The next two functions add the Extract Everything and Write to Spreadsheet, using a Comma as a separator, which makes a CSV copy for you.
Bob Schor
07-16-2015 09:57 AM
07-16-2015 10:01 AM
That would also work, but would just get the Test Data. The Original Poster went to some trouble to create headers and fancy formats for the Report -- the CSV can't capture the formatting, but it can get the headers. As always, it is up to the Programmer to decide what data to export ...
BS
07-16-2015 01:43 PM
Thanks everyone. You guys are the best.