Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Task Panel
  New Posts New Posts RSS Feed - TaskPanel with ReportControl
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

TaskPanel with ReportControl

 Post Reply Post Reply
Author
Message
AndyWilton View Drop Down
Groupie
Groupie
Avatar

Joined: 03 June 2008
Status: Offline
Points: 82
Post Options Post Options   Thanks (0) Thanks(0)   Quote AndyWilton Quote  Post ReplyReply Direct Link To This Post Topic: TaskPanel with ReportControl
    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
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: 22 May 2009 at 10:04am
Hi,
 
 
 
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
Xander75 View Drop Down
Senior Member
Senior Member
Avatar

Joined: 26 April 2007
Status: Offline
Points: 353
Post Options Post Options   Thanks (0) Thanks(0)   Quote Xander75 Quote  Post ReplyReply Direct Link To This Post 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?
Back to Top
Xander75 View Drop Down
Senior Member
Senior Member
Avatar

Joined: 26 April 2007
Status: Offline
Points: 353
Post Options Post Options   Thanks (0) Thanks(0)   Quote Xander75 Quote  Post ReplyReply Direct Link To This Post 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:



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.172 seconds.