Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Repeating Section without Groups or Data

Status
Not open for further replies.

nlaliberte

Programmer
Apr 26, 2007
79
0
0
US
Good Afternoon,

I'm using Crystal XI and an ODBC connection.

I am working on a report that has a large section of static data, 'terms' if you may, that needs to be repeated 3 times, one after the other, per record.

Maintaining these as 4 seperate sections could prove to be pretty tedious down the road so we would like to list the 'terms' once and if possible, to repeat the same section 3 more times. Also, we would like to do this without hitting the database, so for an example a subreport pointed at a dummy proc, set to stop after recordnumber = 4, is not an acceptable solution.

My first thought was to create a series of run-time variables that would in essense count to 4, and group a subreport on that variable. But I don't think Crystal will allow me to group on a 'run-time' variable.

Does anyone have any tips/suggestions?




Desired Output:

report header
group header
detail A
detail B
detail C
detail C (repeated)
detail C (repeated)
detail C (repeated)
detail D
group footer
report footer
 
How lengthy is this static data? If the value doesn't change per record, you could potentially add a master formula (suppressed) to the report header that references the data in a string variable, and then place a formula that references the variable in each of four sections. Then if you need to change the value, you only change in the master formua.

-LB
 
I get what you're saying, and that's a good idea.

Unfortunatly the static data is more like a form that is printed along with the report. It contains several instances of text along with places for a client to fill in information. Currently we have it in a subreport, and we repeat the subreport 4 times. That also means that if a change needs to be made we need to make it 4 times as we don't have a repository to store the sub-report.

Would another way to do it be to pass the form is as and OLE Object, and perhaps store the form as a word document?
 
You could also just split your deatils into 4 sections.

In sections 2-4 add 3 text boxes with your fixed data.

Then use a count variable, will there always be 4 records in the group?

place this in group header
@reset
whileprintingrecords;
global numbervar recount:=0

In top detail line

@increment
whileprintingrecords;
global numbervar recount:=recount+1

In the detail 2-4 section expert -> suppress formula
whileprintingrecords;
global numbervar recount <> 3

Ian




 
There is only 1 record of data, which is why I need a repeating section as opposed to just suppressing >4...

We would also like to avoid building a 'dummy' proc or pointing it to any database object simply to get 4 records.

The current proc on the main report will only return 1 record as that's how it was designed.
 
If you have currently a subreport that does a single instance and run it 4 times, could you save a step by having 4 copies of the verbage in the subreport (called once) broken into 4 detail sections with "new page after" flag set for each?

This would allow you to use only a single subreport, get your 4 sections (pages).

Your edits of any changes would be easier if the subreport used inserted OLE reference to a Word Document kept as the master version of your verbage. Then if you changed the verbage, all new reports would call the sub which would update based on the OLE master source.

Scotto the Unwise
 
Thanks Scott... but do repeat the verbage in one subreport 4 times is basically the same as calling the same subreport 4 times. If we have to make a change we still have to make it 4 times in either situation.


I agree that storing the verbage in a word document and calling that with an OLE object is the best solution here. This way we could keep one word document and have the changes be reflected in all 4 iterations.


Thanks!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top