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

split one column into two columns

Dear all,

I am using Crystal report 2011,I am getting values in column like

Column

6XXXXX

4XXXXX

6XXXXXX

6XXXXX

4XXXX

.

.

.

and so on...

I want to split this column into two columns; First column should have values starts with 6xxxxx and second column should have values starts with 4xxxx

Can someone please assist me how can I split??

Regards

Srinivas.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Nov 20, 2012 at 05:31 PM

    HI Srinivas

    Try this idea.

    Create two formulas. One named collect_six and one named collect_four.

    The code would be something like this:

    Whileprintingrecords;

    If left([FIELD_NAME],1)=”6” then

    shared stringvar sixes:= sixes & ”<br>” & [FIELD_NAME]

    Place the formulas in the detail section.

    As the report process the detail records the formulas will collect the appropriate field values.

    Now create two more formulas. One named print_six and one named print_four.

    The code would be something like this:

    Whileprintingrecords;

    shared stringvar sixes

    Place these formulas in the footer section.

    Suppress the details section so that only the footer section dispels on your report.

    Also, format the footer formulas. In the Paragraph tab of the Format Editor set the Text Interpretation to HTML. This will allow the <br> tag to be interpreted and cause a line break for each record.

    good luck!

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Nov 20, 2012 at 04:31 PM

    Hi Srinivas,

    According to my knowledge, if we would like display single field column into two columns then follow the below steps.

    1) Place the column in Details section

    2) Right click on Detail section Grey area and select 'Section expert'.

    3) Select 'Format with Multiple columns' check box in the right side window.

    4) Select 'Layout' Tab --> Specify 'width' - 1.0 --> Select "Down then across" under 'Printing Direction'--> Click ok.

    5) Then the column will be diaplyed second column beside the first column.

    Hope this information will help you...

    --Naga.

    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.