ActiveReports 18 .NET Edition
MESCIUS.ActiveReports Assembly / GrapeCity.ActiveReports Namespace / SectionReport Class / SaveLayout Method / SaveLayout(Stream) Method
Stream object where the report's layout will be saved.
Example

In This Topic
    SaveLayout(Stream) Method
    In This Topic

    This overload has been deprecated. Please use the new SaveLayout(XmlWriter) overload.

    Syntax
    'Declaration
     
    Public Overloads Sub SaveLayout( _
       ByVal stream As Stream _
    ) 
    public void SaveLayout( 
       Stream stream
    )

    Parameters

    stream
    Stream object where the report's layout will be saved.
    Remarks

    You can use this method to save the report's layout as a stream, then store it in a database or a resource file.

    The SaveLayout(Stream) method uses the UTF-16 encoding when you save to a stream.

    When using this method, any code behind the report is ignored. To embed code in the report, use Scripting.

    Example
    private void mnuPrintPreview_Click(object sender, System.EventArgs e)
    {
        GrapeCity.ActiveReports.SectionReport rpt = new GrapeCity.ActiveReports.SectionReport();
        System.IO.MemoryStream m_stream = new System.IO.MemoryStream();
        this.designer1.Report.SaveLayout(m_stream);
        m_stream.Position = 0;    
        rpt.LoadLayout(m_stream);
        m_stream.Close();
        frmViewer frm = new frmViewer();    
        frm.SetReport(rpt);
        frm.ShowDialog(this);
    }
    Private Sub mnuPrintPreview_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) _ 
        Handles mnuPrintPreview.Click
            Dim rpt As New GrapeCity.ActiveReports.SectionReport()
            Dim m_stream As New System.IO.MemoryStream()
            Me.Designer1.Report.SaveLayout(m_stream)
            m_stream.Position = 0
            rpt.LoadLayout(m_stream)
            m_stream.Close()
            Dim frm As New frmViewer()
            frm.SetReport(rpt)
            frm.ShowDialog(Me)
    End Sub
    See Also