06-17-2024 08:39 AM - edited 06-17-2024 08:40 AM
I would like to put borders as shown below. To be more specific, I would like to have borders. I want software to do the job of creating borders. The size of the borders does not matter to me. As long as I see borders that's all it matters. I am using "write delimited spreadsheet.vi" to create a file (see attached code).
I am pretty sure the report generation toolkit can get this done, but the only thing I don't like about the report generation toolkit is the create report VI
always displays the file (csv) on the computer screen. I don't want the report to pop up. Alternatively, if the report generation toolkit can do the job without bringing the csv file on the computer, I will be fine. I just want the file to be saved on a specific folder on my computer.
Code:
Results that I don't want from the code above:
Solved! Go to Solution.
06-17-2024 09:00 AM
Hi GRCK,
CSV files are plain text files (with delimiters) and so they don't know anything about cell borders or cell colors!
When you need worksheet formatting (in Excel) then you need to save to a real Excel file format, like XLSX…
06-17-2024 09:44 AM
you will need to work with the Active X functions to make Excel execute the formatting you want.
If the format is fixed , you can then have a "template" on excell and just replace the data from the csv file and save it where you want it.
06-17-2024 10:32 AM
You can do what you need with the RGT. There is a VI called Excel Set Color and Border where you can pick from several border lines. It's in Excel Specific > Excel Format palette.
To keep Excel from opening, use a Window State of Minimized in Create Report, and at the end in Dispose Report set Wait until Printing Complete to False.
06-17-2024 10:49 AM - edited 06-17-2024 10:54 AM
There's a ten-year-old example I placed in the Forum that I think will answer most of your questions regarding the RGT ["Create Report" was called "New Report" back then -- it will still work, but you might as well fix it]. To prevent Excel itself from opening, look at the other inputs to Create Report.
Bob Schor
P.S. -- my program makes an Excel report, a .xlsx. This has the ability to make borders, set Font properties, etc. You can take the nicely-formatted Excel (.xlsx) file and ask Excel to save it as a .csv file (which Microsoft gives an Excel-like icon, making you think you have all of Excel's formatting properties, but as has been explained, a Comma-Separated-Variable (or .csv) file is an ordinary Text file with (typically) commas delimiting columns (although LabVIEW uses <Tab> by default), and New Lines delimiting rows.