on 10-17-2008 6:00 PM
Hello,
Is it possible to restrict the length of a text box in crystal reports 2008 based on a value from the database (say, datafield length : 20 characters) ?
Using the 'Size and position' dialog, it is possible to set the width of the text box; however, i am unsure what units CR uses in this dialog. Is it characters, pixels , twips, etc?
If table.fieldlength = 'short or 20 characters'
then width = X units
else width = Y units
Thanks for your help !
CR uses twips in the size and position.
1440 twips=1 inch
Regards,
Raghavendra
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks Raghavendra.
Do you know if there is a mapping between twips and 'characters' (typical units for database field lengths) ?
Fields in the field explorer come from the database, and can only be represented in characters; i need to set a conditional formula in the size and position dialog that reads the length of this field and accordingly limits the text box dimensions.
Any hints?
Thanks !
I think you need to try something like this
if you have any field from database then in the size and position use X+2 option and write the formula like this
1440*len() it may be a bigger in size but you need to figure out how much width it is taking for each character. May be you can get that by inserting a texbox and enter one character and adjust the size to fit perfectly without any space and see how much width it is taking. It may take for example 0.08 inch for each character. By using the formula like this 1440(0.08)len()
gives you the output.
I think there might be another solution but I hope this will help you to some extent.
I still don't understand why you want to do it for the text object as it is a databse field, you can directly drag that object on to the report then the option "Tight Horizontal" will be enabled and you can use it. If it is a static text then you can adujst the width of the textbox accordingly.
Regards,
Raghavendra
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.