Nevron Forum

Enabling of Print Range groupbox in NPrintManager dialog

https://www.nevron.com/Forum/Topic7262.aspx

By Lee Harris - Thursday, December 27, 2012

I'm successfully printing multiple charts on a single page. What I'd like to add is the ability for the user to selecting a specific chart, and then when they click Print... to have the Print Range groupbox in the dialog that appears from the pm.ShowDialog() have both 'All' and 'Selection' enabled so the user can decide whether to print just the selected chart, or all charts.

Is there a way to affect the enabling of the groupbox and its radiobuttons?

Thanks,
Lee
By Nevron Support - Friday, December 28, 2012

Hi Lee,

In order to achieve this you need to customize the settings of the print dialog - the following code snippet shows how to create your own print dialog and update the printer manager settings:

   NPrintManager pm = new NPrintManager(nChartControl1.Document);

   using (PrintDialog dlg = new PrintDialog())
   {
    dlg.UseEXDialog = true;

    PrinterSettings settings = (PrinterSettings)pm.PrinterSettings.Clone();
    settings.MinimumPage = 1;
    settings.MaximumPage = 10;
    settings.FromPage = 1;
    settings.ToPage = 1;
    settings.Copies = 2;
    settings.PrintRange = PrintRange.Selection;

    dlg.AllowSomePages = true;
    dlg.PrinterSettings = settings;

    if (dlg.ShowDialog() == DialogResult.OK)
    {
     pm.PageSettings.PrinterSettings = dlg.PrinterSettings;
     pm.PrinterSettings = dlg.PrinterSettings;
    }
   }

Hope this helps - let us know if you meet any problems...