Print Page | Close Window

one column rows to multiple columns

Printed From: Crystal Reports Book
Category: Crystal Reports .NET 2003
Forum Name: Report Design
Forum Discription: The best way to design a report and problems you have encountered
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=21713
Printed Date: 03 May 2024 at 8:42am


Topic: one column rows to multiple columns
Posted By: things_451
Subject: one column rows to multiple columns
Date Posted: 02 Oct 2015 at 7:08am




Thats how my data looks like in the report .Now,I need to change the report  data in one column to split into multiple columns.


Here in my report I have two columns EXPORT and Export_NAME. Export_Name has both NET,FIRM values.

I need to split my EXPORT into 2 columns
1.EXPORT where EXPORT_NAME ='NET'
2.EXPORT where EXPORT_NAME  ='FIRM'

If I do that each row is splitting into 2 rows..one for firm and one for net and creating a duplicate row.How do I avoid that?





Replies:
Posted By: hilfy
Date Posted: 15 Oct 2015 at 6:00am
1. Group by whatever is unique in each row.
2. Suppress the details and group header section.
3. Create two formulas that will look like this:

{@NET}
StringVar net_export;
if OnFirstRecord or {MyTable.GroupField} <> Previous({MyTable.GroupField} then net_export := '';
if {MyTable.EXPORT_NAME} = 'NET' then net_export := {MyTable.EXPORT};
net_export

{@FIRM}
StringVar net_firm;
if OnFirstRecord or {MyTable.GroupField} <> Previous({MyTable.GroupField} then net_firm := '';
if {MyTable.EXPORT_NAME} = 'FIRM' then net_firm := {MyTable.EXPORT};
net_firm

4. Put all of the data in the group footer section and use these formulas to get your two columns.

-Dell

-------------
Proviti, Data & Analytics Practice
http://www.protiviti.com/US-en/data-management-advanced-analytics - www.protiviti.com/US-en/data-management-advanced-analytics



Print Page | Close Window