Solved

Repeating sections in Crystal Report

Posted on 2011-09-15
6
421 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
Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

 
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

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Crystal Reports: 5 Tests for Top Performance It is complete, your masterpiece report.  Not only does it meet your customer’s expectations, it blows them out the water, all they want is beautifully summarised and displayed in a myriad of ways. …
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…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

762 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