LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Standard Report won't print

I'm using LV2015-SP1 Pro and trying to generate a report of the "standard report" type, then print it to the default printer.  My application runs to completion with no errors, but no print is made.  The PC's OS is Windows 7 Pro.

 

For a test I loaded "Easy Text Report.vi" from the NI library, and I get different results depending on the "report type" that I select:

Standard => runs to completion with no errors, but no print is made.

HTML => runs to completion with no errors AND generates a print.

Word => fails; cannot find NI_Word.lvclass

Excel => fails; cannot find NI_Excel.lvclass

 

I don't want to use HTML because I'm porting an old application from LV7 and it's already written for the "standard report" type (and it worked fine in LV7).  But LabVIEW seems to refuse to print a "standard" report.  (Also I haven't been able to find much detailed information about the "standard report" class.)

0 Kudos
Message 1 of 16
(4,025 Views)

My ESP is on the fritz, so I can't view the VI that you failed to post.  Please do not send a picture of your VI -- I don't want to attempt to copy your code in order to test it and try to figure out what went wrong (like a missing wire, or a disconnected wire that "looks OK" on the Block Diagram).

 

There are two possibilities -- there's a serious Bug in LabVIEW 2015 that noone else (including NI's testers) has observed or there's a serious Bug in your code.  The odds are it is the latter, so attach your code.

 

Bob Schor

0 Kudos
Message 2 of 16
(4,022 Views)

Thanks for your kind reply.  I purposely described a test with the "Easy Text Report.vi" from NI's own library, to simplify the problem and eliminate the possibility of me screwing up my application.  The VI I tested is now attached.  If this can be made to generate a print on my PC (using "Standard Report" type), then I think I can transfer the solution to my real application.

Thanks again.

0 Kudos
Message 3 of 16
(4,011 Views)

Thanks for your help.  Did you expect a "bare" RGT function to do anything?  I wrote a 5-function routine that starts with New Report (with Standard Report wired to the input) and ends with Dispose Report + Simple Error Handler.  Here is its output:

Print Test Proof.pngAlthough I don't show the function that adds text to the Report, rest assured that the above Text is what is in the String Constant I used.

 

Hope this is helpful.  If you want to see my code, please attach your (complete) code that you could not get to work.  I will be happy to explain, with reference to your code, what you did or didn't do.  Note that I'm using LabVIEW 2016 -- by attaching your code, I can tell the Version of LabVIEW you are using, and may be able to say "Oh, that doesn't work in LabVIEW 2006 ..." (there is no such version, by the way ...).

 

Bob Schor

0 Kudos
Message 4 of 16
(3,999 Views)

FYI to anyone reading this thread, the Standard Report type has been changed to HTML under the hood in LabVIEW 2018 and later. So any application that is constructing a report specifically for Standard Report appearance will need to be reworked when the app is ported to LabVIEW 2018 or later.

Message 5 of 16
(3,994 Views)

Bob,

Thanks again for your attention.  Attached is a VI that behaves exactly as I described in my original post.  I can't attach the actual full code I'm working on due to confidentiality restrictions, but the attached uses the same calls and gives the same symptoms.  Making this code run would solve my problem, I'm sure.

Of course I would be very interested to see (and try) the VI that you wrote; plus your explanation, etc.

0 Kudos
Message 6 of 16
(3,984 Views)

How curious!  Here's a LabVIEW 2016 Snippet of the VI I just ran:

Print Test.png

As you can see, it is virtually identical to the one you posted.  There are, I believe, only a few differences:

  • Your code is in LabVIEW 2015, mine is in LabVIEW 2016.  I do not believe this accounts for the difference in behavior.
  • Your code uses Controls, where I use Constants, for Report Type and Text.  Again, this shouldn't be the difference -- indeed, I ran your code with "This is a test" and got printed output saying "This is a test" (running on the LabVIEW 2016 RTE).
  • We are using different printers.  I'm actually "on the road" with my laptop on my lap, not connected to any printer.  The Print Report function has a Printer Input that, if left blank (as both of us have done), defaults to the Default Printer.  I don't have a Default Printer defined, so I defined my Snagit "printer" as the Default Printer, and got the result(s) I expected.

Do you have a Default Printer defined?  If not, you need to specify the Printer in the Print Report function (right-click the Function and read the Help message).  Let us know if this fixes things for you.

 

Bob Schor

 

P.S. -- I presume you saw the note from Darren Nattinger that the Standard Report option is being phased out in LabVIEW 2018 ... 

0 Kudos
Message 7 of 16
(3,968 Views)

Thanks for looking at this.

* The controls vs. constants thing doesn't make a difference on my system; I tried both.

* My default printer is "Adobe PDF" and the HTML-version report prints correctly to that.  So I conclude that LV in general can find this.

* I tried connecting "Adobe PDF" as the printer name and got the same result.  I also checked (separately) that the QueryAvailablePrinters VI returned "Adobe PDF" as one of the results.

* I _did_ see the notice from Darren about Standard Reports going away, but I'm trying to port an old LV 7.1 program and would like to avoid re-doing all the work to change the format.

New info: if I double-click on the PrintReport.vi in the VI I sent you, LV asks me to choose the implementation.  I get to choose between NI_HTML.lvclass:PrintReport.vi and NI_StandardReport.lvclass:PrintReport.vi.  If I choose the HTML version and then look at its block diagram, I see what's in the attached NI_HTML... picture.  If I choose the Standard Report version and look at its block diagram, I see as shown in the NI_Standard... picture.  I'm not sending a screen-shot for every permutation, but there is no permutation of the NI_Standard.. version (in the case structures) that includes any VI that looks like a "print" function.  So it seems to me that version of PrintReport is either corrupted on my PC or published with a mistake.

I have no interest in assigning blame for this, I just want a PrintReport VI that works with Standard Report format so I can finish my project (this is real life, i.e. customer waiting).

If you happen to be able to send a different version of the PrintReport VI that works I would be grateful.

Anyway, thanks for your attention.

0 Kudos
Message 8 of 16
(3,958 Views)

Bob,

 

I should have sent you the actual PrintReport.vi that I was referring to; it's attached now.

It was located in directory:

C:\Program Files(x86)\National Instruments\LabVIEW 2015_SP1\vi.lib\Utility\NiReport.llb\Standard Report

I suppose if you're running LV2016 you can substitute this into your little program and try it?

Thanks again.

0 Kudos
Message 9 of 16
(3,956 Views)

Confession -- Since I'm "on the road" without a true printer, I also tried setting my default printer to Adobe PDF.  It also didn't work.  Since I have/use Snagit, and it installs a "Snagit Printer", I then tried setting the Snagit Printer as the Default, and it worked like a charm!

 

I have no idea why setting Adobe PDF as the "Standard Printer" would fail, but Snagit would work.  Well, I do have an idea -- when you print to Adobe PDF, you don't get a "generic" output.  It want to generate a named PDF file, which involves some sort of "behind-the-scenes" Magic.  For Snagit, it "prints" to an Image that can be saved as a PNG (which is what I attached), or can be sent to a "real" Printer.  I suspect that if my HP Whatever were set as the Default Printer, I'd have a piece of paper in my hand.

 

So my "best guess" is that you are trying to "print" to a non-standard "Default Printer" (Adobe PDF) that the RGT is not able to handle.

 

If this isn't resolved by Monday, I'll be back, with my HP available, and I can test my hypothesis ...

 

Bob Schor

0 Kudos
Message 10 of 16
(3,948 Views)