PlusMinus Icon in Group |
Post Reply |
Author | |
JamGodz
Groupie Joined: 25 February 2010 Status: Offline Points: 67 |
Post Options
Thanks(0)
Posted: 22 September 2010 at 12:52am |
Hi Everyone! Good Day!
How do i display the plus minus icon in group header? below is my code to customize the RC. Private Sub Form_Load() rs.Open strSQL, ConnectTo.InternalConn, adOpenStatic, adLockOptimistic CustomizeRepCtrl If rs.RecordCount > 0 Then rs.MoveFirst: mdiMain.tpgFilter.Expanded = True: FillList End Sub Private Sub CustomizeRepCtrl() Dim Column As ReportColumn Set Column = wndList.Columns.Add(COLUMN_ICON_STATUS, "ICONSTATUS", 18, False) Column.Editable = False Column.Icon = COLUMN_BLACK_ICON Set Column = wndList.Columns.Add(COLUMN_TCODE, "HDA CODE", 50, True) Column.PlusMinus = True Column.Editable = False Set Column = wndList.Columns.Add(COLUMN_PLTRCODE, "Code", 50, True) Column.Editable = False 'Column.Icon = COLUMN_ICON_PLTR Set Column = wndList.Columns.Add(COLUMN_PLTRNAME, "Pltr Name", 200, True) Column.Editable = True Column.EditOptions.SelectTextOnEdit = True Set Column = wndList.Columns.Add(COLUMN_HDANAME, "Hda Name", 200, True) Column.Editable = True Column.EditOptions.SelectTextOnEdit = True With wndList .Icons.LoadBitmap App.Path & "\Components\bullet\Bullet-black16.png", COLUMN_BLACK_ICON, xtpImageNormal .Icons.LoadBitmap App.Path & "\Components\bullet\Bullet-red16.png", RECORD_RED_ICON, xtpImageNormal .Icons.LoadBitmap App.Path & "\Components\bullet\Bullet-blue16.png", RECORD_BLUE_ICON, xtpImageNormal .Icons.LoadBitmap App.Path & "\Components\bullet\Bullet-green16.png", RECORD_GREEN_ICON, xtpImageNormal .Icons.LoadBitmap App.Path & "\Components\bullet\Bullet-yellow16.png", RECORD_YELLOW_ICON, xtpImageNormal '.Icons.LoadBitmap App.Path & "\Components\bullet\UserBlue.png", RECORD_BLUE_ICON, xtpImageNormal .Icons.LoadBitmap App.Path & "\Components\bullet\PlantersBlack1.png", COLUMN_ICON_PLTR, xtpImageNormal With .PaintManager .ColumnStyle = xtpColumnOffice2007 .DrawGridForEmptySpace = True .VerticalGridStyle = xtpGridSmallDots .HorizontalGridStyle = xtpGridSmallDots End With End With End Sub Private Sub FillList() LoadData wndList, rs, "TCODE¦PLTR_CODE¦PLTR_NAME¦HDA_NAME¦PROGRESS", "PK", True, COLUMN_TCODE End Sub Private Sub LoadData(ByRef srcControl As XtremeReportControl.ReportControl, ByRef srcRS As Recordset, ByVal srcField As String, Optional srcHiddenField As String, Optional bGroup As Boolean, Optional ByVal srcGroupBy As Integer) Dim xtrmRCRecord As XtremeReportControl.ReportRecord, i As Integer, Item As ReportRecordItem sSplit() = Split(UCase(srcField), "¦") If srcRS.RecordCount < 1 Then Exit Sub srcRS.MoveFirst With srcControl If bGroup = True Then .GroupsOrder.DeleteAll: .Records.DeleteAll .CreateRowNumberColumn 30 .PaintManager.GroupRowTextBold = True .PaintManager.ShadeGroupHeadings = True .PaintManager.StartRecOrRowNumber = 1 End With Do While Not srcRS.EOF Set xtrmRCRecord = srcControl.Records.Add() For i = 0 To UBound(sSplit()) Set Item = xtrmRCRecord.AddItem(srcRS.Collect(sSplit(i))) If IsNull(Item.Value) Then Item.Value = Empty Next i If Len(srcHiddenField) > 0 Then xtrmRCRecord.Tag = srcRS.Collect(srcHiddenField) srcRS.MoveNext Loop If bGroup = True Then srcControl.GroupsOrder.Add srcControl.Columns.Find(srcGroupBy): srcControl.Columns.Find(srcGroupBy).Visible = False srcControl.Populate srcControl.SetCustomDraw xtpCustomBeforeDrawRow srcControl.Redraw End Sub Any help would be greatly appreciated.... |
|
Aaron
Senior Member Joined: 29 January 2008 Status: Offline Points: 2192 |
Post Options
Thanks(0)
|
Hi,
You want to switch visibility of some columns?
Following example will hide/show second colum:
With Me.wndReportControl
With .Columns With .Add(.Count, "Col 1", 100, True) .PlusMinus = True 'Show 'button' .NextVisualBlock = 1 'Meaning number of columns that toggles visibility after this column End With With .Add(.Count, "Col 2", 100, True) .... End With
End With
|
|
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.... |
|
JamGodz
Groupie Joined: 25 February 2010 Status: Offline Points: 67 |
Post Options
Thanks(0)
|
Hi Aaron...thank you for the replay...
Ive tried your code but still doesn't appear/display the plus/minus icon beside the planter name please refer attached file, of what i mean... Thanks... |
|
Aaron
Senior Member Joined: 29 January 2008 Status: Offline Points: 2192 |
Post Options
Thanks(0)
|
Hi,
OK, now I see what you mean
wndReportControl.PaintManager.Glyphs.Icons collection, just add your own icons with proper index.
Minus icon index = 0
Unlocked icon index = 10 There are two more icons: Sort ASC + Sort DESC (11+12)
note: I see no icon in front of the grouprow??? Did you remove them already?
|
|
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.... |
|
JamGodz
Groupie Joined: 25 February 2010 Status: Offline Points: 67 |
Post Options
Thanks(0)
|
Hello!
i haven't remove any icon... coz i don't know how to put an icon... pls.. show me some code on how to display the plus and minus icon... tnx.. |
|
Aaron
Senior Member Joined: 29 January 2008 Status: Offline Points: 2192 |
Post Options
Thanks(0)
|
Hi,
"Normally" it shows + / - icon already when records are grouped. See attached image
but you can try this:
Private Sub wndReportControl_BeforeDrawRow(ByVal Row As XtremeReportControl.IReportRow, ByVal Item As XtremeReportControl.IReportRecordItem, ByVal Metrics As XtremeReportControl.IReportRecordItemMetrics)
If Row.GroupRow Then If Row.Expanded = False Then Metrics.GroupRowIcon = 1 'PLUS icon, use your own index of the icon Metrics.GroupRowIconAlignment = xtpGroupRowIconBeforeText Else Metrics.GroupRowIcon = 2 'MINUS icon, use your own index of the icon Metrics.GroupRowIconAlignment = xtpGroupRowIconBeforeText End If 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.... |
|
JamGodz
Groupie Joined: 25 February 2010 Status: Offline Points: 67 |
Post Options
Thanks(0)
|
Hi Aaron... thank you the code works fine but the icon display not the minus/plus icon...
|
|
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 |