Solved

Repeating sections in Crystal Report

Posted on 2011-09-15
6
427 Views
Last Modified: 2012-05-12
Hello,

I'm using Crystal Reports (version 9.2.2.634) and I want a section within the report to repeat at least 4 times irrespective of the data being served to the report.

Scenario: Say, an application form allows users to enter upto 4 previous addresses and the applicant chooses to enter 2 addresses and submits the application. When my internal user views the report (using CR) I want to display all the 4 address fields with only 2 populated from the database (provided by the user). This will allow me to keep the report in sync with the application form (a requirement).

I'm currently using sub-report to display the repetitive fields but this only shows the number of rows available in the database (in this case 2).

I'm not sure if CR allows me to attain this. I've done some intensive research and was of no help. Would appreciate any help provided.

Thanks.
0
Comment
Question by:SasDev
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 100

Expert Comment

by:mlmcc
ID: 36543690
The only way to do ths would be to have the subreport on the report 4 times and linked appropriately.

How are you getting this done now?

mlmcc
0
 
LVL 5

Expert Comment

by:wkrasner
ID: 36543794
So if you have one address  you want 4 blank addresses, if you have two you want two blank addresses,

If thats the case you can set up sections under detail count the number of populated addresses in each group (like name of person)in a formula and suppress the sections accordingly based on the count,  you will need a reset for the formula. This approach will not work if there is no record.  The formulas would be like    if len(name)>0 then shared numbervar addcount:=addcount+1

reset in group header would be shared numbervar addcount:=0

use section expert to supress blank sections   based on shared numbervar addcount> 1  
next section > 2  etc
0
 
LVL 1

Author Comment

by:SasDev
ID: 36543911
Thank you both for your replies -

@mlmcc: Currently I'm passing a variable to the sub-report and it would return all the row from the DB which matches this variable. Adding the sub-report only once will return the number of rows available (in this scenario - 2). Adding sub-report 4 times will result in display of 2 available rows 4 times in the report - which is repetitive.?.

@wkrasner: This is how I want the addresses to show:
If 1 address then 3 blank addesses = total 4
If 2 address then 2 blank addesses = total 4
If 3 address then 1 blank addesses = total 4
If 0 address then 4 blank addesses = total 4
0
[Webinar] Code, Load, and Grow

Managing multiple websites, servers, applications, and security on a daily basis? Join us for a webinar on May 25th to learn how to simplify administration and management of virtual hosts for IT admins, create a secure environment, and deploy code more effectively and frequently.

 
LVL 19

Accepted Solution

by:
GJParker earned 500 total points
ID: 36544053
Are you displaying the data in the subreport ?

If you are then one way would be to create a faux group in the subreport, add the number of extra footer sections that you need and control the suppression of these sections by counting the number of addresses already displayed.

I've attached an exampel that shows the concept

 Multi-Address-Example.rpt
0
 
LVL 1

Author Comment

by:SasDev
ID: 36544093
@GJParker: That's the closest solution I've gotten to attain what I want to do. I will alter my report and will revert with results.

Thanks much.
0
 
LVL 1

Author Closing Comment

by:SasDev
ID: 36544796
KUDOS! Worked wonderfully... Thanks so much for your solution. It was bang on - that's exactly what I've been looking for.

I appreciate your help. Thank you. :)
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I hate sub reports and always consider them the last resort in any reporting solution.  The negative effect on performance and maintainability is just not worth the easy ride they give the report writer.  Nine times out of ten reporting requirements…
Hot fix for .Net Crystal Reports 10.2.3600.0 to fix problems with sub reports running on 64 bit operating systems ISSUE: Reports which contain subreports fail with error "Missing Parameter Value" DEPLOYMENT SERVER OS: Windows 2008 with 64 bi…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

742 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question