Home > Technical > Page header or footer longer than a page (crystal Report)

Page header or footer longer than a page (crystal Report)

Today i got to work with crystal report for small project. but this stupid problem got my whole day for just one report.  this is problem with crystal report.  i wanted to display 2 table content in one report(it’s a comparrision report) all works except displaying those in correct way.

For example, say you have to display data from two tables on the same report page. Now say, you create two Detail sections and bind each Detail section with a table, you will find second table records repeating within the first table records.

For example, if I want to generate a report that looks like below.

Report Header
- Page Header
o Detail - Data from Customers table
o Detail - Data from Orders table
- Page Footer
Report Footer

To do this, you will have to create two details sections on the same level, not recursive.

The work around for this is using sub reports. What we do is to create two sub reports, one for Customers and one for Orders. These sub reports have nothing but a single Detail section.

Now we create two Page Header sections on the main report and put a sub report on each Page Header sections. The new report looks like this.

Report Header
- Page Header 1
o Sub Report 1
- Page Header 2
o Sub Report 2
o Detail Section (Hide it)
- Page Footer
Report Footer

but again this gave me problem when i added more fields and images in to report. searched net, changed all the option one by one in the report. no luck.

finaly i changed above structure in to

Report Header

Report Header 1
Report heading part goes here
ReportHeader 2
o Sub Report 1
- Page Header
o Sub Report 2
o Detail Section
- Page Footer
Report Footer

now this works for me. :)

And similarly, your data can be coming from multiple data sources; you can bind as many as sub reports with different data sources.

reference: http://www.c-sharpcorner.com/UploadFile/mahesh/MultipleDataSourceReport08232006225431PM/MultipleDataSourceReport.aspx

About these ads
  1. abbas
    February 20, 2012 at 1:40 pm | #1

    this is very nice solution…. it resolve my issue also

  1. January 2, 2011 at 2:19 pm | #1

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 105 other followers