LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

NI-REPORT PRINT

Hi,

I have an application that uses NI Reports. When I attempt to print the
report using my printer HP5940 USB, I get an error but with other printers there
is no problem at all.
 
The print function "NIReport_Print ()" returns -4 in all cases of
failure. Unfortunately the error messages "Misc/unknown error calling
method" & "Unknown automation error" don't mean a lot to me.

I am using CVI 8.0.1 and Windows XP version 5 PAck 2  
I am using CVI 8.0.1 and Windows 2000 PAck4 and also I have had the same PN  
My software is not the mine one but the example of CVI 8.0.1 called reportgen\nisamples.
 
 
I saw the same PB on your forum the 03-19-2004 with the CVI.6.

http://forums.ni.com/ni/board/message?board.id=180&message.id=10060

 

NI in its answer was saying which was treating the PB. Have you got a solution today?.

 

Regards  JY

0 Kudos
Message 1 of 5
(4,069 Views)
You get this error when the margins are set too wide.

In message <1165621213311-451864@exchange.ni.com>, jyd <x@no.email>
writes
>Hi,I have an application that uses NI Reports. When I attempt to print
>thereport using&nbsp;my printer HP5940 USB,&nbsp;I get an error but
>with other printers thereis no problem at all.
>&nbsp;
>The print function "NIReport_Print ()" returns -4 in all cases
>offailure. Unfortunately the error messages "Misc/unknown error
>callingmethod" &amp; "Unknown automation error" don't mean a lot to
>me.I am using CVI&nbsp;8.0.1 and Windows XP version 5 PAck 2&nbsp;&nbsp;
>I am using CVI&nbsp;8.0.1 and
>Windows&nbsp;2000&nbsp;PAck4&nbsp;and&nbsp;also I have had the same
>PN&nbsp;&nbsp;
>My software is not the mine one but the example of CVI 8.0.1 called
>reportgen\nisamples.
>&nbsp;
>&nbsp;
>I saw the same PB on your forum the 03-19-2004 with the CVI.6.
>
><a
>href="http://forums.ni.com/ni/board/message?board.id=180&amp;message.id=
>10060" target="_blank">
>http://forums.ni.com/ni/board/message?board.id=180&amp;message.id=10060<
>/a>
>
>&nbsp;
>
>NI in its answer was saying which was treating the PB. Have you got a
>solution today?.
>
>&nbsp;
>
>Regards&nbsp; JY

--
Regards,

John Cameron.
Type softly, read gently.
0 Kudos
Message 2 of 5
(4,055 Views)

Thanks but I had tried with the following easy sotfware (the text is very shortly)  and I have always got the same error message

 

   if (InitCVIRTE (0, argv, 0) == 0)
        return -1;

    if (NIReport_New (&reportHandle) < 0) {
        MessagePopup ("ERROR", "Could not initialize NI Reports...");
        return -1;
    }
    MessagePopup ("NIReport Sample", "The application will generate a sample "
                                        "report and send it to your default "
                                        "printer");
    NIReport_NewPage (reportHandle);  //JYD
    NIReport_AppendLine (reportHandle, "This is a new page!"); //JYD
 if (!NIReport_Print (reportHandle, NULL, 1))
        MessagePopup ("NIReport Sample", "Report printed successfully!");
    else
        MessagePopup ("NIReport Sample", "Error printing report...");
    NIReport_Discard (reportHandle);
 

 

0 Kudos
Message 3 of 5
(4,053 Views)
If It is not possible to use NI-RPORT with my printer, who can tell me the USB printers which work with NI-REPORT print under Windows XP ?
Thanks
0 Kudos
Message 4 of 5
(4,052 Views)
I had a similar problem.  I generated a report that worked fine on my system.  However, I sent the program to my associates in the UK and they got an error -4.  Their computer thinks in centimeters, so my top margin of "0.5", when interpreted as centimeters, would not work for their printer.  Hope this helps.
0 Kudos
Message 5 of 5
(3,832 Views)