Solved

Repeating sections in Crystal Report

Posted on 2011-09-15
6
422 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
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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

There have always been a lot of questions related to when Crystal Reports evaluates report components (such as formulas, summaries, cross-tabs, charts, to name a few examples). Crystal Reports uses a two-pass reporting process to provide greater …
Hello everyone, Hope you find this as helpful as we did. We have on the company I work for an application built in Delphi V with Crystal Reports 8. We all know that Crystal & Delphi can be temperamental sometimes and the worst thing is, nearly…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, just open a new email message. In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

863 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now