Solved

Repeating sections in Crystal Report

Posted on 2011-09-15
6
425 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
ScreenConnect 6.0 Free Trial

Want empowering updates? You're in the right place! Discover new features in ScreenConnect 6.0, based on partner feedback, to keep you business operating smoothly and optimally (the way it should be). Explore all of the extras and enhancements for yourself!

 
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

ScreenConnect 6.0 Free Trial

Check out the updates in one game-changing release, ScreenConnect 6.0, based on partner feedback. New features include a redesigned UI that improves session organization and overall user experience. See the enhancements for yourself!

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…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

803 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