04-12-2018 08:52 AM
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.)
04-12-2018 08:57 AM
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
04-12-2018 09:22 AM
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.
04-12-2018 10:42 AM
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:
Although 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
04-12-2018 10:57 AM
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.
04-12-2018 12:25 PM
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.
04-12-2018 02:50 PM
How curious! Here's a LabVIEW 2016 Snippet of the VI I just ran:
As you can see, it is virtually identical to the one you posted. There are, I believe, only a few differences:
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 ...
04-12-2018 05:43 PM
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.
04-12-2018 06:29 PM
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.
04-12-2018 08:33 PM
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