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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Keeping two sections together if the 2nd section goes to the next page 1

Status
Not open for further replies.
May 22, 2006
18
0
0
US
I'm using Crystal Reports 8 and my issue is with keeping sections together.

The 1st detail section acts as a heading of the 2nd detail section. I need the 1st section to move to the next page if the entire 2nd section starts printing on the next page. In addition, I would need the 1st section to stay on the current page if the any part of the 2nd section prints on the current page.

Thanks to anyone who can help with this.
 
One way to quickly cheat this would be to build out a faux group based on enough fields to make the group identical to the current details.

For instance if you have values, then something like:

{table.name} & {table.value} might be enough, add fields as required.

Then use Insert->Group on the formula, and select the Keep Together option in the group creation.

Now move all fields to this group section and suppress the details. Crystal will now manage the keeping together.

The alternative would be to create formulas to count how many lines have been displayed per page and force a new page before.

page header:
whileprintingrecords;
numbervar MyCount:=0

Details:

whileprintingrecords;
numbervar MyCount:=MyCount+1


Then in the New Page Before of the Details A section use something like:
whileprintingrecords;
numbervar MyCount;
MyCount > 50

Where 50+ is the estimated number of lines before starting a anew page, adjust accordingly.

-k

 
In the section expert, have you tried checking "keep together" for the higher order details section above detail_a?

-LB
 
SYNAPSEVAMPIRE AND LBASS:
Thanks for the information, but unfortunately I am not that familiar with Crystal Reports and this project was kinda thrown on me. Whenever I try to insert a group into the report it won't let me choose detail sections only database fields with values. The 1st detail section is only a text object and is not showing up in the selection area and the 2nd detail section, although it is a database field also will not show in the selection area. If possible, would you please be a little more detailed in your explanation?

Thanks,
 
Before trying something more complex, go to format->section->highlight "details" that you find above "detail_a" and then check "Keep together." See if that meets your needs.

-LB
 
Here is the situation I am hoping to find answer to.

I'm using Crystal Reports.Net and I have a subreport that was built in another report. If I wanted to use the subreport in a different report, how would I go about doing so? For example: I have a report named: NYdom.rpt. Inside of this report is another report named: TestCOT.rpt Now as long I use TestCOT.rpt in NYdom, the subreport works. I wanted to know how to copy or extract that subreport to use in a different report.

Thanks for your help in advance...
 
You should be able to select the subreport->file->save subreport as->rename the report and save in a file location of your choice.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top