C # How To Make A CRYSTAL REPORT

Source: Internet
Author: User

Step 1: I don't need to teach you how to add a form! Drag the crystalreportviewer control in the toolbox to the form,
Step 2: Right-click to add a new item and find the dataset dataset1.xsd.
Step 3: add the new Crystal Report crystalreport1.rpt and select a blank report.
Step 4: Right-click dataset1.xsd and choose "Add-tableadapter" to name it: you define "dscardconsumption", connect to the database as prompted, and then write SQL statements.
This dataset is complete.
Step 5: Double-click crystalreport1.rpt to go to the upper left corner and find --- field resource manager -- database Field
Right-click-database field-Database Expert-a dialog box is displayed, and select project data-ADO. Net dataset.
Click it to find the dataset "dscardconsumption" you just completed, and then click OK.
Then -- there is an extra dataset under the database field, that is, there are many fields in dscardconsumption, and then drag it to crystalreport1.rpt
The details are arranged horizontally and sequentially. The upper and lower fields will appear when you place the information. The following fields show the database data and the above fields show the title. This is done.
Step 6: lower in the formCode:
// This is the dateset returned by the query method.
Dataset = reportbll. getquerycardconsumption (START, finish, cardno );
// This is the name of the bound dataset "cardconsumption"
Dataset. Tables [0]. tablename = "cardconsumption ";
// This is the name of crystalreport1.rpt created in step 5.
Rptcardconsumption Cr = new rptcardconsumption ();
Cr. setdatasource (Dataset );
Crvcardconsumption. reportsource = CR;

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.