ReoGrid Forum

Fast and powerful .NET Spreadsheet Component

You are not logged in.

Announcement

This forum has been archived and no longer accepts new user registrations. Please report your questions, problems, and feedback to the issue page of ReoGrid on GitHub. Thank you for your cooperation.

https://github.com/unvell/ReoGrid/issues

#1 2016-03-02 13:27:43

deaspo
Member
Registered: 2016-01-29
Posts: 11

Experiencing crashes when using PrintSettings.ShowGridLines

Hi Jing,

Am using the new version 1.2.0 and tried to set print settings to print grid lines but the program crashes when I set it to true. Am getting the following error:

An unhandled exception of type 'System.ArgumentOutOfRangeException' occurred in mscorlib.dll

Additional information: Index was out of range. Must be non-negative and less than the size of the collection.

Please help

Offline

#2 2016-03-02 14:05:42

Jingwood
Moderator
From: jing at reogrid.net
Registered: 2014-06-03
Posts: 615

Re: Experiencing crashes when using PrintSettings.ShowGridLines

Hi, can you send your Excel/rgf/code to me?  jing at reogrid.net, thanks.

Offline

#3 2016-03-02 18:18:27

deaspo
Member
Registered: 2016-01-29
Posts: 11

Re: Experiencing crashes when using PrintSettings.ShowGridLines

Here is the code that am using:

Private Sub cmdPrevSheet_Click(sender As Object, e As EventArgs) Handles cmdPrevSheet.Click
        Dim sheetPreview = frmEditor.grdData.CurrentWorksheet

        Using session = sheetPreview.CreatePrintSession()
            sheetPreview.PrintSettings.ShowGridLines = True

            previewPrint.Document = session.PrintDocument
            previewPrint.SetBounds(200, 200, 1024, 768)
            previewPrint.PrintPreviewControl.Zoom = 1.0
            previewPrint.ShowDialog(Me)

            session.Dispose()
        End Using
    End Sub

Last edited by deaspo (2016-03-02 18:26:03)

Offline

#4 2016-03-07 02:24:09

Jingwood
Moderator
From: jing at reogrid.net
Registered: 2014-06-03
Posts: 615

Re: Experiencing crashes when using PrintSettings.ShowGridLines

It looks like necessary to use your data on the worksheet to test the problem, can you send me your Excel or RGF template? please mail to jing at reogrid.net

Offline

#5 2016-03-08 08:55:07

deaspo
Member
Registered: 2016-01-29
Posts: 11

Re: Experiencing crashes when using PrintSettings.ShowGridLines

Sure

Offline

#6 2016-03-08 15:09:06

Jingwood
Moderator
From: jing at reogrid.net
Registered: 2014-06-03
Posts: 615

Re: Experiencing crashes when using PrintSettings.ShowGridLines

Thanks for the mail. Now I can confirm the problem and it will be fixed in next release soon. For a temporary solution, you could don't use the PrintSettings.ShowGridLines property, instead it use the following code that makes border line displayed like grid line during print.

sheet.SetRangeBorders(RangePosition.EntireRange, BorderPositions.All, RangeBorderStyle.SilverSolid);

Last edited by Jingwood (2016-03-08 15:10:13)

Offline

#7 2016-03-15 14:53:44

Jingwood
Moderator
From: jing at reogrid.net
Registered: 2014-06-03
Posts: 615

Re: Experiencing crashes when using PrintSettings.ShowGridLines

This problem has been fixed in version 1.2.1. Please try the latest version: https://reogrid.net/download/

Offline

Board footer

Powered by FluxBB