Crystal Report Making Example

Source: Internet
Author: User
Tags blank page access database

Crystal Report seems to be more "ancient" reporting technology, it is developed by the SAP company report products, through the installation of the development package can be integrated in VS Crystall reports Designer. Through the visual design and operation, can complete the production of the report. Just recently available to help a friend a small favor, he also mentioned the use of crystal reporting technology to complete the batch printing and export of reports. n years without Crystal Report, just practice practiced hand.

Development tools We use the current mainstream VS2010 flagship version. VS2010 default is not integrated Crystal Report, need to install the development package Crforvs_13_0.exe. Here I provide one, convenient for everyone to download the installation.

Http://yunpan.cn/cVzPeMMWnJqFv Access Password 238a

Below is a demonstration of how to develop a reporting application using Crystal Reports under ASP. The application implements reading of relevant information (including pictures) from an Access database and is displayed in the report template that we design. Finally realize the basic functions of batch printing and exporting.

First create a new ASP. NET project, and then create a new Crystal Reports file.


We create a new blank report.


Then we can design what we want in this blank report, as shown in:


Right-click Database field and select Database Expert.


In the popup dialog box, create a new connection and select our Access database.


You can then select the field that appears in the field list on the right side of the database, and drag it to the right side of the designer (remove the repeating string text box from the header section).

However, because the photo information is stored in the image of the binary data, drag directly in the designer can be displayed, but the page does not display properly, this time need to pay attention to set up the Web. config. Add the following nodes:

The image in the database can be displayed directly after running.

There are a few details that need to be explained before the project is finally run:

1, the report is not complete each page, and finally always more than one page blank page

The problem arises because the page has extra parts that are not removed and need to be set up as follows:




2, font alignment and so on how to set



Numbers do not display commas


Once the preparation is complete, we can display it directly on the page.

Drag a Crystalreportviewer control directly in the page. It will help us do a lot of things automatically, including referencing the corresponding DLLs and so on. Finally write the following code in the background of the page.

protected void Page_Load (object sender, EventArgs e) {     reportdocument rd = new reportdocument ();     Rd. Load (Server.MapPath ("~") + "Crystalreport1.rpt");     Rd. Setdatasource (XXX);//xxx for your data source dataset this     . Crystalreportviewer1.reportsource = rd; }
Finally look at:

Batch printing, export (Word, Excel) are duly completed, Crystal Report in this respect is really both worry and effort AH.



Crystal Report Making Example

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.