Example need for print and print preview

Posted by: alextvino on 8 September 2017, 1:46 pm EST

  • Posted 8 September 2017, 1:46 pm EST

    <DIV class=ForumPostContentText id=_ctl0__ctl1_bcr__ctl0___PostRepeater__ctl1_PostViewWrapper>


     I am new for farpoint using Version 2.5 ,Can you please give me a example to apply print preview and print to my farpointgrid




  • Replied 8 September 2017, 1:46 pm EST

    To print OR preview your sheet you would simply need to do the following.


    a) Set up your printing options via the sheets PrintInfo object.

     ex. fpSpread1.ActiveSheet.PrintInfo.UseMax = True

          fpSpread1.ActiveSheet.PrintInfo.ShowShadow = False



    b) Call the PrintSheet method    ie fpSpread1.PrintSheet(fpSpread1.ActiveSheetIndex)


    to do a preview you'd simply set the Preview property of the PrintInfo object to True before calling PrintSheet.

  • Replied 8 September 2017, 1:46 pm EST

    Using Spread ActiveX Version 7.0.49 in VC++/MFC

    I would like to have a print preview of a view containing text, bitmap and a spread sheet.  To do that I use OwnerPrintDraw method in my CView::OnPrint(..) function.
    On the print preview window, displayed spread grid is very small, changing parameters of OwnerPrintDraw change just the position but not the size!
    When sheet is printed spread grid is printed with the correct size.
    Is it possible to use standard PrintPreview for previewing a spread grid?  If yes  how can I do that ?

  • Replied 8 September 2017, 1:46 pm EST


    Changing the parameters passed into OwnerPrintDraw should change the left, top, right and bottom of the rectangle you are printing the Spread. However if the width and height of the Spread are not large enough to fill this rectangle, it will not automatically zoom the Spread to fill the rectangle. Could you post a small zipped project reproducing the issue you are seeing for us to debug?

  • Replied 8 September 2017, 1:46 pm EST

    I think it is the same problem as in 75648.
  • Replied 8 September 2017, 1:46 pm EST

    Hello Alex,

    You can preview what the printed pages will look like for a sheet and you can allow your end user to preview the printing. Use the <FONT color=#000000>OwnerPrintDraw</FONT><FONT color=#000000> method of the </FONT><FONT color=#000000>FpSpread</FONT> 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 hope it helps.



  • Replied 8 September 2017, 1:46 pm EST


    If you are using the ActieX control of Spread, then this would be the same issue and you would need to use the workaround listed in the other post.

Need extra support?

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

Learn More

Forum Channels