ActiveReports Report Application tutorial (2) --- list-type report, activereports ---

Source: Internet
Author: User
Tags ole

ActiveReports Report Application tutorial (2) --- list-type report, activereports ---
Zookeeper

List reports are available in most report systems, such as the customer list, product information list, device list, item purchase list, accounting credential, goods delivery list, and employee list. List-type reports are relatively simple to view. However, the report types evolved from list-type reports are rich. You can add data statistics, data columns, and data groups to list-type reports, it also provides interactive reports and data visualization functions.

This article will show the two types of layout list reports, table-based list reports and free layout list reports.

 

1. Table-based list Report-Customer Information List

In the customer information list Report, all customer information is displayed in a table, including the customer ID, company name, contact, contact title, phone number, and address information. At the same time, the report displays the total number of customers and page number information.

1.1,Create a report named rptCustomerList. cs in the application. The report template is ActiveReports region report (based on code ).

 

Open the rptCustomerList report design interface, and there is a data source chart in the upper left corner of the detail area. Click this icon to create a report Data source. The Data source we use is NWind_CHS.mdb under the Data directory in the source code project. In the open report Data source dialog box, select the "providers" tab, click the create connection button to open the "Data Link Properties" dialog box, select the "Microsoft Jet 4.0 ole db Provider" data Provider, and click "Next" to switch to the "connection" tab, click "…" Click the button to locate the NWind_CHS.mdb file, and then click "OK" to complete the data source creation operation.

Return to the "ole db" tab and enter the SQL statement "Select * from customer" in the query area. The final result is as follows:

After creating the data source, return to the report design page and open ActiveReports report resource manager in VS2010 menu> other window> report resource manager V7.

 

All fields in the customer data table are listed under the "field"> "bind" node of report resource manager.

1.2,Drag the database field to the detail area of the report design interface, and add the Label to the pageHeader area under the category "ActiveReports 7 Area Layout Report" in the VS toolbox, and one-to-one correspondence between data fields in detail.

 

Due to the limitation of the report paper size, we need to set the ShrinkToFit of the txt company name 1 and txt address 1 controls to True to allow more content in the limited area, you can use this property to set the control to automatically adjust the font size based on the data content.

Add a TextBox Control to pageHeader and set the following attributes:

DataFiedl = Customer ID

SummaryFunc = Count

SummaryType = GrandTotal

Add a ReportInfo control to pageFooter and set the following attributes:

FormatString = page {PageNumber}, total pages {PageCount}

Finally, add the WebViewer control on the ASPX page and set the following attributes:

ReportName = ControlExplorer. Reports. rptCustomerList

ViewerType = FlashViewer

 

1.3,Run the program with the F5 key and get the following results:


2. Free-layout list Report-item information list

When designing the ActiveReports report interface, you can freely layout the report control by dragging it, not limited to table layout. Each item in the item information list is displayed in the form of multi-row, multi-column, and multi-row combination.

 

2.1 create a report named rptProductList. cs in the project. The report template used is the ActiveReports regional report (based on code ). After the creation is complete, we will indicate the data source information in the settings:

 

2.2 drag the required fields from the fields in the report resource manager and the binding node to the report design interface. Note that the product image is displayed using the Picture control. Shows the final design result:

 

2.3 run the program with the F5 key and get the following running result:

 

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

Related Article

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.