Print Page | Close Window

Constraint

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=4238
Printed Date: 26 June 2024 at 1:32pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Constraint
Posted By: barianto
Subject: Constraint
Date Posted: 18 May 2006 at 3:19am
Column.EditOptions.Constraints.Add "", 0

second parameter constraint Add has to be long.
If i want to connect constraint with database, including data is coming from database which has type string (it got to be string) what is the solution??

eq.
       
        Column.EditOptions.Constraints.Add "Mercedez Baby Benz", "C001"

"C001" are code for "Mercedez Baby Benz"

In another word, how to keep another data into reportcolumn constrain other than "caption"?

I hope you understand with what i want, my english is really poor...



Replies:
Posted By: sserge
Date Posted: 18 May 2006 at 4:03am
Hi,


''''' define codes array
Dim sCodes(0 To 10) As String
''''' fill constraints with codes indexes
sCodes(0) = "C001"
Column.EditOptions.Constraints.Add "Mercedez", 0
sCodes(1) = "C002"
Column.EditOptions.Constraints.Add "Ford", 1
sCodes(2) = "C003"
Column.EditOptions.Constraints.Add "Audi", 2

Column.EditOptions.AddComboButton
''''' and then by constraint data (which is sCodes array index) you can get code string


--
WBR,
Serge




Posted By: barianto
Date Posted: 18 May 2006 at 6:58am
Thanks,

if my database are large, do you think it's will causing perfomance loss to my appplication? or will it break VB 64kb limit?




Posted By: sserge
Date Posted: 18 May 2006 at 7:41am
Not sure, it depends on amount of your codes, on how would you access them, etc.

To eliminate all possible performance losses which could raise with this solution, I can propose you one more way:
 - you create a new database table (or view) which will have all string codes listed with integer ID for every of them; table structure like "CodeID; CodeString"
 - then you just put an ID of your code in the constraint and load it every time when needed from the database in a very simple and fast query.

--
WBR,
Serge


Posted By: barianto
Date Posted: 18 May 2006 at 8:28am
Well before ask this forum i'm using  the method :), but it's really bother me to create new field just to overcome this matter.
But for a moment, i will stick with it.

Btw, sserge would you please take a look at my question in this sub forum with thread subject "DETECT ROW.ITEM" i really need "suitable" solution in matter otherwise application i make with reportcolumn object is look not so good at that matter.


Tks any way



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