Two questions on .net Printing with PrintSheet

Posted by: duncan on 8 September 2017, 12:45 pm EST

  • Posted 8 September 2017, 12:45 pm EST

    Hi  I have two questions about getting PrintSheet to work in the 1.1<SPAN>  </SPAN>.Net print environment.


    <o:p> </o:p>


    Q10 Basically, I would like


    <o:p> </o:p>


    <SPAN>printDocument1_PrintPage(<SPAN>object</SPAN> sender, System.Drawing.Printing.PrintPageEventArgs ev) event to do what the far out demo does, But using PrintSheet<SPAN>  </SPAN>instead of all those loops?<o:p></o:p></SPAN>


    <SPAN><o:p> </o:p></SPAN>


    <SPAN>In affect I would like PrintSheet to print using the ev parameters passed in <SPAN> (</SPAN>see Boilerplate code below)<o:p></o:p></SPAN>


    <SPAN><o:p> </o:p></SPAN>


    <SPAN>Q2<SPAN>  </SPAN>Also I would like to concatenate two sheets together in one print run – one after the other. <SPAN> </SPAN>A previous post suggested using OwnerDraw,<SPAN>  </SPAN>how would I get spread to expose an OwnerDraw function?.<o:p></o:p></SPAN>


    <SPAN><o:p> </o:p></SPAN>


    <SPAN>Much appreciate you help<o:p></o:p></SPAN>


    <SPAN><o:p> </o:p></SPAN>


    <SPAN>Many thanks indeed Duncan<o:p></o:p></SPAN>



     

    <FONT face="Courier New" color=#0000ff size=2>

    private</FONT><FONT face="Courier New" size=2> System.Drawing.Printing.PrintDocument printDocument1;

    </FONT><FONT face="Courier New" color=#0000ff size=2>

    private</FONT><FONT face="Courier New" size=2> System.Windows.Forms.PageSetupDialog pageSetupDialog1;

    </FONT><FONT face="Courier New" color=#0000ff size=2>

    private</FONT><FONT face="Courier New" size=2> System.Windows.Forms.PrintPreviewDialog printPreviewDialog1;

    </FONT><FONT face="Courier New" color=#0000ff size=2>

    private</FONT><FONT face="Courier New" size=2> System.Windows.Forms.PrintDialog printDialog1;

    </FONT><FONT face="Courier New" color=#0000ff size=2>

    private</FONT><FONT face="Courier New" size=2> FpSpread quoteSpread1;

    </FONT><FONT face="Courier New" color=#0000ff size=2>

    private</FONT><FONT face="Courier New" size=2> FpSpread quoteSpread2;


    //


    // Business logic that set up the quoteSpread1& quoteSpread2


    //

    </FONT><FONT face="Courier New" color=#0000ff size=2>

    public</FONT><FONT face="Courier New" size=2> </FONT><FONT face="Courier New" color=#0000ff size=2>void</FONT><FONT face="Courier New" size=2> Print()


    {


    DialogResult aResults;


    printDialog1.Document = printDocument1;


    aResults = printDialog1.ShowDialog();


    </FONT><FONT face="Courier New" color=#0000ff size=2>if</FONT><FONT face="Courier New" size=2> (aResults == DialogResult.OK)


    {


    printDialog1.Document.Print();


    }


    }

    </FONT><FONT face="Courier New" color=#0000ff size=2>

    public</FONT><FONT face="Courier New" size=2> </FONT><FONT face="Courier New" color=#0000ff size=2>void</FONT><FONT face="Courier New" size=2> PrintPreview()


    {


    printPreviewDialog1.Document = printDocument1;


    printPreviewDialog1.ShowDialog();


    }

    </FONT><FONT face="Courier New" color=#0000ff size=2>

    public</FONT><FONT face="Courier New" size=2> </FONT><FONT face="Courier New" color=#0000ff size=2>void</FONT><FONT face="Courier New" size=2> PrintPageSetUp()


    {


    pageSetupDialog1.Document = printDocument1;


    pageSetupDialog1.ShowDialog();


    }

    </FONT><FONT size=2>

     

    </FONT><FONT face="Courier New" color=#0000ff size=2>

    private</FONT><FONT face="Courier New" size=2> </FONT><FONT face="Courier New" color=#0000ff size=2>void</FONT><FONT face="Courier New" size=2> printDocument1_PrintPage(</FONT><FONT face="Courier New" color=#0000ff size=2>object</FONT><FONT face="Courier New" size=2> sender, System.Drawing.Printing.PrintPageEventArgs ev)


    {


    quoteSpread1.PrintSheet(0); // my first spread screen


    // quoteSpread2.PrintSheet(0); // my second spread screen


    }

    </FONT>
  • Replied 8 September 2017, 12:45 pm EST

    I think I have work it out,  Thanks Kevin for you post 29835,   I am just converting to c#


     


    thanks

Need extra support?

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

Learn More

Forum Channels