Print Page | Close Window

VirtualList Mode Problems

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Report Control
Forum Description: Topics Related to Codejock Report Control
URL: http://forum.codejock.com/forum_posts.asp?TID=17256
Printed Date: 03 June 2024 at 6:16am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: VirtualList Mode Problems
Posted By: MottoDoki
Subject: VirtualList Mode Problems
Date Posted: 16 September 2010 at 5:38am

Hello everyone,

I'm a little newbie in using this control, i have done research inside this forum but doesn't find any answers.
I don't find a lot of information about SetVirtualMode option and samples are not very helpfull.

So here is my problem :
I would like to have a checkbox on one editable column and a format number on a non editable column


For the format column i am using sample from this web page
http://manpagesfr.free.fr/man/man3/printf.3.html

My exemple is really simple using codejock 13.4.0, 1 form with 1 reportcontrol only Here the code :

Option Explicit

Private Const COLONNE_TEXT = 0
Private Const COLONNE_AMOUNT = 1
Private Const COLONNE_CHECKBOX = 2

Private Declare Function InitCommonControls Lib "Comctl32.dll" () As Long

Private Sub Form_Initialize()
    InitCommonControls
End Sub

Private Sub Form_Load()


    RPList.Columns.DeleteAll
    RPList.Records.DeleteAll
    
    RPList.AllowColumnSort = True
    RPList.AllowEdit = True
    RPList.EditOnClick = True
    
    Dim RPColumn As ReportColumn


    Set RPColumn = RPList.Columns.Add(COLONNE_TEXT, "COLONNE_TEXT", 100, True)
    RPColumn.Editable = False
    Set RPColumn = RPList.Columns.Add(COLONNE_AMOUNT, "COLONNE_AMOUNT", 100, True)
    RPColumn.Editable = False
    RPColumn.Alignment = xtpAlignmentRight
    Set RPColumn = RPList.Columns.Add(COLONNE_CHECKBOX, "COLONNE_CHECKBOX", 100, False)
    RPColumn.Editable = True
    RPColumn.Alignment = xtpAlignmentIconCenter
    
    InitDataListe
    
    RPList.CreateIconViewAndRowNumberColumn

    RPList.SetCustomDraw xtpCustomBeforeDrawRow

    RPList.PaintManager.FreezeColsDividerColor = RGB(150, 150, 20)
    RPList.PaintManager.FreezeColsDividerStyle = RPList.PaintManager.FreezeColsDividerStyle Or xtpReportFreezeColsDividerBold

    RPList.Redraw

End Sub

Private Sub InitDataListe()

RPList.SetVirtualMode 15000
RPList.Populate

End Sub

Private Sub RPList_BeforeDrawRow(ByVal Row As XtremeReportControl.IReportRow, _
               ByVal Item As XtremeReportControl.IReportRecordItem, _
               ByVal Metrics As XtremeReportControl.IReportRecordItemMetrics)

    Select Case Item.Index
       
        Case COLONNE_TEXT
            Metrics.Text = "COLONNE_TEXT"
       
     
        Case COLONNE_AMOUNT
            Item.Format = "%aq.2f"
            Metrics.Text = "10214.12"
            
        Case COLONNE_CHECKBOX
            If Not Item.HasCheckbox Then
               Item.HasCheckbox = True
               Item.Editable = True
               Item.TristateCheckbox = False
               Item.CanEditCheckboxItem = False
            End If
    
    End Select

End Sub

When i click on the checkbox all the column has the checkbox check and my amount is never formatted but it should be like this in output : 10 214.12

Can anyone help me to figure what is the problem, there must be something i missed ?

Thank You






Replies:
Posted By: Aaron
Date Posted: 21 September 2010 at 8:27am
Hi,
 
I have to ask you this first: Do you load LOTS of data? (LOTS= >100000 records)
In Virtualmode you have only ONE record and data is filled dynamically (in BeforeDrawRow event)from external data (like array or recordset) BeforeDrawRow event will fire for every single item (cell) and you have to set the data ready to fill it dynamically.   
 
Do you load LOTS of data? (LOTS= >100000 records)
  • No? Do not use Virtualmode for this. If you load just a "few" records (<100000) just add records one at a time and you are (still) able to do lots of tricks with ReportControl.  
  • Yes? You cannot just use a checkbox (like you did), cannot edit cells etc.etc.
 
If you think it takes a lot of time to load 100000 records (4 columns)? Takes about 1 second... If you are still interested, please let me know Wink
 
 
 
 
 
 


-------------
Product: Xtreme SuitePro (ActiveX) version 15.0.2
Platform: Windows XP (32bit) - SP 2
Language: Visual Basic 6.0

Zero replies is not an option....


Posted By: MottoDoki
Date Posted: 22 September 2010 at 9:58am
Hello,

Thank you for your answer, you right i don't think i will have more than 20 000 row, i'm going to do more test with big fill.





Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net