Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Exportable to Excel Design Post Reply Post New Topic
Author Message
phimtau123
Newbie
Newbie


Joined: 10 Mar 2009
Online Status: Offline
Posts: 22
Quote phimtau123 Replybullet Topic: Exportable to Excel Design
     Posted: 10 Jun 2009 at 4:43pm
Hello all,

So currently my report look like this:

Compid Hard-drive Hard-drive size
123       HD1          100GB
             HD2          200BG
             HD3          300GB

How can I set it up so that my report would look like this:

Compid Hard-drive1 Hard-drive1 size Hard-drive2 Hard-drive2 size Hard-drive3 Hard-drive3 size

Please let me know how I can proceed.

Thank you,

Chuong
IP IP Logged
rahulwalawalkar
Senior Member
Senior Member
Avatar

Joined: 08 Jun 2007
Location: United Kingdom
Online Status: Offline
Posts: 731
Quote rahulwalawalkar Replybullet Posted: 11 Jun 2009 at 4:57am
Hi
 
Use SQL to do it create a stored procedure to pass parameter use the sql below
 

SELECT ID,

MAX(CASE WHEN HDCOL ='HD1' THEN HDNAME END) AS HD1,

MAX(CASE WHEN HDCOL ='HD1' THEN HDSIZE END) AS SIZE,

MAX(CASE WHEN HDCOL ='HD2' THEN HDNAME END) AS HD2,

MAX(CASE WHEN HDCOL ='HD2' THEN HDNAME END) AS SIZE,

MAX(CASE WHEN HDCOL ='HD3' THEN HDNAME END) AS HD3,

MAX(CASE WHEN HDCOL ='HD3' THEN HDSIZE END) AS SIZE

FROM YOUR TABLE

GROUP BY ID
 
OUTPUT
ID   HD1   SIZE    HD2 SIZE     HD3 SIZE
123 HD1 100GB  HD2 200GB  HD3 300GB
 
Cheers
Rahul
IP IP Logged
phimtau123
Newbie
Newbie


Joined: 10 Mar 2009
Online Status: Offline
Posts: 22
Quote phimtau123 Replybullet Posted: 12 Jun 2009 at 3:48pm
Thank you for such quick response.
 
Where in crystal report can I set the store procedure? I'm a really beginer with crystal report. OR is this being done at the database? because I'm only a customer to the database I cant make any modification to it.
 
:)
 
Thank again
IP IP Logged
phimtau123
Newbie
Newbie


Joined: 10 Mar 2009
Online Status: Offline
Posts: 22
Quote phimtau123 Replybullet Posted: 18 Jun 2009 at 8:44am
Hello,

I tried to apply the across and down option but it does not produce the right output I needed. The option result in:

Compid Hard-drive Hard-Drive Size Compid Hard-drive Hard-Drive Size
123..........HD1...........500GB................456........HD1............200GB
.......................................................................HD2............300GB

What I need is:
Compid Hard-drive Hard-Drive Size Hard-drive 1 Hard-Drive 1 Size
123.........HD1............500GB...............'NULL'............'NULL'
456.........HD1............200GB................HD2..............300GB

***Dotted line represent white space***

Any one have any idea on how i Should proceed?

Keep in mind that Hard-drive and Hard-drive 1 are from the same field. So when a computer have multiple hard-drive instead of 2 row for two hard-drive I need to have it show on one row with 4 column.

THank you for your help,
IP IP Logged
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum