Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

formula problems 1

Status
Not open for further replies.

ktighe

Programmer
May 25, 2001
45
0
0
US
I'm having a problem with Crystal Reports. I'm using version 7. I'm trying to make a report from a ms access 2000 database. Specifically, I'm having trouble making a formula. I can insert any field I want in the report, but when I try to build my formula, CR won't let me use any fields from the table in the formula. The table doesn't have a primary key, but I've tried making one through ms access (autonumber), and CR would let me use the autonumber field in the formula, but nothing else. Does anyone know why this is? Any help would be greatly appreciated.
Kevin

 
Hi Ktighe

Are you trying to linking tables, and having an issue also? I had a similar problem which gave me an 'invalid link' error msg (which made reference to being unable to see any indexed fields). To resolve go to file|options. Select the SQL tab and ensure SYNONYMS box (bottom left of screen) is checked.

HTH

JD
 
What is the error?
What is the formula?
When does the problem occur? Ken Hamady
On-site custom Crystal Reports Training and Consulting.
Quick Reference Guide to using Crystal in VB.
 
The database has linked tables, but I don't need to use any of them in my formula. I only want to use one table from the database, and it's a native access table. The access database has no joined tables (nothing under the 'relationships' view). When I try to manually type in the field in a formula I get an error that says blob fields or memo fields cannot be used in a formula. What is a blob field? All the fields I need to use are text fields.
My formula is pretty simple: I just need to check if a field is null, and if so, check another field to see if it's a 'y' or a 'n'.

Kevin
 
Check the data type of each field you are using and then see the FAQ on Memo fields.

A memo field is a text field with no lenght limit. These cannot be used in formulas, except with the IsNull() function. Ken Hamady
On-site custom Crystal Reports Training and Consulting.
Quick Reference Guide to using Crystal in VB.
 
Ken,

Thanks for your help. This seems to be the problem. All of the fields I was trying to use were of size 255 (the max, I think). I reduced all of the sizes for my fields, but cr would only let me use one of the fields: a text field with a length of 10. The other fields (with lengths from 50-150) could not be used. There appears to be a size limit here, but I don't know what it is. Do you happen to know it? Also, I could not find the memo field faq. Could you point me in the right direction? Thanks again.

Kevin
 
I got my problem fixed: I made all of the text fields smaller yet, and now I can use them all in a cr formula. I still don't know what the cutoff is, but it seems to be around 200.....


Kevin
 
The limit is 254 in all instances that I have seen. This is the limit of a field CR is using, and it is the maximum output string of a formula field. Ken Hamady
On-site custom Crystal Reports Training and Consulting.
Quick Reference Guide to using Crystal in VB.
 
Hello,

I'm running CR 8.5 and using VB6.0 as front end application. I'm trying to pass a string from VB into a formula field in CR. The following is what i have so far.

Dim fldFormulaFields As CRAXDRT.FormulaFieldDefinitions
Dim fldFormulaField As CRAXDRT.FormulaFieldDefinition
Dim DeviceDescription as string

Report.Database.AddADOCommand DB2Connection, DB2Command
Set fldFormulaFields = Report.FormulaFields
Set fldFormulaField = fldFormulaFields.Item(1)
fldFormulaField.Text = DeviceDescription

My problem is everytime i run the program i get error saying the remaining text doesn't appear to be part of the formula. DeviceDescription is read from an INI file so it's gotta be a string. How do i pass this in into CR?

Please help anyone..

Thanks.
 
Please post this as a new question, not as a follow-up to an existing question. Ken Hamady, On-site/Phone Crystal Reports Training/Consulting
Quick Reference Guide to using Crystal in VB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top