I have written a number of reports recently on Crystal XI R1 which work fine however one report errors when I run it on the Crystal Viewer I've written. The viewer was written in Visual Studio 2005 but incorporating the appropriate EmbeddedReporting merge module. The error is as follows:
Error in Formula <detailLines>
'Whileprintingrecords;
'
A number, currency, amount, boolean, date, time, date-time or sting is expected here.
This formula is one of three that calculate the length or records so that page breaks are correctly thrown. The formulas as as follows:
<PageLines>
//reset page length
whileprintingrecords;
shared numbervar size := 0;
<grouplines>
//calculates header
whileprintingrecords;
shared numbervar size;
size := size + 0.91;
<detailLines>
//the height of two fields are calculated based on characters per line * //height per line
whileprintingrecords;
shared numbervar size;
size := size + 2.74;
size := size + ceiling(length({DCApr.Proposal})/95) * 0.63;
size := size + ceiling(length(
{@agents})/95) * 0.63;
The value of size is then used to control the group header's New Page Before formula as follows:
whileprintingrecords;
shared numbervar size;
24.7 - size <= 6;
i.e if page length - size is <= 6 throw a page break.
I suspect there is a problem with the formula but I would appreciate advice as to why the viewer is erroring since it uses the same dll versions as Crystal XI. It also uses the CRRedist2005_x86.msi package that is part of VS 2005.
Thanks
Chris