1. Create an xsd file based on the report structure fields to store data.
2. Create a report. Note that you must browse the xsd file when creating the report,
After the report is created, find the report attribute "custom tool" and set the original
"CrystalDecisions. VSDesigner. CodeGen. ReportCodeGenerator"
Change to "CrystalDecisions. VSShell. CodeGen. ReportCodeGenerator"
This will generate a release XB. cs file named after your report name, which is actually the following class release XB
Create a page and place the CrystalReportViewer control to the page,
And declare the report class at the top of the page file,
Public class fr_policxb: System. Windows. Forms. Form
{
Using XB crReportDocument;
.........
3. Create a report structure
DataSet dss = new DataSet ();
DataTable dt = new DataTable ("zsmxb ");
Dt. Columns. Add ("cchbh", System. Type. GetType ("System. String "));
Dt. Columns. Add ("nglf", System. Type. GetType ("System. Decimal "));
Dt. Columns. Add ("ncf", System. Type. GetType ("System. Decimal "));
Dt. Columns. Add ("nqyf", System. Type. GetType ("System. Decimal "));
Dt. Columns. Add ("nzsf", System. Type. GetType ("System. Decimal "));
Dt. Columns. Add ("ntcf", System. Type. GetType ("System. Decimal "));
Dt. Columns. Add ("ngz", System. Type. GetType ("System. Decimal "));