Solved

Creating concatenated strings in Crystal

Posted on 2013-12-12
2
229 Views
Last Modified: 2013-12-13
I have a report with multiple detail lines for an item.

there are several records containing type 1 with a description field
several with a type 77 and a description field
several with a description and type 78.

while the detail line is printing(actually suppressed) I want to create 1 concatenated string
for each value and then display those fields in the group header.
0
Comment
Question by:Jeff_Kingston
2 Comments
 
LVL 100

Accepted Solution

by:
mlmcc earned 500 total points
ID: 39715165
You can't do it while the detail line is printing since the group header is already printed at that point.

If there is only 1 detail line per group just create a formula that concatenates them together and put it in the group header.

You can create the strings and display them in the group footer.

Basic idea
IN the report header create a formula
Name - DeclareVariables
WhilePrintingRecords;
Global StringVar strType1;
Global StringVar strType77;
Global StringVar strType78;
""

Open in new window


Add a formula to the group header to clear the strings
Name - CLearStrings
WhilePrintingRecords;
Global StringVar strType1;
Global StringVar strType77;
Global StringVar strType78;
strType1 := "Type 1 -" ;
strType77 := "Type 77 -";
strType78 := "Type 78 - " ;
""

Open in new window


In the detail section add a formula to build the strings
Name - BuildStrings
WhilePrintingRecords;
Global StringVar strType1;
Global StringVar strType77;
Global StringVar strType78;
If {TypeField} = 1 then
      strType1 := strType1 & chr(13) & {DescriptionFIeld}
Else If {TypeField} = 77 then
     strType77 := strType77  & chr(13) & {DescriptionFIeld}
Else If {TypeField} = 77 then
     strType78 := strType78" & chr(13) & {DescriptionFIeld};

""

Open in new window


You then need a formula in the group footer for each string to display them
Name - DispType1
WhilePrintingRecords;
Global StringVar strType1;
strType1

Open in new window


mlmcc
0
 

Author Closing Comment

by:Jeff_Kingston
ID: 39716916
This worked slick as you know what   Kudos for the solution and the rapid reply
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

I hate sub reports and always consider them the last resort in any reporting solution.  The negative effect on performance and maintainability is just not worth the easy ride they give the report writer.  Nine times out of ten reporting requirements…
Hot fix for .Net Crystal Reports 10.2.3600.0 to fix problems with sub reports running on 64 bit operating systems ISSUE: Reports which contain subreports fail with error "Missing Parameter Value" DEPLOYMENT SERVER OS: Windows 2008 with 64 bi…
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

777 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