03-18-2016 11:37 AM
Hi everybody,
I'm using the Report Generation Toolkit in order to fill an Excel template.
The problem is that I need to nominate and set as inputs a lot of cells, while MS Office Report Express VI allows only 25 named cells and 17 Inputs.
Is there a way to avoid this problem? Otherwise, any other ways to fill cells in a particular position of a specific Excel template?
Every kind of advices would be helpful.
Thank you in advance.
Solved! Go to Solution.
03-18-2016 01:52 PM - edited 03-18-2016 01:59 PM
forget about Express VI. It is best solution 🙂
Use functions report generations -> excel specific:
03-18-2016 01:55 PM
Use 'Append Report Text.vi' from the Report Generation pallet. Cell names can be specified at the 'MS Office parameters' input terminal.
03-18-2016 11:25 PM
Here's a technique that I use with the RGT. Assume you know the Cell you want to put something, and what you want to put there. For example, you want to put "My Text" in Cell B4, and want to put "Pi =" and (the number) 3.14 in adjacent cells C8 and D8. Here is code to do that (explanation follows):
The function "Get Excel Location" will take an Excel cell ID, like B4, and translate it into Row and Column (offset 0) numbers. If you bundle these together, they become the "cell address" that the Excel Easy Table function wants. However, Easy Table needs a 2D array, and we only have a single value -- no problem, simply pass it through Build Array twice to turn it into a 1-by-1 2D array. Now you can use Easy Table to put this single value ("My Text") in the cell (B4) that you want.
I do a similar thing with "Pi =" and put it in Cell C8. However, since I want the next value to go into the next (to the right) cell, I use the output of Easy Table, "next cell-top right", to indicate where the number 3.14 should go.
Bob Schor
03-19-2016 02:30 PM
That's great advice from Bob. A nice thing about using the "next cell" output is that you can make it easier to insert some extra information after the fact instead of going back and changing every single cell reference.
Another nice trick in Excel is that you can make a template with "named ranges". For instance, I want to write the date from LabVIEW into the cell B1. So I select B1, and highlight the cell reference. Then I type in the word "date". Now, when using the RGT functions in LabVIEW, I input the string "date" for the "name" parameter, and it goes right into that cell.
03-19-2016 03:20 PM
You haven't provided any information regarding the data to be save to file. So far all the answers are refering to single cell named range but you can also use a named range to insert data in multiple cells. If the data is not the same size as the range it will be inserted startingat the top leftmost cell of the range.
Ben64
03-21-2016 02:44 AM
I tried with your solution Bob_Schor and it seems it solved the problem. Thank you very much!!
And thank you everybody for the support.