LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

programmatic printing

I am am trying to print a report from a button click on the front panel of a vi. I have been using the report generation vi's and have had nothing but trouble. For example, it will print on one machine and not another. Is there a better way to do this? Any help will be greatly appreciated.
Thanks,
Dave
0 Kudos
Message 1 of 8
(2,548 Views)
First thing, what report generation VIs are you using the old ones that printed from within LV or the new ones that talk to Word? I have found the old ones to be very reliable, the new ones I haven't tried.

To answer your question directly, the other primary way of printing from within LV is to format the front panel of a Vi to look like the report you want and after updating the panel use VI properties to tell the VI to go print itself. The only thing to remember is that the VI you are printing has to have at least one property node on it's diagram. The reason for this constraint is that LV only updates the front panel of the VI when: (a) the front panel is open, or (b) there is a property node on the VI's block diagram.

As it turns out, in my experience
, the property node requirement isn't much of a constraint as I am generally wanting to play with things at runtime anyway (change captions, plot colors, etc...).

There should be examples of exactly how to do this, if you can't find any give me a hollar...

Mike...
mporter@arielcorp.com

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 2 of 8
(2,548 Views)
I am using the old report generation vi's. Not the toolkit. I first tried to do what you suggested and print a report.vi's front panel. I had problems with this as well. I was using windows 95. However, we recently installed windows 2000. What OS have you used this on. Thanks for your comments.
Dave
0 Kudos
Message 3 of 8
(2,548 Views)
The only problems I have had were on Win95 machines. We changed to WinNT and most of the troubles went away. Now we are running Win2k and the only problems we have are when a user forgets to select a default printer.

What problems, specifically are you having?

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 4 of 8
(2,548 Views)
On the win95 machines when using the report generation vi's, sometimes it simply won't print. Or it will give the user some error and crash. I had similar problems when trying to print the front panel. (This is with LabVIEW Run Time Engine and doesn't happen in the development environment). I'm tempted now to try printing the front panel, since you haven't had any problems with win2000. Have you used this with the run time engine?
0 Kudos
Message 5 of 8
(2,548 Views)
Nearly everything that we do is with the runtime environment, and I haven't had any trouble doing either type of printing. I do both because reports with graphs are easier to do by printing a front panel, but tabular data is easier with the report generation VIs. By the way, there is a lot of capability in those VIs that aren't exploited in the examples NI provides.

One system I never did get running right was a Win95 system trying to share a non-networked printer between LV, Excel and another application written in VB. We were seeing all the same things you referenced (no printing, error messages, crashes). We eventually upgraded the computer (faster, more memory) and switched to W2k and all everything just started working
.

But the report generation VIs should work with Win2k without a hitch. When you run into the problems does the code seem to be doing anything in particular, or is it purely random?

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 6 of 8
(2,548 Views)
Another thought, email me your print functions and I'll see if I can see anything that might cause a problem. I am running V6.0.2. (Not convinced 6.1 is worth the effort yet...)

Mike...
mporter@arielcorp.com

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 7 of 8
(2,548 Views)
You might try using the report generation VIs but instead of using the standard report format use the html report format. This method will generate an html file. You can open this file in internet explorer and print from there. I have found the html report format to be much more reliable.
0 Kudos
Message 8 of 8
(2,548 Views)