Preview Custom button
Hello,
I want to change Save behaviour on Preview page. There are some choices like PDF,RTF etc exports. And I want to add my button with some handler.
My code:
Report report = new Report();
PreviewControl preview = new PreviewControl();
report.Preview = preview;
ButtonItem customButton = new ButtonItem();
customButton.Text = "my button";
customButton.Click += new EventHandler(customButton_Click);
preview.ToolBar.Items.Add(customButton);
ButtonItem customButton = new ButtonItem();
customButton.Text = "Create PDF with signature";
customButton.Click += new EventHandler(customButton_Click);
PopupItem saveMenu = (PopupItem)preview.ToolBar.Items[2];
saveMenu.SubItems.Add(customButton);
report.design();
This code doesnt work . After I do some designing and plick on Preview I get preview displayed,but without my added entry in Save option.
Any idea?
Thnx
Juraj
>>>>>>>>>>>>UPDATE:
Problem is that Report object creates own Preview object on Preview button click. So my created PreviewControl object is thrown away ...
I had to do some coding in FastReport source code to do the logic for me.
I want to change Save behaviour on Preview page. There are some choices like PDF,RTF etc exports. And I want to add my button with some handler.
My code:
Report report = new Report();
PreviewControl preview = new PreviewControl();
report.Preview = preview;
ButtonItem customButton = new ButtonItem();
customButton.Text = "my button";
customButton.Click += new EventHandler(customButton_Click);
preview.ToolBar.Items.Add(customButton);
ButtonItem customButton = new ButtonItem();
customButton.Text = "Create PDF with signature";
customButton.Click += new EventHandler(customButton_Click);
PopupItem saveMenu = (PopupItem)preview.ToolBar.Items[2];
saveMenu.SubItems.Add(customButton);
report.design();
This code doesnt work . After I do some designing and plick on Preview I get preview displayed,but without my added entry in Save option.
Any idea?
Thnx
Juraj
>>>>>>>>>>>>UPDATE:
Problem is that Report object creates own Preview object on Preview button click. So my created PreviewControl object is thrown away ...
I had to do some coding in FastReport source code to do the logic for me.