Access Report in Runtime

Stimulsoft Reports.NET discussion
Post Reply
thornz
Posts: 1
Joined: Sat Jul 30, 2011 5:33 pm
Location: Turkey

Access Report in Runtime

Post 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 ?
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Access Report in Runtime

Post 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.
Post Reply