Preview Custom button

edited June 2011 in FastReport .NET
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.

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.