Recently, the project used Crystal Reports to print table data. Now let's take a look:
1. Install the crforvs_13_0 Crystal Report.
2. Create a. XSD file in vs2010, create a able in it, and set the Data Type of each field.
3. create. rpt (report file), draw the table to be displayed, and then bind the database field (right-click the database field-Database Expert-my connection-expand the tree node to find the newly created datatable) drag fields in the able table to the corresponding position.
4. in the print event on the upper page, a new able is created, the table data to be printed (for example, the data source of the datagridview dview) is assigned to the datatable, and a new able is created. rpt file, and set its data source 【. setdatasource (DT. RPT is assigned to the crystalreportview control and. rpt file parameter field pass value (if. the rpt file has a parameter field )【. parameterfieldinfo ].
Summary-steps for printing table data using a crystal report