Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Report Control
  New Posts New Posts RSS Feed - Adding combo boxes to items in the report
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Adding combo boxes to items in the report

 Post Reply Post Reply
Author
Message
ryan4isu View Drop Down
Newbie
Newbie


Joined: 29 August 2006
Location: United States
Status: Offline
Points: 4
Post Options Post Options   Thanks (0) Thanks(0)   Quote ryan4isu Quote  Post ReplyReply Direct Link To This Post Topic: Adding combo boxes to items in the report
    Posted: 29 August 2006 at 3:19pm
Is there any way to add a combo box with different items to each row in the report control?  I am trying to use the EditOptions object in the ReportRecordItem class but it does not seem to exist on the ReportRecordItem.  Here is an example of the code that I am writing:

    Dim oRecord As ReportRecord
    Dim oItem As ReportRecordItem

    Set oRecord = moFormApp.rptWorkflowData.Records.Add()
    Set oItem = oRecord.AddItem(vbNullString)
    Call oItem.EditOptions.Constraints.Add("first item", 1)

-> results in error: "Object variable or With block variable not set"

If I try to set the create a new ReportRecordItemEditOptions object I also receive an error.

    Set oItem.EditOptions = New ReportRecordItemEditOptions

-> results in error: "ActiveX component can't create object"
   
   
Back to Top
sserge View Drop Down
Moderator Group
Moderator Group


Joined: 01 December 2004
Status: Offline
Points: 1297
Post Options Post Options   Thanks (0) Thanks(0)   Quote sserge Quote  Post ReplyReply Direct Link To This Post Posted: 29 August 2006 at 4:41pm
Before accessing EditOptions property for an item you should call CreateEditOptions -- it initializes further customization. Then access it as regular EditOptions property.

--
WBR,
Serge
Back to Top
ryan4isu View Drop Down
Newbie
Newbie


Joined: 29 August 2006
Location: United States
Status: Offline
Points: 4
Post Options Post Options   Thanks (0) Thanks(0)   Quote ryan4isu Quote  Post ReplyReply Direct Link To This Post Posted: 29 August 2006 at 5:38pm
Thank you for the tip, I am now able to load the combo boxes exactly how I want.  My problem now is that the text doesn't change when I select a new value from the combo box.  I would also like to be able to add logic to the event that occurs when this value is changed.
Back to Top
sserge View Drop Down
Moderator Group
Moderator Group


Joined: 01 December 2004
Status: Offline
Points: 1297
Post Options Post Options   Thanks (0) Thanks(0)   Quote sserge Quote  Post ReplyReply Direct Link To This Post Posted: 31 August 2006 at 3:27pm
Text should change correctly, looks like the problem somewhere in your code. There should be something like:

    Item.CreateEditOptions
    Item.EditOptions.Constraints.Add "blablabla", someValue
    ...
    Item.EditOptions.ConstraintEdit = True
    Item.EditOptions.AddComboButton


Look at ValueChanged event.

In general, look at standard ReportSample application, TaskList form (menu Test / Task List sample). It shows how to handle all those things.

--
WBR,
Serge
Back to Top
ryan4isu View Drop Down
Newbie
Newbie


Joined: 29 August 2006
Location: United States
Status: Offline
Points: 4
Post Options Post Options   Thanks (0) Thanks(0)   Quote ryan4isu Quote  Post ReplyReply Direct Link To This Post Posted: 31 August 2006 at 6:18pm
I found out that the value was changing but the caption wasn't.  Thanks again for your help.
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.156 seconds.