LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Is there any method to open print dialog box

Hi,

I am NI report instument library to generate the text report, Before printing this, I want to open print dialog box to select printer, page size etc. In CVI is there any method to open "print dialog box"
0 Kudos
Message 1 of 4
(3,429 Views)
Hi,

You can use the PrinterProperties function (Windows API - "winspool.h") which displays a printer-properties dialog box for the specified printer.
Hope this help you...
Br,Sergei
"Only a life lived in the service to others is worth living..." - Albert Einstein
0 Kudos
Message 2 of 4
(3,414 Views)
Hi,

I have tried working on the problem. I could not pop out the exact print Dialog Box but we could change the code and acheive the functionality. If needed ,we can take inputs from the User Interface by placing some more controls and take inputs like number of copies, pages..etc.

Here are some settings you can do-

1. In wordrpt.c,
Under PrintReport Function-
we are calling another function WordRpt_Print
you have to change the options there to configure the number of copies and pages to print

WordRpt_Print (CAObjHandle Document_Handle,
char Printer_Name[],
WREnum_PrintOutRange Range,
int From_Page, int To_Page,
int Number_of_Copies);

2. If you want to do some more configurations, you can go to the definition of WordRpt_Print
functionc where you will be calling another function Word_DocumentPrintOutOld

Word_DocumentPrintOutOld (CAObjHandle objectHandle,
ERRORINFO *errorInfo,
VARIANT background, VARIANT append,
VARIANT range, VARIANT outputFileName,
VARIANT from, VARIANT to, VARIANT item,
VARIANT copies, VARIANT pages,
VARIANT pageType, VARIANT printToFile,
VARIANT collate,
VARIANT activePrinterMacGX,
VARIANT manualDuplexPrint);

So here you can change the code according to your application.

Regards,
Siddu
0 Kudos
Message 3 of 4
(3,411 Views)
Thanks
I will try this
Gajanan
0 Kudos
Message 4 of 4
(3,406 Views)