ActiveReports.Viewer3 Request technical support
Add Method
See Also  Example


value
Page object to be added to the collection.
Adds the specified Page object to the collection.

Syntax

Visual Basic (Declaration) 
Public Function Add( _
   ByVal value As Page _
) As Integer
Visual Basic (Usage)Copy Code
Dim instance As PagesCollection
Dim value As Page
Dim value As Integer
 
value = instance.Add(value)
C# 
public int Add( 
   Page value
)

Parameters

value
Page object to be added to the collection.

Return Value

Index of the newly added page.

Example

C#Copy Code
int i;
private void Form1_Load(object sender, System.EventArgs e)
{
   rptOne rpt1 =
new rptOne();
   rpt1.Run();
   rptTwo rpt2 =
new rptTwo();
   rpt2.Run();
   
for(i = 0; i < rpt2.Document.Pages.Count; i++)
   {
       rpt1.Document.Pages.Add(rpt2.Document.Pages[i]);
   }
   viewer1.Document = rpt1.Document;
}
Visual BasicCopy Code
Dim i As Integer
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    Dim rpt As New rptOne()
    rpt.Run()
    Dim rpt2 As New rptTwo()
    rpt2.Run()
    For i = 0 To rpt2.Document.Pages.Count - 1
        rpt.Document.Pages.Add(rpt2.Document.Pages(i))
    Next
    Viewer1.Document = rpt.Document
End Sub

See Also