Solved

Creating concatenated strings in Crystal

Posted on 2013-12-12
2
233 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 101

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

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…
In this video, viewers are given an introduction to using the Windows 10 Snipping Tool, how to quickly locate it when it's needed and also how make it always available with a single click of a mouse button, by pinning it to the Desktop Task Bar. Int…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …

729 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