Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: How to extract table information correctly Post Reply Post New Topic
Author Message
stepzie
Newbie
Newbie
Avatar

Joined: 29 Jul 2009
Location: Malaysia
Online Status: Offline
Posts: 8
Quote stepzie Replybullet Topic: How to extract table information correctly
     Posted: 08 Sep 2009 at 3:39am
Hi,
 
The case is a little bit confusing here. So i would try my best to explain it. I need to create a Monthly Invoice Report.
 
Table X - Shipment Table
Table Y - Multiple Shipment to One Invoice Table
Table Z - Invoice Table
 
I created 5 shipments. Shipment numbers are Ship-01 to Ship-05. Ship-04 and Ship-05's invoice number are Inv-04, while Ship-01 = Inv-01,  Ship-02 = Inv-02 and Ship-03 = Inv-03.
 
Table X:-
Shipment Number
Ship-01
Ship-02
Ship-03
Ship-04
Ship-05
 
Table Y (It only store info that "multiple shipment to one invoice", it would not store info for "one shipment to one invoice"):-
Invoice Number / Shipment Number
Inv-04 / Ship-04
Inv-04 / Ship-05
 
Table Z:-
Invoice Number / Shipment Number
Inv-01 / Ship-01
Inv-02 / Ship-02
Inv-03 / Ship-03
Inv-04 / Ship-04
 
Here come the problem...
I grouped Table Z.Invoice Number and put Table X.Shipment number at details.
 
If my database link relation is
Table Z.InvoiceNumber -> Table Y.Invoice Number
Table Y.Shipment Number -> Table X.Shipment Number
Details for Inv-01 to Inv-03 won't appear, it only show Inv-04's details which is Ship-04 and Ship-05
 
If my database link relation is
Table Z.Shipment Number -> Table X.Shipment Number
Table Z.InvoiceNumber -> Table Y.Invoice Number
Table Y.Shipment Number -> Table X.Shipment Number
Details for Inv-01 to Inv-03 appear, but Inv-04 only show Ship-04. Ship-05 is missing.
 
All table link is left outer join, no enforced, link type is (=)
 
Please guide me how to show all details info correctly.
 
Hope my explaination above was clear, thank you


Edited by stepzie - 08 Sep 2009 at 3:42am
IP IP Logged
Jyothi Yepuri
Senior Member
Senior Member


Joined: 11 May 2009
Location: Australia
Online Status: Offline
Posts: 127
Quote Jyothi Yepuri Replybullet Posted: 08 Sep 2009 at 4:37pm
may be you should write a query instead of using tables in report

Query will be something like this
(
Table Y
Union all
Table Z)
inner join
Table X

HTH,
Jyothi

IP IP Logged
stepzie
Newbie
Newbie
Avatar

Joined: 29 Jul 2009
Location: Malaysia
Online Status: Offline
Posts: 8
Quote stepzie Replybullet Posted: 08 Sep 2009 at 7:12pm
Hi Jyothi,
 
Thanks for the tips. Sorry if i'm asking too much, i'm quite new to Crystal Report.
 
Your replied above mention "write a query". Are you refering to the SQL Expression Fields or ?? Please advise, thank you.
IP IP Logged
Jyothi Yepuri
Senior Member
Senior Member


Joined: 11 May 2009
Location: Australia
Online Status: Offline
Posts: 127
Quote Jyothi Yepuri Replybullet Posted: 08 Sep 2009 at 7:19pm
In database expert, under dababase there is an option Add Command

click on it, in Add Command To Report dialog write the query there.

what is the report back end? SQL/Oracle

Jyothi
IP IP Logged
stepzie
Newbie
Newbie
Avatar

Joined: 29 Jul 2009
Location: Malaysia
Online Status: Offline
Posts: 8
Quote stepzie Replybullet Posted: 08 Sep 2009 at 7:36pm

It's Microsoft SQL Server 2005.

Thanks for the guide. I'll try working on it Smile
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