Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Report Control
  New Posts New Posts RSS Feed - Constraint
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Constraint

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

Joined: 01 May 2006
Location: Indonesia
Status: Offline
Points: 41
Post Options Post Options   Thanks (0) Thanks(0)   Quote barianto Quote  Post ReplyReply Direct Link To This Post Topic: Constraint
    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...
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: 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


Back to Top
barianto View Drop Down
Groupie
Groupie
Avatar

Joined: 01 May 2006
Location: Indonesia
Status: Offline
Points: 41
Post Options Post Options   Thanks (0) Thanks(0)   Quote barianto Quote  Post ReplyReply Direct Link To This Post 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?


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: 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
Back to Top
barianto View Drop Down
Groupie
Groupie
Avatar

Joined: 01 May 2006
Location: Indonesia
Status: Offline
Points: 41
Post Options Post Options   Thanks (0) Thanks(0)   Quote barianto Quote  Post ReplyReply Direct Link To This Post 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
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.188 seconds.