Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Report Control
  New Posts New Posts RSS Feed - SOLVED: Change ReportRecordItem through code
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

SOLVED: Change ReportRecordItem through code

 Post Reply Post Reply
Author
Message
rplp4 View Drop Down
Groupie
Groupie


Joined: 18 May 2008
Status: Offline
Points: 31
Post Options Post Options   Thanks (0) Thanks(0)   Quote rplp4 Quote  Post ReplyReply Direct Link To This Post Topic: SOLVED: Change ReportRecordItem through code
    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
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: 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....
Back to Top
rplp4 View Drop Down
Groupie
Groupie


Joined: 18 May 2008
Status: Offline
Points: 31
Post Options Post Options   Thanks (0) Thanks(0)   Quote rplp4 Quote  Post ReplyReply Direct Link To This Post 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.
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: 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....
Back to Top
rplp4 View Drop Down
Groupie
Groupie


Joined: 18 May 2008
Status: Offline
Points: 31
Post Options Post Options   Thanks (0) Thanks(0)   Quote rplp4 Quote  Post ReplyReply Direct Link To This Post 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?

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: 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....
Back to Top
rplp4 View Drop Down
Groupie
Groupie


Joined: 18 May 2008
Status: Offline
Points: 31
Post Options Post Options   Thanks (0) Thanks(0)   Quote rplp4 Quote  Post ReplyReply Direct Link To This Post Posted: 02 July 2008 at 4:23pm
Yes that is it
THANK YOU
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.188 seconds.