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