cancel
Showing results for 
Search instead for 
Did you mean: 

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

Former Member
0 Kudos

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);

}

Accepted Solutions (1)

Accepted Solutions (1)

0 Kudos

Hi Helen,

Not sure why or how I missed this one but see this post for more info:

http://scn.sap.com/thread/3712393

Don

Answers (0)