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

Reporting on Notes

Status
Not open for further replies.

DaddyChris

Programmer
Feb 12, 2005
4
US
Database record has these fields:
ID CHAR
NEXTID CHAR
PREVID CHAR
GROUPID CHAR
NAME CHAR
NOTES1 CHAR
NOTES2 CHAR
NOTES3 CHAR
NOTES4 CHAR
NOTES5 CHAR
NOTES6 CHAR
NOTES7 CHAR
NOTES8 CHAR

I'm creating a report to display a note that spans multiple records, but each record will have the same GROUPID.

So far I have inserted a Group of GROUPID and I have one field with the formula totext({NOTES.NOTES1}) + totext({NOTES.NOTES2})...

The problem is if the note spans two records, only the text in the first record is displayed in the field. If the note spans three records, only the text in the first two records is displayed. It seems that the last record in the group is not being processed.

I am a new user of Crystal Reports 9.0, so If you have some advice, please add as much detail as possible.
 
I suggest that you first make sure that you are getting the correct records reported by removing the formula field from the report.
Do you then get the correct records listed for each group?
 
Can some of the NOTES fields have a null value? And do you test for it?

Having come to Crystal from mainframe languages, I got a 'cultural shock' when encountering null. It means 'no data': Mainframe languages mostly treat this as the same as zero.
It is actually a finer shade of meaning, the difference between 'Yes, we have no bananas' and 'I don't know how many bananas we have, it could be some, it could be zero'. In Crystal, the entry is 0 or null and can be tested for.
Note that Crystal assumes that anything with a null means that the field should not display. Always begin with something like
Code:
if isnull({your.amount}) then 0 
		         else {your.amount}

Text fields are less often blank, but it can happen. I can't see any better solution than the tedious method of having a formula field for each field, saying
Code:
if isnull({your.NOTES2}) then "" else {your.NOTES2}
You can then string together the formula fields, which will be fine since they are blank rather than null.

[yinyang] Madawc Williams (East Anglia, UK) [yinyang]
 
Thanks Madawc, that worked.

Is there a way for me to get all the notes from all records in the same field without grouping them by record, because it is leaving a gap in the note.
 
You can accumulate using variables. This is some code I copied from someone else's answer

Code:
Group on {table.PolicyID} and then create three formulas:
//{@reset} to be placed in the group (PolicyID) header:
whileprintingrecords;
stringvar x := "";
//{@accum} to be placed in the detail section:
whileprintingrecords;
stringvar x := x + {table.endorsementtext}+", ";
//{@display} to be placed in the group (PolicyID) footer:
whileprintingrecords;
stringvar x;
left(x,len(x)-2)
Shouldn't be hard to adapt it.

[yinyang] Madawc Williams (East Anglia, UK) [yinyang]
 
The formula works great and I don't have any breaks in the lines, but when it diplays the second record it starts a new line instead of starting where the first record left off.

Example
The time had arrive
d for me to throw up my hands in frustration.

Is there anyway to fix that?
 
I can't see a reason. Try posting your actual formulas.

[yinyang] Madawc Williams (East Anglia, UK) [yinyang]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top