SOLVED: Change ReportRecordItem through code |
Post Reply |
Author | |
rplp4
Groupie Joined: 18 May 2008 Status: Offline Points: 31 |
Post Options
Thanks(0)
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 |
|
Aaron
Senior Member Joined: 29 January 2008 Status: Offline Points: 2192 |
Post Options
Thanks(0)
|
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.... |
|
rplp4
Groupie Joined: 18 May 2008 Status: Offline Points: 31 |
Post Options
Thanks(0)
|
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.
|
|
Aaron
Senior Member Joined: 29 January 2008 Status: Offline Points: 2192 |
Post Options
Thanks(0)
|
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.... |
|
rplp4
Groupie Joined: 18 May 2008 Status: Offline Points: 31 |
Post Options
Thanks(0)
|
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? |
|
Aaron
Senior Member Joined: 29 January 2008 Status: Offline Points: 2192 |
Post Options
Thanks(0)
|
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.... |
|
rplp4
Groupie Joined: 18 May 2008 Status: Offline Points: 31 |
Post Options
Thanks(0)
|
Yes that is it
THANK YOU
|
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |