cancel
Showing results for 
Search instead for 
Did you mean: 

split one column into two columns

Former Member
0 Kudos

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.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

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!

Former Member
0 Kudos

Hi Mike,

It is working.Thank you so much for your valuable answer....:)

Answers (1)

Answers (1)

Former Member
0 Kudos

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.