Quantcast
Channel: SCN : Discussion List - SAP Crystal Reports, version for Visual Studio
Viewing all articles
Browse latest Browse all 3636

API/RAS - is it possible to remove suppress condition formula from report Section?

$
0
0

I need to modify a report on the fly so that sometimes the 'Suppress (no drill down)' condition formula is completely removed from a report Section. Optionally I would like to just modify the formula to return FALSE so that the section appears.

It seems like the code below works when the section format 'EnableSuppress' option is TRUE, but does not seem to do anything when there is a suppress formula for the section.

 

Is this possible to do?

Thanks

Helen

 

private void RemoveSuppress(CrystalDecisions.ReportAppServer.Controllers.ReportSectionController ctlSec

    , CrystalDecisions.ReportAppServer.ReportDefModel.Section sect)

{

    CrystalDecisions.ReportAppServer.ReportDefModel.ISCRSectionFormat

secFmt = new CrystalDecisions.ReportAppServer.ReportDefModel.SectionFormat(); // also tried getting the current section format object

 

    secFmt.EnableSuppress = false;

    secFmt.ConditionFormulas.RemoveAll(); // *** Should ensure the condition formulas are removed correct?

    ctlSec.SetProperty(sect, CrystalDecisions.ReportAppServer.Controllers.CrReportSectionPropertyEnum.crReportSectionPropertyFormat, secFmt);

}

private void doOutput(CrystalDecisions.ReportAppServer.ClientDoc.ReportClientDocument oras)

{

    CrystalDecisions.ReportAppServer.Controllers.ReportSectionController

        sect = oras.ReportDefController.ReportDefinition.FindSectionByName("DetailSection1");

 

    RemoveSuppress(oras.ReportDefController.ReportSectionController, sect);

    CrystalDecisions.ReportAppServer.CommonObjectModel.ByteArray

        boByteArray = oras.PrintOutputController.Export(RASDefModel.CrReportExportFormatEnum.crReportExportFormatPDF, 1);

    boByteArray.Save(@"c:\temp\r.pdf", true);

}


Viewing all articles
Browse latest Browse all 3636

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>