Setting Parameters

Parameter fields work almost exactly the same as database credentials. Both viewers prompt for parameters if they are required by the report but not supplied by the developer. These parameter prompting screens are shown in Figures 29.8 and 29.9.

Figure 29.8. The Windows Forms Viewer prompting for parameter values.

graphics/29fig08.jpg


Figure 29.9. The Web Forms Viewer prompting for parameter values.

graphics/29fig09.jpg


Again, the parameter prompting screens are useful but sometimes don fit the look and feel of the application or simply need to be suppressed entirely. Another common usage of customized parameter prompting screens is to have the parameter pick lists values come directly from the database so they are always up to date. To do this you would use the ReportDocument object to set the parameters before passing it to the viewer to display. This is done via the ReportDocuments SetParameterValue method. There are three versions of this method:

  • SetParameterValue(index As Integer, val As Object) is used to set a parameter value by index.
  • SetParameterValue(name As String, val As Object) is used to set a parameter value by name.
  • SetParameterValue(name As String, val As Object, subreport As String) is used to set a parameter for a subreport by parameter name and subreport name.

An example of this is






Dim Report As New ReportDocument()

Report.Load("C:ReportsOrders.rpt")

Report.SetParameterValue("Geography", "North America")

Report.SetParameterValue("Start Date", DateTime.Now)

Viewer.ReportSource = Report


For parameters that accept multiple values pass in an array of those values.


Part I. Crystal Reports Design

Creating and Designing Basic Reports

Selecting and Grouping Data

Filtering, Sorting, and Summarizing Data

Understanding and Implementing Formulas

Implementing Parameters for Dynamic Reporting

Part II. Formatting Crystal Reports

Fundamentals of Report Formatting

Working with Report Sections

Visualizing Your Data with Charts and Maps

Custom Formatting Techniques

Part III. Advanced Crystal Reports Design

Using Cross-Tabs for Summarized Reporting

Using Record Selections and Alerts for Interactive Reporting

Using Subreports and Multi-Pass Reporting

Using Formulas and Custom Functions

Designing Effective Report Templates

Additional Data Sources for Crystal Reports

Multidimensional Reporting Against OLAP Data with Crystal Reports

Part IV. Enterprise Report Design Analytic, Web-based, and Excel Report Design

Introduction to Crystal Repository

Crystal Reports Semantic Layer Business Views

Creating Crystal Analysis Reports

Advanced Crystal Analysis Report Design

Ad-Hoc Application and Excel Plug-in for Ad-Hoc and Analytic Reporting

Part V. Web Report Distribution Using Crystal Enterprise

Introduction to Crystal Enterprise

Using Crystal Enterprise with Web Desktop

Crystal Enterprise Architecture

Planning Considerations When Deploying Crystal Enterprise

Deploying Crystal Enterprise in a Complex Network Environment

Administering and Configuring Crystal Enterprise

Part VI. Customized Report Distribution Using Crystal Reports Components

Java Reporting Components

Crystal Reports .NET Components

COM Reporting Components

Part VII. Customized Report Distribution Using Crystal Enterprise Embedded Edition

Introduction to Crystal Enterprise Embedded Edition

Crystal Enterprise Viewing Reports

Crystal Enterprise Embedded Report Modification and Creation

Part VIII. Customized Report Distribution Using Crystal Enterprise Professional

Introduction to the Crystal Enterprise Professional Object Model

Creating Enterprise Reports Applications with Crystal Enterprise Part I

Creating Enterprise Reporting Applications with Crystal Enterprise Part II

Appendix A. Using Sql Queries In Crystal Reports

Creating Enterprise Reporting Applications with Crystal Enterprise Part II



Special Edition Using Crystal Reports 10
Special Edition Using Crystal Reports 10
ISBN: 0789731134
EAN: 2147483647
Year: 2003
Pages: 341

Flylib.com © 2008-2020.
If you may any questions please contact us: flylib@qtcs.net