Solved

Creating concatenated strings in Crystal

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

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

There have always been a lot of questions related to when Crystal Reports evaluates report components (such as formulas, summaries, cross-tabs, charts, to name a few examples). Crystal Reports uses a two-pass reporting process to provide greater …
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…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

747 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now