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

Erroneous behaviour of Formula Fields

Status
Not open for further replies.

koushikdey79

Programmer
Oct 18, 2004
4
JP
We have one VC++6.0 GUI and one C++ Batch program. We launch the Crystal Report templates from GUI and offer the option for printing from there. The C++ batch also prints the reports at EOD without any display. We use Crystal Report APIs for printing and viewing both in GUI and C++ batch.
When printing is fired from GUI, we launch:
PEOutputToPrinter(m_jobHandle,nCopies) method. We set one Formula field @CopyNo with following code-
if(!p_CRPEJob ->SetFormula("CopyNo", oParam)) and in SetFormula, we use
PESetFormula(m_jobHandle,(_TCHAR *)formulaName,(_TCHAR *)formulaText)

Exactly similar piece of codes exists in our C++ batch program as well and both the GUI code and Batch code has been compiled in same machine with same libraries.

But while printing the report from GUI the reports are printed correctly with the formula field getting properly set, but in batch, the formula field is not getting set, and it is taking a default value of 1 in CopyNo.
We are using CR8 and the CRPE32.dll version is 8.0.0.371.
We have Sybase 12.5 database and GUI connects through ODBC while batch through Sybase DB library.
Can anyone please help? This is strange problem and we are stuck up for long.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top