Programming suppression display representation example code

zhaozj2021-02-16  56

Using crystaldecisions.crystalreports.Engine;

Private const string report_name = @ "../../ CrystalReportanalysis.rpt"; private const string chart_object_name = @ "graph2";

Private Void Form1_Load (Object Sender, System.EventArgs E) {report = new reportDocument (); Report.Load (Report_Name); Report.Refresh ();

CRVCHART.REPORTSOURCE = Report;

Private void BtnchangeType_Click (Object Sender, System.EventArgs E) {ChartObject Chart; Chart = getchartObject (chart_object_name); chart.Objectformat.enablesuppress = true;

CRVCHART.REFRESHREPORT ();

Private chartobject getchartObject (string reportObjectname) {chartObject chart;

/ / After obtaining ReportObject, convert it into chartobject, / / ​​and return this object. Chart = report.reportdefinition.reportObjects [ReportObjectname] as chartobject; if (chart! = Null) Return Chart; else return null;}

转载请注明原文地址:https://www.9cbs.com/read-22485.html

New Post(0)