Page 1 of 1

Access Report in Runtime

Posted: Sat Jul 30, 2011 5:35 pm
by thornz
Hi,

There is a RichTextBox and 2 TextBox in my report. I want to change their values at runtime and Show Report.How can i achieve this ?

Access Report in Runtime

Posted: Mon Aug 01, 2011 8:08 am
by Alex K.
Hello,

You can use the following code:

Code: Select all

StiReport report = new StiReport();
report.Load("e:\\report.mrt");

StiText txt = report.GetComponents()["Text1"] as StiText;
txt.Text = "Sample Text";

StiRichText rt = report.GetComponents()["RichText1"] as StiRichText;
RichTextBox rtb = new RichTextBox();
rtb.LoadFile("e:\\1.rtf");
rt.RtfText = rtb.Rtf;

report.Render();
report.Show();
Thank you.