Using the Crystal Reports Picture function with a Parameter as the format

1.8k views Asked by At

I am trying to create a generic report that has a data field which needs to be displayed with a user defined format. The format is defined and stored in a configuration table, which I retrieve and pass into the report as a parameter.

I am not having any luck. When I try the formula below (and several other variations), the report prints with the format displayed first, and then the data appended to it, without the format applied. Does anyone have any suggestions?

WhileReadingRecords;
Local StringVar lsParcelNumber := {vRealEstateTaxBill.Parcel};

lsParcelNumber := Picture(lsParcelNumber, {?lsParcelFormat});

lsParcelNumber;
1

There are 1 answers

4
campagnolo_1 On BEST ANSWER

Not knowing too much about your report, I would give this a shot:

StringVar IsParcelNumber := Picture({vRealEstateTaxBill.Parcel}, {?lsParcelFormat});
IsParcelNumber

I don't know what your {?lsParcelFormat} looks like, but I would suggest if the above formula doesn't work to "spell" out the picture format (i.e. "(xxx) xxx-xxxx"). And you know that the WhileReadingRecords will apply the formula while reading the records. So if at all, you should try WhilePrintingRecords, but I would leave it out alltogether.