on 10-22-2014 11:30 PM
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);
}
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.