?
Solved

Repeating sections in Crystal Report

Posted on 2011-09-15
6
Medium Priority
?
429 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 101

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
On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

 
LVL 19

Accepted Solution

by:
GJParker earned 2000 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

Enroll in August's Course of the Month

August's CompTIA IT Fundamentals course includes 19 hours of basic computer principle modules and prepares you for the certification exam. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

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

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. …
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…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…

771 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