Print Page | Close Window

TaskPanel with ReportControl

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Task Panel
Forum Description: Topics Related to Codejock Task Panel
URL: http://forum.codejock.com/forum_posts.asp?TID=14363
Printed Date: 27 April 2024 at 5:01am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: TaskPanel with ReportControl
Posted By: AndyWilton
Subject: TaskPanel with ReportControl
Date Posted: 21 May 2009 at 3:52pm
Hi All,
 
I'm trying to add a ReportControl to an Item within a TaskPanel.
 
I'm using the SetHandle method and all works fine when the window opens.  You can expand and contract the group etc all fine, but as soon as you click on the ReportControl it moves to a location outside of the TaskPanel.
 
Any ideas?
 
Thanks in advance.
 
 
Andy


-------------
Product: Xtreme SuitePro (ActiveX) v11.2.1 -> v15.2.1
Platform: Windows XP / Vista / Win 7
Language: Clarion 5.5 -> C8.x
======================================
Andy Wilton



Replies:
Posted By: Aaron
Date Posted: 22 May 2009 at 10:04am
Hi,
 
Please, have a look at this post: https://forum.codejock.com/forum_posts.asp?TID=13460 - https://forum.codejock.com/forum_posts.asp?TID=13460
 
 


-------------
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: Xander75
Date Posted: 09 May 2010 at 8:47am
Hi Andy,

I know how to get the ReportControl into the TaskPanel without it moving back outside of the TaskPanel when clicked.

Add a PictureBox control and then place your ReportControl inside of this PictureBox. Next use the following code to attach this all to the TaskPanelGroup you wish.

Code:

    Dim Group As TaskPanelGroup
    Dim Item As TaskPanelGroupItem

    Set Group = TaskPanel.Groups.Add(1, "Group By")
    Group.Expanded = True

    Set Item = Group.Items.Add(1, "Test 1", xtpTaskItemTypeControl, 1)
    Set Item.Control = Picture1
    Item.SetSize 0, 0, True
    DoEvents

    ReportControl.Move 0, 0, Picture1.Width, Picture1.Height

My only issue now is to try and get the PictureBox to fit the TaskPanelGroupItem exactly! I have left the PictureBox border as black so you can see how this looks.

  

I have tried using Item.SetMargins which allows me to set the left & top position but I can't find how to get the height and width of the TaskPanelGroupItem. As you can see from above I have used Item.SetSize however this appears to autofit the control but with margins...

Does anyone know how to resolve this?


Posted By: Xander75
Date Posted: 09 May 2010 at 9:55am
I have since resolved this issue. I was using the SetSize and SetMargins incorrectly the first time I looked at this, after going away for a few minutes I realised how to resolve it... typical!!!

Code:

Private Sub CreateToolbox()
    Dim Group As TaskPanelGroup
    Dim Item As TaskPanelGroupItem

    Set Group = TaskPanel.Groups.Add(1, "Group By")
    Group.Expanded = True

    Set Item = Group.Items.Add(1, "Test 1", xtpTaskItemTypeControl, 1)
    Set Item.Control = Picture1
    Item.SetSize 0, 0, True            
    Item.SetMargins -8, -5, -8, -5  
End Sub

Private Sub Form_Resize()
    ' Resize the TaskPanel on Form Resize
    TaskPanel.Move TaskPanel.left, TaskPanel.top, TaskPanel.Width, Me.ScaleHeight - TaskPanel.top - 120

    ' Resize the rpcGroupBy ReportControl inside the PictureBox, the PictureBox gets resized automatically by the TaskPanel
    rpcGroupBy.Move 0, 0, picGroupBy.Width, picGroupBy.Height - 15
End Sub

Result:






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