LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Named Cells and Inputs in Excel Report

Solved!
Go to solution

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.

0 Kudos
Message 1 of 7
(6,557 Views)

forget about Express VI. It is best solution 🙂

 

Use functions report generations -> excel specific:

 

excel.png

Message 2 of 7
(6,531 Views)

Use 'Append Report Text.vi' from the Report Generation pallet.  Cell names can be specified at the 'MS Office parameters' input terminal.

0 Kudos
Message 3 of 7
(6,526 Views)
Solution
Accepted by topic author ABgpe

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):

Specific Excel.png

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

Message 4 of 7
(6,502 Views)

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.

 

excel example.png

Message 5 of 7
(6,466 Views)

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

0 Kudos
Message 6 of 7
(6,452 Views)

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.

0 Kudos
Message 7 of 7
(6,409 Views)