GrapeCity.ActiveReports.v9 Assembly > GrapeCity.ActiveReports Namespace > SectionReport Class > SaveLayout Method : SaveLayout(Stream) Method |
This overload has been deprecated. Please use the new SaveLayout(XmlWriter) overload.
'Declaration Public Overloads Sub SaveLayout( _ ByVal stream As System.IO.Stream _ )
public void SaveLayout( System.IO.Stream stream )
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.
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