Print Page | Close Window

SOLVED: Change ReportRecordItem through code

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=11267
Printed Date: 21 November 2024 at 6:50pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: SOLVED: Change ReportRecordItem through code
Posted By: rplp4
Subject: SOLVED: Change ReportRecordItem through code
Date Posted: 01 July 2008 at 9:44am
I have been using MSFlexGrid and would like to use the report control.   I have populated the report control.   I can not know how to edit a cell through code.   Will you please show how I can do the same as below code with the report control.
 
 
Dim i, e As Integer
For i = 1 To MSFlexGrid1.Rows - 1
    For e = 0 To MSFlexGrid1.Cols - 1
        SaveData = SaveData & MSFlexGrid1.TextMatrix(i, e) & ","
    Next e
    If MSFlexGrid1.TextMatrix(i, 4) = "1" Then
        MSFlexGrid1.TextMatrix(i, 4) = "2"
    End If
Next i


-------------
Product: Xtreme SuitePro (ActiveX) version 12.0.0
Platform: Vista (64bit) - SP 2
Language: Visual Basic 6.0



Replies:
Posted By: Aaron
Date Posted: 01 July 2008 at 10:50am

Hi,

Set wndReportControl.AllowEdit = True

and use these events to change the data 
 
Private Sub wndReportControl_InplaceEditChanging(ByVal Row As XtremeReportControl.IReportRow, ByVal Column As XtremeReportControl.IReportColumn, ByVal Item As XtremeReportControl.IReportRecordItem, NewValue As String, Cancel As Boolean)

End Sub

Private Sub wndReportControl_ValueChanged(ByVal Row As XtremeReportControl.IReportRow, ByVal Column As XtremeReportControl.IReportColumn, ByVal Item As XtremeReportControl.IReportRecordItem)

End Sub

Private Sub wndReportControl_ValueChanging(ByVal Row As XtremeReportControl.IReportRow, ByVal Column As XtremeReportControl.IReportColumn, ByVal Item As XtremeReportControl.IReportRecordItem, NewValue As Variant, Cancel As Boolean)

End Sub



-------------
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: rplp4
Date Posted: 01 July 2008 at 2:12pm
Thank you, but how do I use the events to change the cell value?   It looks like the events will let me know when the user is changing a value.


Posted By: Aaron
Date Posted: 01 July 2008 at 3:31pm
Hi,
 
wndReportControl.FocusSubItems = True > you can see which cell is focused
wndReportControl.AllowEdit = True > allow editing ReportRecordItems
wndReportControl.EditOnClick = True > single click = editmode
wndReportControl.EditOnClick = False > double click = editmode
and use the events when value changes
 
       
 


-------------
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: rplp4
Date Posted: 01 July 2008 at 4:44pm

I am not sure I understand or I have not explained what I would like to do.   I do not what to edit the cell with a mouse click or when it has focus.   I what to make the change when a command button is clicked.   The user is not entering anything in to the control.

How can I loop through the cells as in the MSFlexGrid example above?



Posted By: Aaron
Date Posted: 02 July 2008 at 1:10am
Hi,
 
You want to loop through the records? Why don't you say that in the first place
 
MSFlexGrid:
 
Dim i, e As Integer
For i = 1 To MSFlexGrid1.Rows - 1
    For e = 0 To MSFlexGrid1.Cols - 1
        SaveData = SaveData & MSFlexGrid1.TextMatrix(i, e) & ","
    Next e
    If MSFlexGrid1.TextMatrix(i, 4) = "1" Then
        MSFlexGrid1.TextMatrix(i, 4) = "2"
    End If
Next i
 
 
ReportControl:
 
    Dim recordRow As XtremeReportControl.ReportRecord
    Dim recordCol As XtremeReportControl.ReportRecordItem
    Dim SaveData As String
   
    For Each recordRow In wndReportControl.Records
        For Each recordCol In recordRow
            If recordRow(4).Caption = "1" Then
                recordRow(4).Caption = "2"
            End If
            SaveData = SaveData & recordRow(recordCol.Index).Caption & ","
        Next recordCol
    Next recordRow
   
    wndReportControl.Populate 'if changes have been made to records, update ReportControl. You must in order to see the changes
 
 
 


-------------
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: rplp4
Date Posted: 02 July 2008 at 4:23pm
Yes that is it
THANK YOU



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