Print Page | Close Window

Paasing parameters to subreport

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2022
Forum Name: Tips and Tricks
Forum Discription: Have you learned some great tricks to share with the group? Post them here!
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=15109
Printed Date: 02 May 2025 at 12:30pm


Topic: Paasing parameters to subreport
Posted By: OlgaS
Subject: Paasing parameters to subreport
Date Posted: 07 Dec 2011 at 7:20am
SQL proc populates table1 and table2 that have the following insurance policy  information:
table1
policy insured name  policy eff date policy exp date
AAA111111100 Tom G 01/01/2008 06/30/2008
AAA111111101 John D 07/01/2008 12/31/2008
AAA111111102 Kim T 01/01/2009 06/30/2009
AAA111111103 Jesse M 07/01/2009 12/31/2009
BBB222222200 Olga S 01/01/2010 06/30/2010
BBB222222201 Alex F 07/01/2010 12/31/2010
table 2
policy premium losses
AAA111111100 $120.00 $300.00
AAA111111101 $140.00 $0.00
AAA111111102 $150.00 $0.00
AAA111111103 $135.00 $200.00
BBB222222200 $120.00 $0.00
BBB222222201 $133.00 $0.00
 
We have the 'main' CR that displays info from table1 and Subreport that displays info from table2. Input parameter is policy number . When we open CR, there will be a prompt 'Enter policy number'. For example, I enter 'AAA111111103'. The main report will display the data for this policy:
policy insured name  policy eff date policy exp date
AAA111111103 Jesse M 07/01/2009 12/31/2009
 
and the subreport should display the data from table 2 for all policies that have 2 right digits less than the input policy. In this case, it will be policies
policy premium losses
AAA111111100 $120.00 $300.00
AAA111111101 $140.00 $0.00
AAA111111102 $150.00 $0.00
 
 In other words, the subreport should display financial data for 3 previous policies. 
I can pass the input parameter ('AAA111111103') to the subreport, but in this case it will show financial information just for
policy premium losses
AAA111111103 $135.00 $200.00
 
Any ideas how to display just 3 previous policies?
 
Thank you,
OlgaS
 



Replies:
Posted By: comatt1
Date Posted: 13 Dec 2011 at 6:42am
What consititutes previous,
will the 102, 103, ALWAYS precede 104, or is there some other sequence value?
 
 


Posted By: cyber-guys
Date Posted: 29 Jan 2012 at 9:32am
you want to replace the last 2 digits of the policy# with 00 and query between that and the policy #
< policy# and >=policy00



Print Page | Close Window