Skip to Content
author's profile photo Former Member
Former Member

display rows as columns in crystal

Hello,

I am using crystal reports version 9 and i have a requirement as below.

main report has a sub report in the page header section and the sub report gets data of the customer names linked to the customer in main report.

my sub report output currently shows as

NAME A

NAME B

but i want it to appear as NAME A, NAME B so that all the customer names appear in a line instead of seaprate rows on the report. is there a way to do this?

Thanks in advance for your help.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Mar 01, 2010 at 05:54 PM

    Suppress the detail section, and use this formula to concatenate all of the values (basic syntax):

    WhilePrintingRecords
    
    global nameList as string
    
    if len(nameList) = 0 then
      nameList = {db.name}
    else
      nameList = nameList + ", " + {db.name}
    end if
    
    formula = ""
    

    Then in the subreport's footer, print the names:

    WhilePrintingRecords
    
    global nameList as string
    
    formula = nameList
    

    HTH,

    Carl

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.