Skip to Content
0

How to set number of copies within POC print dialog

Feb 07 at 01:19 PM

35

avatar image
Former Member

Hi,

I am changing my printing project from PrintMode PrintToPrinter to PrintOutputController.

It seems not possible to set the number of copies within PrintOptions in Namespace CrystalDecisions.ReportAppServer.ReportDefModel.

If the system's printersettings are set to two ore more copies the POC printdialog always ignores this setting and shows just one copy.

I found the methods CopyToPrinterSettingsAndPageSettings() & CopyFromPrinterSettingsAndPageSettings() but the EromPageSettings and the EromPrinterSettings objects given as parameters don't have the property to set number of copies.

I also used Don's RAS2010_Printing tool but his POC printer dialog gives me just one copy too although my system's printersettings are set to two copies.

Which way do I have to go to set the number of copies with PrintOutputController?

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Best Answer
Don Williams
Feb 07 at 04:59 PM
0

Hi Christoph,

Using CopyFrom works, the Dialog box now has the value I set in code:

try
{
// use Windows Printer CommonDialog box to get/fill the info
using (System.Windows.Forms.PrintDialog printDialog = new System.Windows.Forms.PrintDialog())
{
printDialog.PrinterSettings = sysPrinterSettings;

if (printDialog.ShowDialog() == System.Windows.Forms.DialogResult.OK)
{
sysPrinterSettings = printDialog.PrinterSettings;
sysPrinterSettings.Copies = 2;
sysPageSettings = printDialog.PrinterSettings.DefaultPageSettings;
printDialog.PrinterSettings.Copies = 2;
rpt.PrintOptions.PrinterName = printDialog.PrinterSettings.PrinterName;
rpt.PrintOptions.DissociatePageSizeAndPrinterPaperSize = true;
rpt.PrintOptions.CopyFrom(sysPrinterSettings, sysPageSettings);
//rpt.SaveAs("d:/updated.rpt");
btnSQLStatement.Text += "\nCopyFrom Completed - SaveAs or Export to verify";
}
}
}
catch (Exception ex)
{
btnSQLStatement.Text += "\nError: " + ex.Message.ToString() + "\n";
}

I'll see if I can set the number using POC dialog box.

Should be the same method but have to check my code...

Don

Share
10 |10000 characters needed characters left characters exceeded
Don Williams
Feb 07 at 05:57 PM
0

Tested using P2P - just add these 2 lines:

pSettings.PrinterSettings.Copies = 2;
printerSettings.Copies = 2;

POC I don't see a way to do it... Problem is POC uses a CR customer Dialog box and there is no way to get to it in code.

I'll ping DEV to see if they can add it....

Don

Share
10 |10000 characters needed characters left characters exceeded