Solved

Creating concatenated strings in Crystal

Posted on 2013-12-12
2
230 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Break apart and rearrange field, Crystal Reports 9 74
Crystal Reports--SubReport 3 61
Crystal Reports - group header 2 50
Selection between two dates and time range. 21 40
Crystal Reports: 5 Tests for Top Performance It is complete, your masterpiece report.  Not only does it meet your customer’s expectations, it blows them out the water, all they want is beautifully summarised and displayed in a myriad of ways. …
Hello everyone, Hope you find this as helpful as we did. We have on the company I work for an application built in Delphi V with Crystal Reports 8. We all know that Crystal & Delphi can be temperamental sometimes and the worst thing is, nearly…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

829 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