Add new page in crystal report vb6

A blast from the past!

To add a new page in Crystal Report in VB6, you can follow these steps:

  1. Open your VB6 project and navigate to the form where you have the Crystal Report control.
  2. In the Toolbox, find the Crystal Report control and drag-and-drop it onto the form. This will create a new instance of the Crystal Report control.
  3. In the Properties window, set the Report property of the Crystal Report control to the name of the report you want to display.
  4. To add a new page to the report, you need to create a new instance of the CrystalDecisions.CrystalReports.Engine.ReportDocument class and set its ReportDefinition property to the report definition you want to use.
  5. Create a new instance of the CrystalDecisions.CrystalReports.Engine.Page class and set its ReportDocument property to the ReportDocument instance you created in step 4.
  6. Add the new page to the report by calling the ReportDocument.Pages.Add method and passing the new page instance as an argument.
  7. Set the CurrentPage property of the Crystal Report control to the new page you just added.

Here's some sample code to illustrate these steps:

Dim rpt As New CrystalDecisions.CrystalReports.Engine.ReportDocument
rpt.Load "YourReport.rpt"

Dim page As New CrystalDecisions.CrystalReports.Engine.Page
page.ReportDocument = rpt

rpt.Pages.Add page

CrystalReport1.Report = rpt
CrystalReport1.CurrentPage = page

Note that you need to replace "YourReport.rpt" with the actual name of your report file.

Also, make sure that you have the Crystal Reports runtime installed on your system and that you have referenced the Crystal Reports DLLs in your VB6 project.