Print Preview bombs on use of close button

Posted by: toma on 8 September 2017, 1:44 pm EST

  • Posted 8 September 2017, 1:44 pm EST

    Hi,


    with the following code:

    <FONT size=2>

    </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>this</FONT></FONT><FONT size=2>.fpSpread1_Sheet1.PrintInfo.PrintToPdf = </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>false</FONT></FONT><FONT size=2>;


    </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>this</FONT></FONT><FONT size=2>.fpSpread1_Sheet1.PrintInfo.BestFitCols = </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>false</FONT></FONT><FONT size=2>;


    </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>this</FONT></FONT><FONT size=2>.fpSpread1_Sheet1.PrintInfo.BestFitRows = </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>true</FONT></FONT><FONT size=2>;


    </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>this</FONT></FONT><FONT size=2>.fpSpread1_Sheet1.PrintInfo.ShowShadows = </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>false</FONT></FONT><FONT size=2>;


    </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>this</FONT></FONT><FONT size=2>.fpSpread1_Sheet1.PrintInfo.Orientation = FarPoint.Win.Spread.</FONT><FONT color=#2b91af size=2><FONT color=#2b91af size=2>PrintOrientation</FONT></FONT><FONT size=2>.Landscape;


    </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>this</FONT></FONT><FONT size=2>.fpSpread1_Sheet1.PrintInfo.ZoomFactor = (16.0f / </FONT><FONT color=#2b91af size=2><FONT color=#2b91af size=2>Convert</FONT></FONT><FONT size=2>.ToSingle(fpSpread1_Sheet1.ColumnCount));


    </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>this</FONT></FONT><FONT size=2>.fpSpread1_Sheet1.PrintInfo.Preview = </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>true</FONT></FONT><FONT size=2>;


    </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>this</FONT></FONT><FONT size=2>.fpSpread1_Sheet1.PrintInfo.ShowPrintDialog = </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>true</FONT></FONT><FONT size=2>;


    </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>this</FONT></FONT><FONT size=2>.fpSpread1.PrintSheet(0);</FONT>


    <FONT size=2>the print preview works, and will print, but crashes with a null reference exception at PrintSheet(0) when I use the Close button on the dialog.</FONT>


    <FONT size=2> What am I doing wrong?</FONT><FONT size=2>

    </FONT>
  • Replied 8 September 2017, 1:44 pm EST

    I believe I'm using the latest version, 4.0.2009 of Spread for Winforms. The program is using .NET 2.0, however. Given some other posts here, perhaps having frozen columns is involved?


    I'll try to construct a project with the offending characteristics.

  • Replied 8 September 2017, 1:44 pm EST

    OK, here's a project (C#) that causes trouble on my system. The complete FarPoint Spread for Winforms version is 4.0.2009.2005 if I read it correctly.


     


    2009/02/FarpointPreviewTest.zip
  • Replied 8 September 2017, 1:44 pm EST

    Hello,


    How do I reproduce this issue with the project you sent? I ran the project and clicked the PrintPreview menu item and the Print Preview showed correctly. I then triend clicking the Close button on the Print Preview. I also tried clicking the X to close the Preview. Neither way caused a n exception in my tests.

  • Replied 8 September 2017, 1:44 pm EST

    Save to a file then close - I am getting the same error (object not set to an instance of an object)
  • Replied 8 September 2017, 1:44 pm EST

    Hello,


    There is not an option in this project to save to a file. Could you post a small zipped project reproducing the issue for us to debug?

  • Replied 8 September 2017, 1:44 pm EST

    Hello,


    What release of Spread for WIndows Forms are you using? I tried this with the latest maintenance release and all was well. Could you post a small zipped project reproducing this issue for us to debug?

Need extra support?

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

Learn More

Forum Channels