Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Report Control
  New Posts New Posts RSS Feed - ReportControl in VirtualMode, Access Violation
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

ReportControl in VirtualMode, Access Violation

 Post Reply Post Reply
Author
Message
sintra@sintra-sl.es View Drop Down
Newbie
Newbie


Joined: 07 April 2015
Status: Offline
Points: 8
Post Options Post Options   Thanks (0) Thanks(0)   Quote sintra@sintra-sl.es Quote  Post ReplyReply Direct Link To This Post Topic: ReportControl in VirtualMode, Access Violation
    Posted: 17 July 2018 at 5:01am
Hi, i'm working with VB.Net 17 and Codejock 18.0 ActiveX

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:
"'System.AccessViolationException' en mscorlib.dll"

Any suggestion??

Thanks

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

        With RCClientes
            .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

            .FocusSubItems = False
            .PaintManager.ShowNonActiveInPlaceButton = True

            .ScrollModeH = XTPReportScrollMode.xtpReportScrollModeSmooth
            .ScrollModeV = XTPReportScrollMode.xtpReportScrollModeSmooth

            .AllowSort = False
            .Records.DeleteAll()
            .Columns.DeleteAll()

            .Populate()
            .Navigator.MoveLastRow()
        End With

        '''''''''''
        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)
        Record.AddItem("")
        Record.AddItem("")
        Record.AddItem("")
        Record.AddItem("")
        Record.AddItem("")
        Record.AddItem("")
        Record.AddItem("")
        Record.AddItem("")
        Record.AddItem("")
        Record.AddItem("")
        Record.AddItem("")

        Record.AddItem("")

        RCClientes.Populate()
    RCClientes.SetCustomDraw(XtremeReportControl.XTPReportCustomDraw.xtpCustomBeforeDrawRow)
        ''''''''''

    End Sub

Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down



This page was generated in 0.094 seconds.