ActiveReports Report Application Tutorials (2)---Listing report

Source: Internet
Author: User
Tags ole



Most numbers are reported in the System Class report list. Examples: Customer list, product list, equipment list, purchase list, coupons, commodity invoices, staff inventory, etc... Depending on the report, it is relatively easy to view the category list. However, it is rich in the ability to add data statistics, data columns, data grouping, and interactive reports and data visualization functions in the Inventory Class report.

This article will show you two layouts of inventory class reports, tabular inventory reports, and free layout inventory reports.

1, tabular inventory report--Customer Information list

Display all customer information in tabular form in the Customer Information inventory report. Contains customer number, company name, contact, contact title, phone, and address information. At the same time. The report displays the total number of customers and page number information.

1.1 . Create a report in the application named RptCustomerList.cs, using the report template for the ActiveReports Area report (code-based).

Open the Rptcustomerlist report design interface with a data source chart in the upper-left corner of the detail area.

Click the icon to create a report data source, the data source that we use is the Nwind_chs.mdb in the source Project Data folder, in the Open Report DataSource dialog box, select the Provider tab, click the Establish Connection button to open the Data Link Properties dialog box, and select the "Microsoft Jet 4.0 OLE DB Provider" Data provider, click "Next" button to switch to the "Connections" tab, click "..." button to navigate to the Nwind_chs.mdb file, then click "OK" The button finishes creating the source-based operation.

After returning to the OLE DB tab, enter the SQL statement in the query area: Select * from customer;, finally results such as the following:

Picture=image_134.png ">

Return to the report design interface after the data source is created. Then open activereports Report Explorer by VS2010 "menu" –> "Other Forms" –> "Report Explorer V7"

Picture=image_135.png ">

All fields in the Customer data table are listed under the fields –> bindings node in Report Explorer

Picture=image_136.png ">

Picture=image_thumb_136.png "border=" 0 ">

1.2 . Drag the database field to the detail area of the report design interface. At the same time, add the Label to the PageHeader area from the "ActiveReports 7 area Layout Report" category in the VS Toolbox and correspond to data field one by one in detail.

Due to the limit of the report paper size. In order to be able to do a lot of other things in a limited area, we need to set the TXT company name 1 and the TXT Address 1 control ShrinkToFit to True, through which the control is able to actively adjust the font size based on the data content.

Add a TextBox control to PageHeader and set the following properties:

DATAFIEDL = Customer ID

Summaryfunc = Count

Summarytype = GrandTotal

Add a Reportinfo control to the PageFooter and set the following properties:

FormatString = {pagenumber} page, total {PageCount} page

At last. Add the Webviewer control to the ASPX page and set the following properties:

ReportName = ControlExplorer.Reports.rptCustomerList

Viewertype = Flashviewer

1.3. The F5 key execution program gets the following result:

Picture=image_thumb_137.png "border=" 0 ">


2. Free Layout List Report--Product Information list

When you design a ActiveReports report interface, you can freely lay out the report controls in a drag-and-drop manner. And not confined to tabular layouts. Each item in the Commodity information list is displayed in multiple rows, multiple columns, and multiple rows combined.

2.1. Create a report named RptProductList.cs in Project. The report template that you use is a ActiveReports area report (code-based). After creation we are representing the data source information in the settings:

2.2, from the Report Explorer field, binding node to drag the required fields to the report design interface, it is important to note that the product image is used by the picture control to render.

Finally the design effect for example with what is seen:

2.3, through the F5 key execution program, get the following execution result:

Picture=image_thumb_76.png "border=" 0 ">

Source code: http://www.gcpowertools.com.cn/products/activereports_demo.htm

Copyright notice: This article Bo Master original article. Blog, not reproduced without consent.

ActiveReports Report Application Tutorials (2)---Listing report

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.