You are not logged in.
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.
i'm using ReoGrid-0.8.6.0-Alpha-Build
Error using PrintableRange
'PrintableRange' is ambiguous because multiple kinds of members with this name exist in class 'unvell.ReoGrid.ReoGridControl'.
Last edited by hgaspar (2014-06-05 21:24:53)
Offline
I guess you are using VB.NET.
It is a bug, before it get fixed please use following code instead:
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
'Add control on form
Dim grid As New unvell.ReoGrid.ReoGridControl
grid.Dock = DockStyle.Fill
Me.Controls.Add(grid)
'Set cell value
grid(10, 10) = "A"
'Set printable range (instead of PrintableRange = New ReoGridRange(...))
Dim pi As System.Reflection.PropertyInfo = grid.GetType().GetProperty("PrintableRange")
pi.SetValue(grid, New unvell.ReoGrid.ReoGridRange(1, 1, 10, 10))
'Perform page split
grid.AutoSplitPage()
'Show print break lines
grid.EnableSettings(unvell.ReoGrid.ReoGridSettings.View_ShowPageBreaks)
End Sub
Offline
Yes i use VB.
Thanks for the suggestion. it works but i get an error performing AutoSplitPage:
A first chance 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.
My code:
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Dim range As ReoGridRange = New ReoGridRange(0, 0, Grd.RowCount, Grd.ColCount)
Grd.SetRangeStyle(range, New ReoGridStyleObject With {.Flag = PlainStyleFlag.FontName, .FontName = "Calibri"})
'Grd.PrintableRange = range
Dim pi As System.Reflection.PropertyInfo = Grd.GetType().GetProperty("PrintableRange")
pi.SetValue(Grd, range)
'Perform page split
Grd.AutoSplitPage()
'Show print break lines
Grd.EnableSettings(ReoGridSettings.View_ShowPageBreaks)
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
The range works fine for SetRangeStyle, but raises an error on AutoSplitPage
Adding one row and one column to the grid and use Grd.RowCount - 1 and Grd.ColCount - 1 solved my problem!
Dim range As ReoGridRange = New ReoGridRange(0, 0, Grd.RowCount - 1, Grd.ColCount - 1)
Offline
Thanks for pointing out and the solution. It seems missing boundary check, it should be fixed in next release.
Offline
This issue has been fixed and the new version now available for downloading: (v0.8.6.1)
http://reogrid.net/download/
Offline