If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > Crystal Reports > Comparing Premiums by Date

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 08-21-09, 23:41
brew7676 brew7676 is offline
Registered User
 
Join Date: Aug 2009
Posts: 6
Comparing Premiums by Date

Hello,

I am trying to create a report that compares premiums from 1 set of beginning and end dates (i.e. Jan through July 2009 displayed on the left side of the report) to second set of beginning and end date (i.e. Jan through July 2008 displayed on the right side of the report).

I am easily able to display the first set of premiums (the left side) by using a start and end date parameter (Date1 and Date2) by linking them to each record via the selection expert. However, the right side of the data displays the same data as the left side because Date1 and Date2 are being past to fields on the right as well.

I created a Date3 and Date4 parameter for the right side and linked them to to the fields on the right. However, the data on the right now matches the data on the left because each record is now pulling Date3 and Date4 instead of Date1 and Date2.

Is there a way in which I can create this premium comparison on the same page via these parameters? I tried to use a subreport for the right side and add it to the main report, but I ran into formatting issues.

Any help would be appreciated! I am fairly new to Crystal.
Reply With Quote
  #2 (permalink)  
Old 08-22-09, 18:35
brew7676 brew7676 is offline
Registered User
 
Join Date: Aug 2009
Posts: 6
Perhaps I need to make another connection to the spreadsheet for the right side 2008 and link Date3 and Date4 in that manner? Any thoughts?
Reply With Quote
  #3 (permalink)  
Old 08-24-09, 14:49
trowe trowe is offline
Registered User
 
Join Date: Dec 2004
Location: Connecticut
Posts: 85
Since you actually need two sets of data - this year's premiums and last year's premiums - it makes sense to use subreports.

One will cover the left side of the page and return this year's data. The other covers the rest of the page and shows last year's data. The only difference is the parameters used to pull the data in each report.

If you're really ambitious, put Date1 and Date2 in the main report and pass them to the subreports (calculate Date3 and Date4 by subtracting whetever period you want from Date1 and Date2).
Reply With Quote
  #4 (permalink)  
Old 08-24-09, 16:46
brew7676 brew7676 is offline
Registered User
 
Join Date: Aug 2009
Posts: 6
Subreport

Thanks for the response. The problem I am having with the subreport is formatting. The data looks to be correct, but on the left side each product line is being printed on a separate page, while on the right side all the information is fine. How do I keep the left side from printing the product lines on multiple pages?

FYI

The report consists of two groups
group 1 -- business units (3)
group 2 -- product lines 34 lines over 3 business units.

Also, I tried to use multiple connections, but I have had no luck with them either.
Reply With Quote
  #5 (permalink)  
Old 08-25-09, 09:26
trowe trowe is offline
Registered User
 
Join Date: Dec 2004
Location: Connecticut
Posts: 85
Is there a page break attached to one of the sections of your subreport? Look for "Page Break After" in section formatting.

In some versions of CR, you can store a subreport as a separate file and import it into a main report. After you attach it to the main report, you can edit it - there are options to update the external file or to requery it when the report is run - it depends whether you want the changes to the subreport to be propagated to every place where this subreport is used.

Last edited by trowe; 08-25-09 at 09:32.
Reply With Quote
  #6 (permalink)  
Old 08-25-09, 09:37
brew7676 brew7676 is offline
Registered User
 
Join Date: Aug 2009
Posts: 6
The only time it says new page after is in the group footer and that part if grayed out. I am using Crystal Reports 11.

Thx
Reply With Quote
  #7 (permalink)  
Old 08-25-09, 09:40
brew7676 brew7676 is offline
Registered User
 
Join Date: Aug 2009
Posts: 6
I clicked off the option can group in the subreport and it the subreport lined up with the data, however, all the date in the subreport was suppressed.
Reply With Quote
  #8 (permalink)  
Old 08-25-09, 13:28
brew7676 brew7676 is offline
Registered User
 
Join Date: Aug 2009
Posts: 6
I just tried using the main with two subreports left and right and it seems to be working better.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On