यहां सभी हेडर/पाद लेखों को दबाए रखने के लिए ReportDocument के लिए मेरी विस्तार विधि। मैं इसे एक्सेल निर्यात के लिए उपयोग करता हूं।
/// <summary>
/// Clears header/footer.
/// </summary>
/// <param name="rpt">The reportdocument</param>
public static void ClearReportHeaderAndFooter(this ReportDocument rpt)
{
foreach (Section section in rpt.ReportDefinition.Sections)
{
if (section.Kind == AreaSectionKind.ReportHeader || section.Kind == AreaSectionKind.ReportFooter || section.Kind == AreaSectionKind.PageFooter || section.Kind == AreaSectionKind.PageHeader)
{
section.SectionFormat.EnableSuppress = true;
section.SectionFormat.BackgroundColor = Color.White;
foreach (var repO in section.ReportObjects)
{
if (repO is ReportObject)
{
var reportObject = repO as ReportObject;
reportObject.ObjectFormat.EnableSuppress = true;
reportObject.Border.BorderColor = Color.White;
}
}
}
}
}
इस तरह यह प्रयोग करें:
myReportDocument.ClearReportHeaderAndFooter();
यदि आप एक जवाब की जरूरत है, मैं एक इनाम खर्च ...? –