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:
650) this. width = 650; "width =" 644 "height =" 472 "title =" ActiveReports regional report data source "style =" border-width: 0px; display: inline; "alt =" ActiveReports region report data source "src =" http://www.bkjia.com/uploads/allimg/131228/1611493033-0.png "border =" 0 "/>
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.
650) this. width = 650; "width =" 644 "height =" 469 "title =" ActiveReports report Resource Manager "style =" border-width: 0px; display: inline; "alt =" ActiveReports report Explorer "src =" http://www.bkjia.com/uploads/allimg/131228/16114924O-1.png "border =" 0 "/>
All fields in the customer data table are listed under the "field"> "bind" node of report resource manager.
650) this. width = 650; "width =" 644 "height =" 519 "title =" ActiveReports data field "style =" border-width: 0px; display: inline; "alt =" ActiveReports data field "src =" http://www.bkjia.com/uploads/allimg/131228/16114924I-2.png "border =" 0 "/>
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:
650) this. width = 650; "width =" 644 "height =" 420 "title =" ActiveReports customer information list "style =" border-width: 0px; display: inline; "alt =" ActiveReports customer information list "src =" http://www.bkjia.com/uploads/allimg/131228/161149C47-3.png "border =" 0 "/>
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:
650) this. width = 650; "width =" 644 "height =" 415 "title =" ActiveReports regional report data source "style =" border-width: 0px; display: inline; "alt =" ActiveReports region report data source "src =" http://www.bkjia.com/uploads/allimg/131228/1611494596-4.png "border =" 0 "/>
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:
650) this. width = 650; "width =" 644 "height =" 339 "title =" ActiveReports region report Product Information List Design Interface "style =" border-width: 0px; display: inline; "alt =" ActiveReports region report Product Information List Design Interface "src =" http://www.bkjia.com/uploads/allimg/131228/161149B54-5.png "border =" 0 "/>
2.3 run the program with the F5 key and get the following running result:
650) this. width = 650; "width =" 634 "height =" 484 "title =" ActiveReports report function display item Information List "style =" border-width: 0px; display: inline; "alt =" ActiveReports report function display item Information List "src =" http://www.bkjia.com/uploads/allimg/131228/1611492516-6.png "border =" 0 "/>
Source code:
Http://www.gcpowertools.com.cn/products/activereports_demo.htm
650) this. width = 650; "alt =" "src =" http://www.bkjia.com/uploads/allimg/131228/16114a936-7.png "/>
This article from the "grape city control blog" blog, please be sure to keep this source http://powertoolsteam.blog.51cto.com/2369428/1238659