See Also

ActiveReport Class  | ActiveReport Members  | Overload List  | Scripting

Language

Visual Basic

C#

Show All

stream
Stream object where the report's layout will be saved.
See Also Languages ActiveReports Send feedback to Data Dynamics

SaveLayout(Stream) Method

Saves a report's XML layout to the specified stream.

[Visual Basic]
Overloads Public Sub SaveLayout( _    ByVal stream As Stream _ )
[C#]
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 method uses UTF-16 encoding when you save to a stream, and UTF-8 encoding when you save to a file.

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

Example

[C#] 

private void mnuPrintPreview_Click(object sender, System.EventArgs e) 

    DataDynamics.ActiveReports.ActiveReport rpt = new DataDynamics.ActiveReports.ActiveReport(); 
    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); 
}

[Visual Basic] 

Private Sub mnuPrintPreview_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) _
    Handles mnuPrintPreview.Click
        Dim rpt As New DataDynamics.ActiveReports.ActiveReport()
        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

ActiveReport Class  | ActiveReport Members  | Overload List  | Scripting

 

 


Copyright © 2004-2005 Data Dynamics, Ltd. All rights reserved.