Blue Theme Orange Theme Green Theme Red Theme
 
Home | Forums | Videos | Photos | Blogs | E-Books | Interviews | Jobs | Beginners | Training
 | Consulting  
Submit an Article 
 Login Close
User Id:
Password:
 
Forgot Password
Forgot Username
Why Register
 Jump to
Skip Navigation Links
TechnologyExpand Technology
WebsiteExpand Website
New MS SQL 2008 Available - DiscountASP.NET
 Resources  
Close
 Our Network  
Close
Search :       Advanced Search »
Home » Crystal Reports » Tip: How to add a Page Header to a Sub Report in Crystal Reports?

Tip: How to add a Page Header to a Sub Report in Crystal Reports?

Sub Reports in Crystal Reports do have report headers but do not support page headers. Wonder why? We can mimic the functionality with the help of a formula and a Group.

Author Rank:
Technologies: .NET 1.0/1.1,Visual C# .NET
Total downloads :
Total page views :  32864
Rating :
 4.33/5
This article has been rated :  6 times
   Print Read/Post comments Post a comment  Rate  
   Email to a friend  Bookmark  Similar Articles  Author's other articles  
 
ArticleAd
Become a Sponsor



Work around, work around, work around !!! This is what I do when I end up creating reports that require little bit of customization and there are times when you are tired of work arounds. Come on. Give me a break. Crystal Reports product costs so much and Business Objects folks seem to be adding patches to the old code. I would suggest them to rethink about it and rewrite the whole damn thing.

 

OK, I will stop being tetchy now. Let's get back to work.

 

Sub Reports in Crystal Reports do have report headers but do not support page headers. Wonder why? We can mimic the functionality with the help of a formula and a Group. Just follow these below steps:

 

Step 1: Create a Formula as following. I call my formula ShowPH:

 

WhileReadingRecords;

" "

 

Step 2: Add a Group from Insert Menu-select Group and you will see Insert Group. Select ShowPH formula there and click on Options tab.

 

 

On Options tab, select "Repeat Group Header on Each Page".

 

 

It will add a group to your sub report.

 

Step 3: Now add all text you want to display on the header of each page on the Group section area.

 

 

Using these steps will add headers to the pages of a sub report.


Login to add your contents and source code to this article
 [Top] Rate this article
 About the author
 
Mahesh Chand
Mahesh is a software consultant, architect, author, MCP, MVP, and founder of C# Corner. He has over 13 years of experience building systems for Financial and Banking, Engineering & Architectural, Imaging, Construction, Biological & Pharmaceuticals, Healthcare and Education industries including Microsoft, Unisys, Barclay’s, Centocor (J&J), McGraw-Hill, Excelon, PMI, and University of Pennsylvania Hospital. Since year 2000, he is been working with, ASP.NET, SQL Server, C# and .NET. His latest experience and interest is Silverlight, WPF, WCF, XAML and .NET 3.5. If you need any consulting in ASP.NET, AJAX, WPF, WCF, or XAML, contact him at mahesh AT c-sharpcorner DOT com
Looking for C# Consulting?
C# Consulting is founded in 2002 by the founders of C# Corner. Unlike a traditional consulting company, our consultants are well-known experts in .NET and many of them are MVPs, authors, and trainers. We specialize in Microsoft .NET development and utilize Agile Development and Extreme Programming practices to provide fast pace quick turnaround results. Our software development model is a mix of Agile Development, traditional SDLC, and Waterfall models.
Click here to learn more about C# Consulting.
 
Introducing MaxV - one click. infinite control. Hyper-V Hosting from MaximumASP.
Finally – a virtual platform that delivers next-generation Windows Server 2008 Hyper-V virtualization technology from a managed hosting partner you can truly depend on. Visit www.maximumasp.com/max for a FREE 30 day trial. Hurry offer ends soon. Climb aboard the MaxV platform and take advantage of High Availability, Intelligent Monitoring, Recurrent Backups, and Scalability – with no hassle or hidden fees. As a managed hosting partner focused solely on Microsoft technologies since 2000, MaximumASP is uniquely qualified to provide the superior support that our business is built on. Unparalleled expertise with Microsoft technologies lead to working directly with Microsoft as first to offer IIS 7 and SQL 2008 betas in a hosted environment; partnering in the Go Live Program for Hyper-V; and product co-launches built on WS 2008 with Hyper-V technology.
Dynamic PDF
ceTE software specializes in components for dynamic PDF generation and manipulation. The DynamicPDF™ product line allows you to dynamically generate PDF documents, merge PDF documents and new content to existing PDF documents from within your applications.
Boost the performance of your .NET applications
“ANTS Profiler took us straight to the specific areas of our code which were the cause of our performance issues." Terry Phillips, Sr. Developer, Harley-Davidson Dealer Systems. Download your free trial of ANTS Profiler.
Go.NET
Build custom interactive diagrams, network, workflow editors, flowcharts, or software design tools. Includes many predefined kinds of nodes, links, and basic shapes. Supports layers, scrolling, zooming, selection, drag-and-drop, clipboard, in-place editing, tooltips, grids, printing, overview window, palette. 100% implemented in C# as a managed .NET Control. Document/View/Tool architecture with many properties&events. Optional automatic layout.
Dundas Software
Dundas Chart for .NET is the most advanced .NET charting package available today.  With an extremely complete feature set, elegant architecture and easy implementation, Dundas Chart can quickly add advanced Charting functionality to enhance and transform ASP.NET and Windows Forms applications.  Whether you are implementing charting into internal projects, or building applications for clients, Dundas Chart offers advanced technology and advanced results to get the most out of data.
 
   Print Read/Post comments Post a comment  Rate  
   Email to a friend  Bookmark  Similar Articles  Author's other articles  
 
 Post a Feedback, Comment, or Question about this article
