ActiveReports 8
Load(Stream) Method
See Also  Example
GrapeCity.ActiveReports.Document.v8 Assembly > GrapeCity.ActiveReports.Document Namespace > SectionDocument Class > Load Method : Load(Stream) Method

stream
A Stream that contains a valid persisted report document.

Glossary Item Box

Loads the report document from a stream.

Syntax

Visual Basic (Declaration) 
Public Overloads Sub Load( _
   ByVal stream As System.IO.Stream _
) 
C# 
public void Load( 
   System.IO.Stream stream
)

Parameters

stream
A Stream that contains a valid persisted report document.

Example

C#Copy Code
private void Form1_Load(object sender, System.EventArgs e)
{    
    System.IO.MemoryStream strm = new System.IO.MemoryStream();    
    rptMemoryStream rpt = new rptMemoryStream();    
    rpt.Run();    
    rpt.Document.Save(strm);    
    byte[] theBytes = new byte[strm.Length];    
    strm.Read(theBytes, 0, (int)strm.Length);    
    strm.Position =0;    
    viewer1.Document.Load(strm);
}
Visual BasicCopy Code
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load        
    Dim strm As New System.IO.MemoryStream()        
    Dim rpt As New rptMemoryStream()        
    rpt.Run()        
    rpt.Document.Save(strm)        
    Dim theBytes(strm.Length) As Byte        
    strm.Read(theBytes, 0, Int(strm.Length))        
    strm.Position = 0        
    Viewer1.Document.Load(strm)    
End Sub

Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also