Skip to Content
avatar image
Former Member

Multiple values on one line

I know Crystal wasn't written to do this and I've looked through this Q&A section for over an hour trying to find a question similar to mine and I can't.

I have a field which returns two values, causing 2 detail lines to be created for (1) item. As you can see the item code is the same, but there is a BES and an SAP number. For our customer, I need to write a report which will list both the BES and SAP number on the same line.

item code description customdescription
123456 BES 13121212
123456 SAP 10000000

The item has two descriptions for it causing two detail lines. I need to get both of the customdescription numbers on the same line for the item code. I can group by item code and so far I see that something has to be done with the footer, but other than that I'm clueless.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    Feb 24, 2017 at 10:00 PM

    Hi Shelley,

    You're correct about grouping on the Item Code. In the Group Header create a formula like:

    WhilePrintingRecords; 
    StringVar Descr := ""; 

    This formula will reset the string for each Item Code.

    In the Detail section create a formula like:

    WhilePrintingRecords; 
    StringVar Descr; 
    
    Descr := Descr & " " & {table.CustomDescription}; 

    This formula will concatenate the Custom Description to the variable Descr.

    In the Group Footer create a formula like:

    WhilePrintingRecords; 
    StringVar Descr; 

    This formula will display the result of Descr for each Item Code.

    Hope this helps,

    Brian

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      BRIAN!!!! THANK YOU

      This worked absolutely perfect. I don't know much about string or shared variables, but this worked. I truly appreciate your taking the time to answer this question for me.

  • Feb 27, 2017 at 09:14 AM

    If you want two separate columns for the descriptions create two formalae

    @SAP

    If {description} = 'SAP' then {customdescription} else ' '

    @BES

    If {description} = 'BES' then {customdescription} else ' '

    Then Add Maximum summaries of these two formula to either your itemcode group header or footer and suppress detail line

    Ian

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Ian - I did the first part, but didn't think about the part. This worked as well!!

      Thank you to both of you!