Print Page | Close Window

Merge Cells in Child row manually is not possible?

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=19093
Printed Date: 13 July 2025 at 6:14pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Merge Cells in Child row manually is not possible?
Posted By: chc_gpi
Subject: Merge Cells in Child row manually is not possible?
Date Posted: 20 October 2011 at 5:05am
Hi,

I use CodeJock Xtreme SuitePro (ActiveX) 15.1.3 - Report Control.

When i try to merge cells in a Child row, i have an error -2147417848 ( 80010108 ) on Records.MergeItems. It seems merging cells on child is not possible.


But if i don't create child, just simple records, merge column 1 & 2 on line 0, and sort by dragging column 0, the result is there :


! CodeJock can do it !




Anyone have a idea, please ?
How can i do ?

Thanks for any help, it's very important for our app !


My code :

Option Explicit
Private Sub Form_Load()

    Dim Column As ReportColumn
    Set Column = wndReportControl.Columns.Add(0, "Zero", 40, True)
   
    ' Manual Treeview
    Column.TreeColumn = True
   
    Set Column = wndReportControl.Columns.Add(1, "Un", 40, True)
    Set Column = wndReportControl.Columns.Add(2, "Deux", 40, True)
    Set Column = wndReportControl.Columns.Add(3, "Trois", 40, True)
     
    wndReportControl.PaintManager.HorizontalGridStyle = xtpGridSolid
    wndReportControl.PaintManager.VerticalGridStyle = xtpGridSolid
    wndReportControl.PaintManager.GridLineColor = &H80000012
   
    wndReportControl.PaintManager.AllowMergeCells = True
       
    Dim Record     As ReportRecord
    Dim RecordPere As ReportRecord
  
    Set RecordPere = wndReportControl.Records.Add()
    RecordPere.AddItem "Texte Ligne 0 Colonne 0"
    RecordPere.AddItem "Texte Ligne 0 Colonne 1"
    RecordPere.AddItem "Texte Ligne 0 Colonne 2"
    RecordPere.AddItem "Texte Ligne 0 Colonne 3"
    wndReportControl.Records.MergeItems 0, 0, 1, 2
  
    ' Manual Treeview
    Set Record = RecordPere.Childs.Add
       
    ' Auto Treeview
    ' Set Record = wndReportControl.Records.Add()
   
    Record.AddItem "Texte Ligne 1 Colonne 0"
    Record.AddItem "Texte Ligne 1 Colonne 1"
    Record.AddItem "Texte Ligne 1 Colonne 2"
    Record.AddItem "Texte Ligne 1 Colonne 3"
    
    wndReportControl.Records.MergeItems 1, 1, 1, 2
  
    ' Auto Treeview
    ' wndReportControl.GroupsOrder.Add wndReportControl.Columns(0)
    ' wndReportControl.GroupsOrder(0).SortAscending = True
  
    wndReportControl.Populate
    wndReportControl.Redraw
End Sub





Replies:
Posted By: Aaron
Date Posted: 04 November 2011 at 8:04am
Hi,
 
A child 'record' isn't really a record at least not in the wndReportControl.Records collection. 
   
    wndReportControl.Populate
    wndReportControl.Redraw
    
    Debug.Print Me.wndReportControl.Records.Count 'Will be 1
 
If you need a child to be merged you have to address the childs of a particular record of the .Records collecion.
 
[...]
' Manual Treeview
    Set Record = RecordPere.Childs.Add
       
    ' Auto Treeview
    ' Set Record = wndReportControl.Records.Add()
   
    Record.AddItem "Texte Ligne 1 Colonne 0"
    Record.AddItem "Texte Ligne 1 Colonne 1"
    Record.AddItem "Texte Ligne 1 Colonne 2"
    Record.AddItem "Texte Ligne 1 Colonne 3"
    
    'In this case Records(0) is the only record in collection and you need to merge the childs of this record
    wndReportControl.Records(0).Childs.MergeItems 0, 0, 1, 2
   
    wndReportControl.Populate
    wndReportControl.Redraw
   
    Debug.Print Me.wndReportControl.Records.Count
    Debug.Print Me.wndReportControl.Records(0).Childs.Count
 
 
 
Hope this helps... 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....



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