I need use a ReportControl with many records and then i want use VirtualMode of ReportControl.
My project is MDI and the ReportControl is loaded in a form child.
The problem is when i load and unload the child form several times. The first or second times ReportControl load fine, but in the 3ª load of the form when execute "ReportControl.Populate()" then error:
Now my code, RCClientes is a ReportControl and FrmClientesFichero is my child form.
Private Sub FrmClientesFichero_Load(sender As Object, e As EventArgs) Handles Me.Load
.PaintManager.CaptionFont.Name = "Tahoma"
.PaintManager.CaptionFont.Bold = True
.PaintManager.TextFont.Name = "Tahoma"
.PaintManager.UseAlternativeBackground = True
.PaintManager.AlternativeBackgroundColor = CUInt(RGB(242, 242, 242))
.PaintManager.FreezeColsDividerColor = CUInt(RGB(0, 0, 0))
.PaintManager.NoItemsText = "No hay elementos que mostrar"
.FullColumnScrolling = True
.AutoColumnSizing = False
.PaintManager.ShowNonActiveInPlaceButton = True
.ScrollModeH = XTPReportScrollMode.xtpReportScrollModeSmooth
.ScrollModeV = XTPReportScrollMode.xtpReportScrollModeSmooth
RCClientes.PaintManager.ColumnStyle = XTPReportColumnStyle.xtpColumnResource
RCClientes.AllowEdit = False
RCClientes.Columns.Add(COL_ID, "C. Cliente", 100, True)
RCClientes.Columns.Add(COL_RAZONSOCIAL, "Razón Social", 100, True)
RCClientes.Columns.Add(COL_NOMBRECOMERCIAL, "Nombre Comercial", 250, True)
RCClientes.Columns.Add(COL_CIF, "CIF / NIF", 60, True)
RCClientes.Columns.Add(COL_CP, "CP", 100, True)
RCClientes.Columns.Add(COL_POBLACION, "Población", 100, True)
RCClientes.Columns.Add(COL_PROVINCIA, "Provincia", 250, True)
RCClientes.Columns.Add(COL_TELEFONO, "Telefono", 60, True)
RCClientes.Columns.Add(COL_EMAIL, "Email", 100, True)
RCClientes.Columns.Add(COL_IBAN, "IBAN", 250, True)
RCClientes.Columns.Add(COL_ESTADO, "Estado", 60, True)
Dim ArrayProvincias As New ArrayList()
Dim Record As XtremeReportControl.ReportRecord
ArrayProvincias = ObtenerTodasLasProvincias()
Arrayclientes = ObtenerTodosLosClientes(ArrayProvincias)
RCClientes.SetVirtualMode(Arrayclientes.Count, 0)
Record = RCClientes.Records(0)