Page 1 of 1
design report in run time
Posted: Sat Jul 16, 2011 3:15 am
by eli_dani22
Hi
i wanna add a field to my report header in runtime.it means in design time there is nothing but after running a field exist in header or any where i want.how can i do this.plz help me on that
thanx alot
design report in run time
Posted: Sat Jul 16, 2011 5:01 am
by Jan
design report in run time
Posted: Tue Jul 19, 2011 2:26 am
by eli_dani22
it was so usefull but i send just a table too my report.all the definiton of report ,page and its components is in Stimulsoft Reports Designer .how can i access to page in Reports Designer from my .Net program?
Thank you
design report in run time
Posted: Tue Jul 19, 2011 6:13 am
by eli_dani22
i worked as following :
DataTable Dt = null;
RetriveData(ref Dt);
if (Dt == null)
{
return;
}
frmStimReportPreview f = new frmStimReportPreview(this, reportList1);
((FormManager)PreForm).New(f);
reportList1.ShowReport("GoodsSupplyAmount", Dt);
in this way how can i add a text to my report in runtime
design report in run time
Posted: Wed Jul 20, 2011 2:05 am
by Ivan
Hello,
Please try to use the following code, for example:
Code: Select all
StiReport mainreport = new StiReport();
mainreport.Load("test.mrt");
StiBand band = (StiBand)mainreport.GetComponentByName("ReportHeader1");
StiText textbox = new StiText(new RectangleD(0, 0, 5, 1));
textbox.Name = "TextOnReportHeader1";
textbox.Page = band.Page;
textbox.Text = "Test string";
band.Components.Add(textbox);
mainreport.Show();
Thank you.
design report in run time
Posted: Wed Jul 20, 2011 5:06 am
by eli_dani22
Hello
thank you very much.your codes was sooo usefull.i find the solution.
design report in run time
Posted: Wed Jul 20, 2011 6:28 am
by Andrew
Great! Have a nice day!
design report in run time
Posted: Sat Jul 23, 2011 2:06 am
by eli_dani22
Hi
In previous topics we make a new StiBand and add a textBox to it.now if i want to add a text box to one of my existent band like "PageHeaderBand1" how it's possible.
Thanx for your regard
design report in run time
Posted: Mon Jul 25, 2011 1:02 am
by Alex K.
Hello,
In the code, in the previous topic we did not create a new StiBand. We get it from a loaded report. For this we use the following code:
Code: Select all
StiBand band = (StiBand)mainreport.GetComponentByName("ReportHeader1");
In your case you can use the following code:
Code: Select all
StiPageHeaderBand band = (StiPageHeaderBand)mainreport.GetComponentByName("PageHeaderBand1");
Thank you.