I use this code for add new button in tool bar
1- load the report
2- create new button
3- add in tool bar
4- show report
5-(Stimul version 2008.1.129)
Code: Select all
StiReport report = new StiReport();
report.Load(@"D:\stireport1.mrt");
Button bo = new Button();
bo.Name = "button";
bo.Size = new System.Drawing.Size(10, 10);
bo.TabIndex = 0;
bo.Text = "button1";
bo.BackColor = Color.Red;
report.PreviewControl.ToolBar.Controls.Add(bo);
report.Show();
this code has an error :waaaht:
Code: Select all
report.PreviewControl.ToolBar.Controls.Add(bo);
Object reference not set to an instance of an object.
Thank you.