To add a private helper method for RAS configuration Code

Parent Previous Next

 

Report Application Server .NET SDK Developer Guide

To add a private helper method for RAS configuration Code


 







  1. At the bottom of the class, add a new private scope helper method, with no return value, named ConfigureCrystalReports().

Visual Basic

Private Sub ConfigureCrystalReports()
End Sub

C#

private void ConfigureCrystalReports()
{
}

Next, you put a call to the ConfigureCrystalReports() method from within an event method, so that the ConfigureCrystalReports() method runs automatically when the form loads.

The ConfigureCrystalReports() method enables users to interact with the report at runtime. It also controls programmatic interaction with the report.

  1. Click the + symbol on the Web Form Designer generated code region to expand and display its contents.

It is usually best to keep this region collapsed, because it contains auto-generated content that you rarely modify. However, you must add one line of code to this region before you collapse it again.

  1. Within the Page_Init [Visual Basic] or OnInit [C#] event method, and below the method call to InitializeComponent(), enter a call to the ConfigureCrystalReports() method.

Visual Basic

ConfigureCrystalReports()

C#

ConfigureCrystalReports();

NoteNote

Although the Page_Load event is usually used to load Web form configuration code in a .NET Web application, it is not the correct event method to use with Crystal Reports. For more explanation, see Persistence limitations when report binding in the Page_Load event handler.

  1. Click the - symbol on the Web Form Designer generated code region to collapse the contents of this region.
  2. In Solution Explorer, right-click Default.aspx, and then click Set As Start Page.

This page is now the first page to load when the website is accessed.

  1. On the File menu, click Save All.

Continue to To add a CrystalReportViewer control for Visual Studio .NET 2003.

© 2021 SAP AG. All rights reserved.

http://www.sap.com/sapbusinessobjects/

Support services

http://service.sap.com/bosap-support/

Created with the Personal Edition of HelpNDoc: Free EPub and documentation generator