Using crystaldecisions.crystalreports.Engine;
Private const string report_name = @ "../../ craystalreportanalysis.rpt"; private const string text_object_name = @ "text1";
Private Void Form1_Load (Object Sender, System.EventArgs E) {report = new reportDocument (); Report.Load (Report_Name); Report.Refresh ();
CRVCHART.REPORTSOURCE = Report;
Private void btnchangetext_click (object sender, system.eventargs e) {textObject text; text = getTextObject (Text_Object_name);
TEXT.TEXT = "Hello, Haibo.net!";
CRVCHART.REFRESHREPORT ();
Private textObject GetTextObject (String reportObjectname) {textObject text;
// Get the ReportObject by name, convert it to TextObject, // and return this object. Text = report.reportDefinition.reportObjects [ReportObjectname] as textObject; if (text! = Null) Return TEXT; Else Return null;