Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Report Control
  New Posts New Posts RSS Feed - VirtualList Mode Problems
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

VirtualList Mode Problems

 Post Reply Post Reply
Author
Message
MottoDoki View Drop Down
Newbie
Newbie


Joined: 16 September 2010
Status: Offline
Points: 5
Post Options Post Options   Thanks (0) Thanks(0)   Quote MottoDoki Quote  Post ReplyReply Direct Link To This Post Topic: VirtualList Mode Problems
    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



Back to Top
Aaron View Drop Down
Senior Member
Senior Member
Avatar

Joined: 29 January 2008
Status: Offline
Points: 2192
Post Options Post Options   Thanks (0) Thanks(0)   Quote Aaron Quote  Post ReplyReply Direct Link To This Post 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....
Back to Top
MottoDoki View Drop Down
Newbie
Newbie


Joined: 16 September 2010
Status: Offline
Points: 5
Post Options Post Options   Thanks (0) Thanks(0)   Quote MottoDoki Quote  Post ReplyReply Direct Link To This Post 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.


Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.143 seconds.