Custom eventhandlers
danni
Denmark
Hi again
I'm starting to feel like a mennis :-)
But still... it there an event to open a custom preview form within the designer?
Thank you.
I'm starting to feel like a mennis :-)
But still... it there an event to open a custom preview form within the designer?
Thank you.
Comments
No such event now. I'll try to add it in the next release.
/// Config.DesignerSettings.CustomPreviewReport += new EventHandler(MyPreviewHandler);
///
/// private void MyPreviewHandler(object sender, EventArgs e)
/// {
/// Report report = sender as Report;
/// using (MyPreviewForm form = new MyPreviewForm())
/// {
/// report.Preview = form.previewControl1;
/// report.ShowPreparedReport();
/// form.ShowDialog();
/// }
/// }
I'm looking forward to use it.
Thank you.
the same thing
' this event is fired when CustomPreview report.
' AddHandler Config.DesignerSettings.CustomPreviewReport, AddressOf Me.report_CustomPreview
Private Sub report_CustomPreview(ByVal sender As Object, ByVal e As EventArgs)
Dim freport As Report
freport = sender
freport.Prepare()
Using ChildForm As Form = New System.Windows.Forms.Form
ChildForm.Text = Me.Text
ChildForm.Icon = Me.Icon
ChildForm.Width = Me.Width * 0.8
ChildForm.Height = Me.Height * 0.8
Dim preview As New Preview.PreviewControl
freport.Preview = preview
preview.Dock = DockStyle.Fill
preview.ZoomWholePage() '
preview.ToolbarVisible = False
ChildForm.Controls.Add(preview)
freport.ShowPrepared()
ChildForm.ShowDialog()
End Using
End Sub
'