Custom eventhandlers

dannidanni Denmark
edited 5:50AM in FastReport .NET
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.

Comments

  • edited 5:50AM
    Hello,

    No such event now. I'll try to add it in the next release.
  • edited 5:50AM
    It will be available in the next daily build:

    /// 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();
    /// }
    /// }
  • dannidanni Denmark
    edited 5:50AM
    Nice!

    I'm looking forward to use it.

    Thank you.
  • edited 5:50AM
    danni wrote: »
    Nice!

    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
    '

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.