Adding combo boxes to items in the report
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=4916
Printed Date: 21 November 2024 at 10:59pm Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com
Topic: Adding combo boxes to items in the report
Posted By: ryan4isu
Subject: Adding combo boxes to items in the report
Date 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"
|
Replies:
Posted By: sserge
Date 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
|
Posted By: ryan4isu
Date 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.
|
Posted By: sserge
Date 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
|
Posted By: ryan4isu
Date 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.
|
|