Remaining text does not appear to be part of the formula (1 Viewer)

charlesdu101

New member
Local time
Tomorrow, 03:02
Joined
Oct 23, 2006
Messages
3
Can someone please help

Im passing 3 parameters using the following syntax in Access 2002.

CrystalReport.ReportFileName = filename & ".rpt"
CrystalReport.parameterfields(0) = "StartDate;" & Format(dStart, "yyyy/mm/dd") & ";TRUE"
CrystalReport.parameterfields(1) = "EndDate;" & Format(dEnd, "yyyy/mm/dd") & ";TRUE"

I have done a msgbox in Access CrystalReport.parameterfields(0) for troubleshooting and the following is passed to crystal startdate;12/12/2006;TRUE

Within the Crystal report i have a simple formula field
called startdate which gets the values passed from Access and converts it into a date using the below function
DTStoDate(?startdate)

This report has been working fine and now on a different XP machine I get the error message

Error in formula <enddate>.
'DTStodate({?enddate})
'
The remaining text does not appear to be part of the formula.

I have then modified the Crystal report and taken out the DTStodate(?startdate) and DTS(?enddate) formula fields and the report works. So somehow Crystal is not understanding this function. However I need these parameter fields.

I have checked the reference libraries and none are reported missing, also i have registered the following DLLs

o Crystl32.ocx
o Mscomct2.ocx
o Comcat.dll
o Crpaig.dll
o Crpe32.dll
o Implode.dll
o Olepro32.dll
o P2bdao.dll
o Crviewer.dll


Does anyone know what is missing as it is working fine on alot off machines. Only thing that has changed recently is I upgraded the Reports interface from 97 to 2002, however other machines are working perfectly on 2002. Iam using Crystal 7.0.

thanks
 

Kempes

Registered User.
Local time
Today, 20:02
Joined
Oct 7, 2004
Messages
327
I would check the dll's again. I'm guessing the report requires a dll that isn't registered on this particular PC.

I had the same problem with dates, which was solved by registering the dll's.
 

boblarson

Smeghead
Local time
Today, 12:02
Joined
Jan 12, 2001
Messages
32,059
In Crystal Reports, the ";" (semi-colon) denotes the end of a standalone part of the formula, which means that if you have something like:
WhilePrintingRecords;
DTStodate({?enddate});

The semi-colon denotes the end of each part of that formula. When you are using "'DTStodate({?enddate})" the enddate portion of it is passing
enddate;12/12/2006;TRUE
Which means that the formula within Crystal is reading that as 3 distinct formula pieces and they aren't. I think you want it to pass
enddate,12/12/2006,TRUE (with commas and not with semi-colons) if they are arguments of the function DTStodate.
 

Users who are viewing this thread

Top Bottom