ActiveReports 9
SaveLayout(Stream) Method
Example 

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

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

Syntax
'Declaration
 
Public Overloads Sub SaveLayout( _
   ByVal stream As System.IO.Stream _
) 
public void SaveLayout( 
   System.IO.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

Reference

SectionReport Class
SectionReport Members
Overload List

 

 


Copyright © 2016 GrapeCity, inc. All rights reserved

Support Forum