How can I access PrintDialog's PrintDocument

Originally Posted 19 April 2017, 3:05 pm EST

  • Originally Posted 19 April 2017, 3:05 pm EST

    Per ComponentOne's documentation, when "c1D.PrintDialog()" is called below, it will launch the system standard PrintDialog so that the user can choose how to print the document. ComponentOne does not expose the system PrintDialog at all so there is no way for me to manipulate. To work around this, is it possible to show me how ComponentOne converts "C1.C1Preview.C1PrintDocument()" into "System.Drawing.Printing.PrintDocument" that is required for the system standard PrintDialog to work.

    C1.C1Preview.C1PrintDocument c1D = new C1.C1Preview.C1PrintDocument();
    c1D.Load(dgvEBOM2.PrintInfo.PrintToStream());
    c1D.PrintDialog();
  • Marked as Answer

    Reply

    Hi,

    >>Is it possible to show me how ComponentOne converts "C1.C1Preview.C1PrintDocument()" into "System.Drawing.Printing.PrintDocument"
    This is done internally by C1PrintDocument and hence, the code cannot be exposed. However, you can use 'Document' property of C1PrintDocument to store it in PrintDocument object as follows:

    System.Drawing.Printing.PrintDocument asd = c1D.Document;


    Hope, it helps.

    Thanks,
    Pragati
Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels