Use Crystal Report (lower) in Visual Studio. NET)
From www.aspfree.com
Translated by cash (World 7)
Cashcao@msn.com (cashcao@msn.com)
Crystal Report demonstration-use Push Model
The following describes how to use the Push Model to implement Crystal Reports.
1. Create a design-time dataset
2. Create a. rpt file and point it to the dataset we created earlier.
3. Place the Crystal Report Viewer control on the. aspx page and set its properties to point to the. rpt file created in the previous step.
4. Write the database connection function in code behind page.
5. Add the databind method.
Create a design-time dataset to define the Fielsds of Reports.
1) Right-click "Solution Explorer" and choose "Add" --> select "Add New Item --> Select" DataSet"
2) drag the "Stores" table from "SQL Server" on the "Server Explorer" panel.
3) This will create a "Stores" table in dataset.
The. xsd file created in this way only contains the definition of field, and there is no data in it. You need to create a connection to the database and fill in the data.
Create a. rpt file
4) create a. rpt file. The only difference from the previous one is that we will use dataset to create a table instead of using Crystal Report.
5) after creating the. rpt file, right-click "Details" section and select "Add/Remove Database"
6) in the "Database Expert" window, expand "Project Data", expand "ADO. NET DataSet", "DataSet1", and select "Stores" table.
7) Click ">" include "Stores" table into "Selected Tables"
8) Next, set the report layout.