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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Report Fields "lost" in record selection formula editor

Status
Not open for further replies.

paddydog

Technical User
Jun 4, 2003
22
0
0
GB
I want to use one my the report fields in record selection, but when I open the record selection formula editor, the field is not there. Some fields are and others have disappeared. This seems to have happened following my machine crashing. Is there any way I can retrieve / refresh what is shown? I've tried deleting the report fields and re-creating them but they don't appear either; can't type the formula directly either.

What's happened?
 
Try going under Database->Verify Database

If that fails, try Database->Set Location and repoint to the table(s).

This assumes that you used to have those fields available to formulas, keep in mind that CR 8.5 and below will not allow you to use fields longer than 254 in any formulas.

-k
 
Didn't work synapsevampire - thanks for the suggestion though...
 
Are these database fields or formula fields?

If they are database fields check the data type, they are probably BLOB or memo fields and are not allowed to be used in a record selection formula.

If they are formula fields, please post the formulas.



Software Sales, Training, Implementation and Support for Exact Macola, eSynergy, and Crystal Reports
 
To clarify dgillz post, it doesn't matter what the underlying data types are, the point is whether Crystal believes them to be capable of being over 254 characters.

If you open the Insert->Field Objects->Database Fields, doy see the field?

If so, then CR has determined that it cannot support the data type within a formula.

You can probably get around this by creating a View that CASTs the data type, or even does what you need in advance, or by using a SQL Expression within CR.

-k
 
Re. the field types: they are formulae. The one I want to use in particular pulls a shared variable from a sub-report and looks like this...

WHILEPRINTINGRECORDS;
SHARED STRINGVAR DIVISIONCODE;
DIVISIONCODE

and returns a string which looks like this: "R10-","R30-", etc. (the report is an aged debt report that I want to be able to split by the above string which is a "division" code).

However, what is confusing me further is that some formula fields are availebl to reord selection and not others, e.g., the formulae which work out the ageing...

This formaula fields IS available in the record selection window:

IF {@UNALLOCATED£} > 0 AND
{SL_TRANSACTIONS.ST_DATE} in Aged0To30Days Then {@UNALLOCATED£}
Else 0

But this one is NOT:

IF Sum ({@UNALLOCATED£}) > 0 AND
{SL_TRANSACTIONS.ST_DATE} in Aged31To60Days Then {@UNALLOCATED£}
Else 0

I can't see any difference...
 
Addition to my last post: when I re-read what I just posted I realised the second ageing formula was in fact different. I've changed it taking out the sum/array bit and it is now available for use in record selection (although I don't need it). I've tried browsing on the Division field data and it returns nothing, but does say the field length is 254 chars and is a string.

So, can anyone help now?

- synapsevampire: not sure what this means, "You can probably get around this by creating a View that CASTs the data type, or even does what you need in advance, or by using a SQL Expression within CR". Can you help further?

All help much appreciated...thanks
 
The reason you cannot see the formulas is that any formula evaluated whileprintingrecords cannot be used in a record selection formula.

On the second formula that is not available, it conntains a sum() operation, and would therefore be available in a GROUP selection formula, but not a record selection formula.

How are you linking your subreport? Perhaps there is a way to filter the records from the field(s) you are using to link your subreport to your main report?

Software Sales, Training, Implementation and Support for Exact Macola, eSynergy, and Crystal Reports
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top