?
Solved

Crystal Error in C# application due to crystal Reports formula

Posted on 2006-03-22
2
Medium Priority
?
2,691 Views
Last Modified: 2011-09-20
Hi All,
I am placing this question in this area because the crystal problem is occuring in our application even though the formula shows "No errors found" in the crystal formula wizard.  We are using Visual Studio 2003 and Crystal Reports 10.0.  We are passing data to Crystal using an XSD.  I should note that without the Formula fields, the report displays properly in the application.  

However, when I create a formula and add it to the report, I get an error message.

The formula:

tringVar BillByName :="";
StringVar BillByAddress1 :="";
StringVar BillByAddress2 :="";
StringVar BillByCity :="";
StringVar BillByRegionCode :="";
StringVar BillByPostalCode :="";
StringVar BillByCountryCode :="";

if {InvoiceHeader.DivisonName} <> "" then BillByName = ({InvoiceHeader.DivisonName} + chr(13) + chr(10));

if {InvoiceHeader.RemitAddress1} <> "" then BillByAddress1 = {InvoiceHeader.RemitAddress1} + chr(13) + chr(10);
if {InvoiceHeader.RemitAddress2} <> "" then BillByAddress2 = {InvoiceHeader.RemitAddress2} + chr(13) + chr(10);
if {InvoiceHeader.RemitCity} <> "" then BillByCity = {InvoiceHeader.RemitCity} + ", ";
if {InvoiceHeader.RemitRegionCode} <> "" then BillByRegionCode = {InvoiceHeader.RemitRegionCode} + "  ";
if {InvoiceHeader.RemitPostalCode} <> "" then BillByPostalCode = {InvoiceHeader.RemitPostalCode};

BillByName + BillByAddress1 + BillByAddress2 + BillByCity + BillByRegionCode + BillByPostalCode;


The Error message that I receive is as follows
The Field name is not known.
Details: errorKind
Error in File c:\Program name\Invoice.rpt
Error in formula <BilledBy>
'StringVar BillByName :="";
'
The field name is not known.
Details: errorKind

Crystal Reports says that the formula is ok inside of the CRW.  Also the Error in formula seems to always be the first line of the formula.

Any help would be greatly appreciated.

Scott
0
Comment
Question by:smpross
2 Comments
 
LVL 3

Accepted Solution

by:
newood earned 1500 total points
ID: 16258640
If it's getting field name not know it's likely erroring on the {InvoiceHeader.RemitAddress1} portion of the formula.  Make sure that you can find the right data source in your program or that it is defined properly.  When you open it up in crystal that ODBC connection is embedded within the report so it may work just fine.  Make sure your program is looking at the same source.
0
 

Author Comment

by:smpross
ID: 16258710
Newood,
When I put those fields into the report individually, they appear without any problem even when I run the application... Any other idesas?

Thanks for the suggestion.

Scott
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
Hello there! As a developer I have modified and refactored the unit tests which was written by fellow developers in the past. On the course, I have gone through various misconceptions and technical challenges when it comes to implementation. I would…
Screencast - Getting to Know the Pipeline
As many of you are aware about Scanpst.exe utility which is owned by Microsoft itself to repair inaccessible or damaged PST files, but the question is do you really think Scanpst.exe is capable to repair all sorts of PST related corruption issues?

807 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question