Customise Designer - help please

Stimulsoft Reports.NET discussion
Post Reply
jing
Posts: 50
Joined: Fri Jan 26, 2007 12:47 am
Location: New Zealand

Customise Designer - help please

Post by jing »

1) Can I add a menu item to an existing menu on the report designer? (Say, adding a menu item called "Choose Default Printer" under the existing Tools menu, so that the user can click on it and a custom form will popup providing a list of printers and it's settings etc)

2) Can I actually fully customise the designer (ie drag in tool bars, panels, controls and components) onto a windows form? If this can be done, can you provide me with some examples please?

thank you very much
Vital
Posts: 1278
Joined: Fri Jun 09, 2006 4:04 am

Customise Designer - help please

Post by Vital »

1) Can I add a menu item to an existing menu on the report designer? (Say, adding a menu item called "Choose Default Printer" under the existing Tools menu, so that the user can click on it and a custom form will popup providing a list of printers and it's settings etc)
You can't add new menu items to main menu.
2) Can I actually fully customise the designer (ie drag in tool bars, panels, controls and components) onto a windows form? If this can be done, can you provide me with some examples please?
At this moment you can't use report designer as control. Please see sample project DesignerManagement.

Thank you.
jing
Posts: 50
Joined: Fri Jan 26, 2007 12:47 am
Location: New Zealand

Customise Designer - help please

Post by jing »

Hi, Thanks for your reply.

So Can you add button to a designer's toolbar or toolbox ?
I have tried the following code, but I received a "NULL exception". But I don't understand why, as it seems every object is not null.

Code: Select all

  Dim ToolboxToolbarService As Stimulsoft.Report.Design.Toolbars.StiToolboxToolbarService = Stimulsoft.Report.Design.Toolbars.StiToolboxToolbarService.GetService
            If (Not ToolboxToolbarService Is Nothing) Then
                'Adding a button'
                Dim btnPrintSetup As New Stimulsoft.Controls.StiToolButton()
                btnPrintSetup.Size = New Size(20, 20)
                btnPrintSetup.Text = "Printer Setup"

                Dim iList As New ImageList()
                iList.Images.Add(New Drawing.Icon("c:\icon.ico"))

                btnPrintSetup.ImageList = iList
                btnPrintSetup.ImageIndex = 0

                Dim printEvent As New System.EventHandler(AddressOf PrinterSetup)
                ToolboxToolbarService.Add(btnPrintSetup, "Default Printer", printEvent)

            End If

Private Sub PrinterSetup(ByVal sender As Object, ByVal e As System.EventArgs)
        MessageBox.Show("check")

    End Sub


Any help please ...

thanks
Vital
Posts: 1278
Joined: Fri Jun 09, 2006 4:04 am

Customise Designer - help please

Post by Vital »

Please get build from Feb, 14 (when it will be available).
In this build please use following code:

C#:

Code: Select all

using Stimulsoft.Report.Design.Toolbars;

StiToolboxToolbarService.GetService().AddToolButton("Проверка", new EventHandler(OnButtonClick));

private void OnButtonClick(object sender, EventArgs e)
{
	MessageBox.Show("Test");
}
VB.Net:

Code: Select all

Imports StiStandardToolbarService.GetService

AddToolButton("MyButton", New EventHandler(AddressOf Me.OnButtonClick))

Private Sub OnButtonClick(ByVal sender As Object, ByVal e As EventArgs)
      MessageBox.Show("Test")
End Sub
Thank you.
Edward
Posts: 2913
Joined: Fri Jun 09, 2006 4:02 am

Customise Designer - help please

Post by Edward »

Now the Designer in the StimulReport.Net may be used as Control. Please refer to it as StiDesignerControl. This control is in Stimulsoft.Report.dll.

This feature is available in the build from the March, 5. You can download the build in the prerelease section of our site:
http://www.stimulsoft.com/DownloadsSR.aspx

Thank you.
Post Reply