Converting FpSpreadPreview (SpreadPro 3) to Spread for Windows

Posted by: elwinharrison on 8 September 2017, 1:49 pm EST

  • Posted 8 September 2017, 1:49 pm EST

    I am converting an older VB6 application which used Spread Preview component of SpreadPro3. How can I replace the Spread Preview when using Spread for Windows?


     


    Thanks 

  • Replied 8 September 2017, 1:49 pm EST

    Hello,

    In case you are using Spread for Windows (.net) and would like use the Preview feature as is available in the Spread(COM) version, then with Spread Window(.net) you may try using the OwnerPrintDraw method of the FpSpread class to provide a print preview dialog with some options for previewing the pages before printing.A sample illustrating this method is installed with the product samples. The path for the sample, if you performed a default installation, is C:\Program Files\FarPoint Technologies\Spread.WinForms\v4.x.x\Samples\Examples\OwnerPrint. When you run the sample code, you can select Print Preview from the File pull-down menu on the form. This launches the print preview dialog. I am also attaching the same with this.

    Thanks


    2009/04/OwnerPrint.zip
  • Replied 8 September 2017, 1:49 pm EST

    Hello,


    In addition to what Suresh stated, we also have a built in PrintPreview dialog that you can show by setting the Preview property of the PrintInfo structure to True before calling the PrintSheet method.

  • Replied 8 September 2017, 1:49 pm EST

    I guess that I need to provide more of an explanation around my problem.


     The application that I am converting used SpreadPro 3 and one screen has the spreadpreview component as a control on the screen.


     What I need to do is to replicate that functionality using Spread for Windows 3.0.


    Is there anyway to do that? I saw something about a Spreadview constructor in the documentation but not sure how to use it in my current application


    Thanks for any help you can provide.

  • Replied 8 September 2017, 1:49 pm EST

    Hello,

    Like Spread(COM), we do not have a seperate PrintPreview control in .net version of Spread control.Instead we use the built in PrintPreview dialog for previewing the contents of the Spread control.As informed earliwe in .net Spread control, we make use of the OwnerPrint.This can be accessed as follows:

    FpSpread1.ActiveSheet.PrintInfo.Preview = True
    FpSpread1.PrintSheet(0)

    Thanks

    Edit: Please note above snippet will invoke the built in preview dialog.

Need extra support?

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

Learn More

Forum Channels