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

Need help with a formula to print fields in a horizontal fashion. 1

Status
Not open for further replies.

ausmoran

MIS
Apr 8, 2001
157
US
I am using CR version 9 with SQL 2000 in a .NET application. Everything works fine except that the formula that I am using to list the articles that have been allegedly violated are being listed TWICE in the text (in the following REPORT FOOTER a).

I am using the following two formulas in a subreport in an effort to include the field contents of the field, tblArticles.ArticleNumber, in a simple sentence within a paragraph (for example: John Smith has allegedly violated article(s) 5, 6, 8 of the code of ethics manual.)

Let me try to describe the subreport as follows:
REPORT HEADER a: suppressed
REPORT HEADER b: suppressed but with the following fields:
articles
complainant
respondent
@complainant
@respondent
DETAILS: suppressed but with the formula @articles
REPORT FOOTER a: Text as follows: "This hearing has been established to consider the complaint of {@comp} against {@Resp} alleging violation of {@Art} of the Code Of Ethics Manual.

Here are the formulas that I am using:

Code:
(@Art is as follows:) 
WhilePrintingRecords;
StringVar Art

(@Articles is as follows:)
WhilePrintingRecords;
StringVar Art;
Art:=Art+{tblArticles.ArticleNumber}+",";
Thanks in advance for any help that you might be able to offer.

Austin

 
where are these formulas placed?

Software Sales, Training, Implementation and Support for Macola, eSynergy, and Crystal Reports

"making predictions is tough, especially about the future" - Yogi Berra
 
Try changing {@Articles} to:

WhilePrintingRecords;
StringVar Art;
if instr(Art,{tblArticles.ArticleNumber}) = 0 then
Art:=Art+{tblArticles.ArticleNumber}+",";

Change your display formula to:

WhilePrintingRecords;
StringVar Art;
left(Art,len(Art)-1)

...to eliminate the last comma.

-LB


 
Thanks very much for taking the time to help me out with the problems in my formulas! I really appreciate your help!

- Austin
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top