I am developing a report in crystal reports 2008. The report extracts data from two peachtree/sage tables; JrnlHdr and JrnlRow. The tables JrnlHdr and JrnlRow are linked by a field called PostOrder. One PostOrder value in JrnlHdr can have multiple entries in JrnlRow table. I have to print all rows of JrnlRow table for a given PostOrder. The issue is that JrnlRow does not contain all transactions in the JrnlHdr's linked PostOrder. There is also another field in JrnlRow called LinkToAnotherTrx that contains information of additional PostOrders and I have to print them too. One example is as follows:
1. User entered reference number through parameter field (?referenceno)
2. Find all Post Order Numbers in JrnlHdr matching (JrnlHdr.Reference = ?referenceno) (Two PostOrders (JnrlHdr.PostOrder) Found: 266, 267)
3. Find all entries in JrnlRow where {JrnlRow.PostOrder} in [266, 267] (Two entries found for 266 and two entries found for 267)
4. And here is the difficult part: There is another field in JrnlRow called JrnlRow.LinkToAnotherTrx. It contains either zero or another post order number. If it contains another post order number, then I need to print the entries of that post order number as well. In this example, I got the following:
JrnlHdr (got two PostOrder 266, 267)
JrnlRow:
PostOrder LinkToAnotherTrx
266 0
266 265
267 0
267 264
If I view the entries for 264 and 265 in JrnlRow, I get:
PostOrder LinkToAnotherTrx
264 0
264 0
265 0
265 0
265 0
What I need in the detail section of the report is:
JrnlRow.PostOrder JrnlRow.Amount
264 100
264 200
265 300
265 400
265 500
266 600
266 700
267 800
267 900
I tried creating an alias of JrnlRow as JrnlRow_1 but could not accomplish the above requirement.
Regards,
Aziz
1. User entered reference number through parameter field (?referenceno)
2. Find all Post Order Numbers in JrnlHdr matching (JrnlHdr.Reference = ?referenceno) (Two PostOrders (JnrlHdr.PostOrder) Found: 266, 267)
3. Find all entries in JrnlRow where {JrnlRow.PostOrder} in [266, 267] (Two entries found for 266 and two entries found for 267)
4. And here is the difficult part: There is another field in JrnlRow called JrnlRow.LinkToAnotherTrx. It contains either zero or another post order number. If it contains another post order number, then I need to print the entries of that post order number as well. In this example, I got the following:
JrnlHdr (got two PostOrder 266, 267)
JrnlRow:
PostOrder LinkToAnotherTrx
266 0
266 265
267 0
267 264
If I view the entries for 264 and 265 in JrnlRow, I get:
PostOrder LinkToAnotherTrx
264 0
264 0
265 0
265 0
265 0
What I need in the detail section of the report is:
JrnlRow.PostOrder JrnlRow.Amount
264 100
264 200
265 300
265 400
265 500
266 600
266 700
267 800
267 900
I tried creating an alias of JrnlRow as JrnlRow_1 but could not accomplish the above requirement.
Regards,
Aziz