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

using semicolons to separate more than I record

Status
Not open for further replies.

lthomas6

MIS
Aug 22, 2007
87
0
0
US
I have a crystal 10 report, sql backend using 2 database views.

The main report usese only 1 db view.

The issue lies in the 2 subreports which use a separate db view.

For the field matterplayer in the subreport, it can return more than one matterplayer. If so, it needs to be separated by a semi-colon.

ie: so if the matterplayer is equal to John Smith and Annie White,
it should display as John Smith;Annie White in the matterplayer field in the subreport. It is instead displaying as John Smith Annie White.

How can I correct this?

Thank you.
 
Please explain what in the subreport is returning this result. Is it one field placed in the the detail section? Or is it a formula placed in a group section? If so, what is the content of the formula? In other words, you should provide more information about the setup of the subreport.

-LB
 
Sorry about that. There are no formulas. In the subreport, it is one field placed in the details section.
 
I have 2 subreports for this report. Each pulling the same data but for different types of role_cd's.

I have 1 subreport call srPrimaryLegal where I have created the 3 formulas below:

@reset:
whileprintingrecords;
stringvar x:="";

@display:
whileprintingrecords;
stringvar x;
left(x,len(x)-1);

@accum:
whileprintingrecords;
stringvar x := x + {Entity.Name} + ";";

@reset is placed in group header and hidden, @accum is placed in details and hidden and @display is placed in group footer.
The subreport is grouped by role_cd and filtered by the following:
{MatterPlayer.Role_CD} = "Primary Legal Contact"
and isnull({MatterPlayer.EndDate})

this approach allows it to work by displaying the below:
john smith;Annie White

The problem occurs when I try to do the same to the second subreport. It throws an error "String length is less than 0 or not an integer" for the @display formula.
 
I am now able to get it all to work.

This error was due to a null value so I updated the @display formula to read:

whileprintingrecords;
stringvar x;
if not isnull({Entity.Name})
then
left(x,len(x)-1)
else " ";

 
Or:

whileprintingrecords;
stringvar x;
if len(x)>1 then
left(x,len(x)-1);

-LB
 
I had a make a change to this to have @accum =
whileprintingrecords;
stringvar x := x + {Entity_1.Name} & " " & "(" & {corptax1.UserFieldValue} & ");"

The issue I am having is that sometimes {corptax1.UserFieldValue}
can be null. In that case I want it to display nothing. In this case it is displaying () for when it is null. How can I correct this?
 

whileprintingrecords;
stringvar x := x + {Entity_1.Name} & " " &
(
if isnull({corptax1.UserFieldValue}) then
"" else
"(" & {corptax1.UserFieldValue} & ");"
)

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top