GetPreferredRowheight crashes

Posted by: tosch on 21 August 2018, 12:20 am EST

  • Posted 21 August 2018, 12:20 am EST

    I have attached a small sample app with a sheet full of data.
    It contains several rtf cells where there are images included in some of the rtf cells.
    When I calculate the preferred row height for all rows spread crashes with an access violation exception.
    We are using version 10.40.20174.0.

    This used to work in version 7.x (which we were using until about 6 months ago).
    Can you tell me if this is fixed in version 11.x?

  • Replied 21 August 2018, 10:33 pm EST


    Unfortunately, we are unable to replicate the issue at our end with the given information using Spread Win version 10.40.20174.0 as you stated on Windows 8.1 X 64 bit machine using VS 2013.

    Please have a look at attached screenshots for more clarity and let us know what are we missing to replicate the issue.

    ScreenShots .zip
  • Replied 21 August 2018, 10:45 pm EST

    Here is what I do:
    - change the height on row 113 (the one with the image) so you can only see the text
    - click on 'button 1', which sets the preferred rowheight for all rows
    This will crash my test app.
    I'm running this on Win7 Pro/SP1, 64bit, Visual Studio 2017 version 15.7.4.
    It's also crashing where I run it on a Win10 machine without VS installed

  • Replied 23 August 2018, 12:18 am EST

    Hi Thomas,

    I am able to replicate this issue with Spread v10.40.20174.0. You can suspend the layout while setting the rowheight for all rows and then resume it once it is done. I update the code follows in your application and found it working absolutely fine:

    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click

    With FpSpread1.ActiveSheet
    For introw As Integer = 0 To .GetLastNonEmptyRow(FarPoint.Win.Spread.NonEmptyItemFlag.Data)
    Label1.Text = introw.ToString

    .Rows(introw).Height = .GetPreferredRowHeight(introw)
    End With

    End Sub

    Deepak Sharma
  • Marked as Answer

    Replied 23 August 2018, 12:58 am EST

    Your suggested change solves my problem.
    Thanks for your help

  • Replied 23 August 2018, 5:58 pm EST

    Glad that I could help!
Need extra support?

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

Learn More

Forum Channels