Symptom
How to suppress or hide the report footer in a Crystal report using the RAS .NET SDK?
Environment
- Visual Studios 2008.
- Crystal Reports 2008 SP3.
- Web application.
Resolution
- Create a simple report in the Crystal Report designer with information (e.g. textbox with text in it) in the Page Footer section.
- Save the report as MyCrystalReportWithFooter.rpt.
- Use the following C# code to suppress the Page Footer at runtime.
// Namespaces
using CrystalDecisions.CrystalReports.Engine;
using CrystalDecisions.Shared;
using CrystalDecisions.Web;
using CrystalDecisions.ReportAppServer.ClientDoc;
protected void Page_Load(object sender, EventArgs e)
{
ReportDocument crReportDocument = new ReportDocument();
ISCDReportClientDocument crReportClientDocument;
CrystalDecisions.ReportAppServer.ReportDefModel.SectionFormat crSectionFormat;
CrystalDecisions.ReportAppServer.ReportDefModel.Section crSection;
crReportClientDocument = crReportDocument.ReportClientDocument;
crReportDocument.Load(Server.MapPath("MyCrystalReportWithFooter.rpt."));
crSection = crReportClientDocument.ReportDefController.ReportDefinition.PageFooterArea.Sections[0];
crSectionFormat = crSection.Format;
crSectionFormat.EnableSuppress = true;
crReportClientDocument.ReportDefController.ReportSectionController.SetProperty(crSection, CrystalDecisions.ReportAppServer.Controllers.CrReportSectionPropertyEnum.crReportSectionPropertyFormat, crSectionFormat);
CrystalReportViewer1.ReportSource = crReportDocument;
}
See Also
See the Attachments section below for sample applications written in VB.NET and C#.NET.
Keywords
unmanaged, in proc, ras, inproc , KBA , BI-DEV-NET , BI Software Development Kits (SDKs) - .NET or Other , How To
Product
Crystal Reports 2008 V1
Attachments
NET-VB2008_RAS-Unmanaged_CR12_Supress_Report_Footer.rar |
NET-CS2008_RAS-Unmanaged_CR12_Supress_Report_Footer.rar |