Subject:  
Comment:  
ArticleAd
Become a Sponsor
Latest Comments:
Subject Posted By Posted On
Print 2 subreports contineoulsy in Crystal Reportmadhusudhan4/9/2007
I have a subreports in a srystal report, First subreport is having a data of 5 to 6 lines, 2 nd report has to print in continuation with 1st subreport. But now i getting printing 2nd page is new Page.
Reply | Email | Delete | Modify | 
 
 
Re: Print 2 subreports contineoulsy in Crystal ReportMahesh4/9/2007
Not sure I understand your question.
Reply | Email | Delete | Modify | 
thank you!Osvaldo5/20/2007
hi from Brazil you got a great solution.. it solves my report mess... thanks a lot and keep up the great job OSVALDO
Reply | Email | Delete | Modify | 
 
 
Re: thank you!Mahesh5/21/2007

My pleasure OPONTES.

Feel free to share your CR tips and tricks with us ;)

Reply | Email | Delete | Modify | 
Reprint Subreport header on each pageRoger5/30/2007

Hello, My name is Roger,

I tried your steps and or i meesed up or i dint understood something or whatever but it doesn't seems to be what i need. Im using CR 8.5.0.217 I have a report with 3 subreports each one giving some totally different information from one to the other and only the Header of the main report has common information. I need to print a subreport header in each page this subreports needs

Example
TITLE
A.- details main rep
B.- subreport_1
b.0 Title Subreport_1
b.1 detail Subreport_1
C.- subreport_2
c.0 title subreport_2
c.1 detail Subreport_2
D.- subreport_3
d.0 title Subreport_3
d.1 detail Subreport_3

The page header involves TITLE + A (details main rep)
The report detail involves the different subreports (B+C+D).
I need this b.0 (Title Subreport_1) line at the top of each page the Subreport 1 is displaying.

Do you have any idea about how to solve this? Thank you very much

Reply | Email | Delete | Modify | 
 
 
Re: Reprint Subreport header on each pageMahesh6/3/2007
If you click on properties of a section (right click, properties) and on one of the dialogs, there is an option called "Repeat on each page" and if you select that, that section will repeat on each page of the report. In that section, you can put your header contents.
Reply | Email | Delete | Modify | 
 
Re: Re: Reprint Subreport header on each pageRoger6/5/2007
Oh! Thanks! Yes I used your "formula" to create a group inside the sub-report. Then at the grouping properties i could check the "repeat the group header on each page". It works great.
Reply | Email | Delete | Modify | 
Web Services on WizCat,Libwin & PALSXolile8/13/2007
Is it possible to use web services on WizCat,Libwin and PALS Information Management System? If not what recommended technology can be used?
Reply | Email | Delete | Modify | 
Web Services on WizCat,Libwin & PALSXolile8/13/2007
Is it possible to use web services on WizCat,Libwin and PALS Information Management System? If not what recommended technology can be used?
Reply | Email | Delete | Modify | 
Repeating HeaderRajeev11/25/2007
In my report the sub-report consists of the totals (based on grouping). Now if I simply implement the workaround suggested above then the headers will be coming twice on the same page (once as the normal report page header and second as the page header of the sub-report). How can I suppress the sub-report page header if the sub-report starts in the same page as the report? I hope I'm clear with the situation. TIA.
Reply | Email | Delete | Modify | 
print tile in sub apgesviji12/5/2007
if the first page having two more sub sections(ie, page 1(a),1(b)).then how will print the title in the sub pages?
Reply | Email | Delete | Modify | 
Subreport page header with totalsIan3/25/2008
Your solution to subreport page headers worked a treat. Except where the totals I'm displaying can't fit on the same page. They are printed on their own page, and the ShowPH group header isn't repeated. Any ideas on how to fix this?
Reply | Email | Delete | Modify | 
Print header text by SectionsTim11/17/2008
Is it possible to find out which report section is being printed and write formula to control the text to be printed in the page header for different pages? THX.
Reply | Email | Delete | Modify | 
subreport footermona1/5/2009
what is the formula for subreport footer?
Reply | Email | Delete | Modify | 

 Hosted by MaximumASP  |  Found a broken link?  |  Contact Us  |  Terms & conditions  |  Privacy Policy  |  Site Map  |  Suggest an Idea  |  Media Kit
Current Version: 5.2009.6.2
 © 1999 - 2009  Mindcracker LLC. All Rights Reserved