Crystal Reports XI Help

speshulk926

Member
Joined
May 23, 2007
Messages
8
Programming Experience
1-3
I am having issues getting a report to show up correctly for what I need it to do. I have 2 Tables: PrintLog and Letters. I need to set up a report that for each Letter in the Letters table to show what it has printed.

VB.NET:
Print Log Table:

[b]Print_ID int[/b]
Used as an identity field.

[b]Letter_ID int[/b]
Corresponds to the Letter_ID field in the Letters table.

[b]PrintDate datetime[/b]
The day the letter printed (used for record selection after i get the report working)

[b]LetterCount int[/b]
Displays the total letter count for that day.

There will be multiple LetterCounts for 1 Letter. This is where I am running into a problem. I haven't figured out how to group them so that it will display each letter from the Letters table and list how many letters printed total after adding all of the LetterCounts in the PrintLog table.

If you need more information, let me know. I tried to be as descriptive as possible.


Edit: this may help too...

Here's 3 sample entries inside of the PrintLog Table:

VB.NET:
[u]PrintID[/u]    [u]LetterID[/u]	   [u]PrintDate[/u]                      [u]LetterDate[/u]                     [u]Description[/u]        [u]LetterCount[/u]
1	   4	           5/9/2007 12:00:00 AM	          4/26/2007 12:00:00 AM	         Achform	    18
2	   16	           5/9/2007 12:00:00 AM	          4/26/2007 12:00:00 AM	         Chgbenef	    4
3	   16	           5/10/2007 12:00:00 AM	  4/26/2007 12:00:00 AM	         Chgbenef	    9

So Achform should show 18 letters printed and Chgbenef should show it printing 13 letters. Hope that helps some! I'm lost!
 
Last edited:

speshulk926

Member
Joined
May 23, 2007
Messages
8
Programming Experience
1-3
I'll only bump it once, then I don't know what I'll do! I really need this report to be grouped correctly, but I can't seem to get it working yet! ANY help, even if it's just a point in the right direction, would be appreciated!
 

DavidT_macktool

Well-known member
Joined
Oct 21, 2004
Messages
502
Location
Indiana
Programming Experience
3-5
It's a grouping issue

Here is my 2 cents...

If you use the PrintLog table to drive the report - Letters in the letter table that have no PrintLog records will not be included in the report.
Sort the PrintLog table by LetterID and link it to the Letters table by LetterID.
Group the report by LetterID and use the group footer to SubTotal the lettercount fields.
The group footer can contain some of the same info as the detail band (LetterID and Description). It can not contain the dates or the printID.
You can then decide if you want to suppress the entire detail band and just show the summary data, or use the detail band and suppress certain fields.

If you use the Letters table to drive the report, you could use a subreport to SubTotal the print counts and return that value to the main report. Link the subreport to the main with the LetterID fields.

Hope that helps
 
Top Bottom