LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Printing with Excel - PrintArea

Hello,

 

I designed a Excel-WorkSheet, defined the printing area and saved it as file.xlsx.

 

Then  - in LabView - I open Excel and write some data to the cells (OpenExcel, OpenBook, OpenSheet, SetCellValue). But when I print now the excel-sheet via Lab View (Invoke Node -> Print Out) the print area is lost. This means I have a lot of white space on my print. Why does this happen?

 

Thanks for Help

Gabriel

0 Kudos
Message 1 of 9
(5,224 Views)

Hello Gabriel,

It would be nice to get some more details, could you post your VI? Did you use any examples delivered with LabVIEW?

You can also post your VI in the forum as PNG-Image, which can be sitll used in LabVIEW:

 

create_vi_snippet.png

0 Kudos
Message 2 of 9
(5,209 Views)

Hello Ilja,

 

I used examples I saw in a book (for open Excel an write values).

 

Here are my VIs. The first is an extract of my main-VI. Case.png

 

An here the Sub-VI to write the Data to Excel (Icon A(8)->Excel)

WriteCells.png

 

Could it be a problem that I'm working with xlsx-files?

Gabriel

0 Kudos
Message 3 of 9
(5,201 Views)

Hello Gabriel,

there should not be any problems with the .xlsx format, as it is just a newer Excel format allowing you to save files with more than 256 columns/rows

 

Error -2146827284 Occurs When Using Append Table to Report.vi

http://digital.ni.com/public.nsf/allkb/DBDA2D8E71F7F721862571FB005E17D7?OpenDocument

 

I still have no idea what result with "a lot of white space on my print" you get. Please attach a working excerpt with the affected VIs and some test data. I have no time to build it on my own. As written above, VI Snippets would be fine (if you posess LabVIEW 2009 and higher).


Creating VI Snippets in LabVIEW 2009

http://decibel.ni.com/content/docs/DOC-7547

0 Kudos
Message 4 of 9
(5,174 Views)

Hello Ilja,

 

I'm sorry, I'm using LabView 8.6.

 

I append you a VI with the corresponding code.

 

When you open the attached Excel-File an watch the Print Preview, you see it like this (the printing area are only the yellow cells)

PrintPreview Before Export via LabView.png

After running the VI and inserting some text,

the print Preview is lost, because you see more.

PrintPreview After Export via LabView.png

 

Thanks

Gabriel

Download All
0 Kudos
Message 5 of 9
(5,165 Views)

Hello Gabriel,

I had no time to have an in-depth look at the vi. But as far as I have seen, working with the standard .xls format works as expected.

0 Kudos
Message 6 of 9
(5,133 Views)

Hello,

 

Where have you seen that it works as expected?

 

I added my VI aggain (with the used librarys from the examples). The content is very simple. I open the excel-file, write into one cell and then take a look on the prinitng preview.contentVI.png

 

It would be nice if you can take a look at the problem. or should I contact the support via phone?

Thanks

Gabriel

0 Kudos
Message 7 of 9
(5,129 Views)

Hello fischberg,

as far as you have a support contract with National Instruments, you can call our hotline 089 7413130, by the way I am from department responsible for Germany, Austria and Switzerland.

Telling your Service Request Nummer 950908 you will be redirected to me if possible.

 

Nevertheless your VI worked when saving to the .XLS format.

0 Kudos
Message 8 of 9
(5,073 Views)

Hey, guys.

 

I've got the same problem with LabVIEW 2009.

After LabVIEW opens my Excel files the print_area disappears from my templates.

 

So I have to add it manually:

print_area.png

 

I know it's too late, but how did you solve it?

Message 9 of 9
(4,793 Views)