Stimulsoft Reports.NET discussion
mikecity
Posts: 1 Joined: Thu Aug 28, 2014 8:24 am
Post
by mikecity » Thu Aug 28, 2014 8:41 am
Hello!!
few days ago I created some buttons and added them to existing toolbars like this way:
Code: Select all
Stimulsoft.Report.Design.Toolbars.StiStandardToolbarService.GetService().AddToolButton("Clear", OnClearClick);
private void OnClearClick(object sender, EventArgs e)
{
stiReport.Pages[0].Components.Clear();
stiReport.Designer.Refresh();
}
this works fine!
Now i wonder if is it posible to create a new toolbar and add my own buttons on it.
Thank You.
Alex K.
Posts: 6488 Joined: Thu Jul 29, 2010 2:37 am
Post
by Alex K. » Fri Aug 29, 2014 7:37 am
Hello,
Unfortunately, it is not possible. You can add it only from the source code.
Thank you.
Saus86
Posts: 62 Joined: Fri Mar 23, 2012 10:57 am
Location: Italy
Post
by Saus86 » Thu Sep 24, 2015 1:05 pm
I tried this code but it doesn't function. I didn't see the button.
Code: Select all
private void button1_Click(object sender, EventArgs e) //StiStandardToolbarService
{
//Add button in designer
Stimulsoft.Report.Design.Toolbars. StiStandardToolbarService.GetService().AddToolButton("Clear", OnClearClick);
stiReport = new StiReport();
stiReport.Design();
}
HighAley
Posts: 8432 Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office
Post
by HighAley » Fri Sep 25, 2015 7:11 am
Hello.
Could you specify what button do you need to add and what Designer do you use?
It's possible to make changes in some themes of Designer control.
It's impossible to make such changes if you call the Designer with Design() method.
Thank you.
Saus86
Posts: 62 Joined: Fri Mar 23, 2012 10:57 am
Location: Italy
Post
by Saus86 » Fri Sep 25, 2015 7:41 am
I would specify a custom button like above.
Code: Select all
private void OnClearClick(object sender, EventArgs e)
{
stiReport.Pages[0].Components.Clear();
stiReport.Designer.Refresh();
}
The Designer used is 2012.2. How do I have to call Designer??
Thank you
HighAley
Posts: 8432 Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office
Post
by HighAley » Fri Sep 25, 2015 8:54 am
Hello.
Unfortunately, it's impossible to do this way.
Thank you.
Saus86
Posts: 62 Joined: Fri Mar 23, 2012 10:57 am
Location: Italy
Post
by Saus86 » Fri Sep 25, 2015 11:10 am
Sorry, but how mikecity did to add the new button inside Designer??
HighAley
Posts: 8432 Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office
Post
by HighAley » Fri Sep 25, 2015 11:55 am
Hello.
You could add a custom button on the StandardToolBar of the StiDesignerControl only before creating of that control with next code:
Code: Select all
StiStandardToolbarService stdToolbar = StiStandardToolbarService.GetService();
stdToolbar.AddToolButton(this.imageList1, 17, "Open Report..", new System.EventHandler (this.mbiFileNewReport_Activate));
Thank you.