×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

using semicolons to separate more than I record

using semicolons to separate more than I record

using semicolons to separate more than I record

(OP)
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.

RE: using semicolons to separate more than I record

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

RE: using semicolons to separate more than I record

(OP)
Sorry about that. There are no formulas. In the subreport, it is one field placed in the details section.  

RE: using semicolons to separate more than I record

(OP)
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.  

RE: using semicolons to separate more than I record

(OP)
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 " ";

 

RE: using semicolons to separate more than I record

Or:

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

-LB

RE: using semicolons to separate more than I record

(OP)
Thank you.  

RE: using semicolons to separate more than I record

(OP)
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?

RE: using semicolons to separate more than I record


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

-LB
 

RE: using semicolons to separate more than I record

(OP)
thank you!  

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close