ActiveReports Report Application tutorial (14) --- data visualization

Source: Internet
Author: User

ActiveReports provides a wide range of data visualization solutions. Users can display data in an image to make the report data more visual and easy to understand. ActiveReports reports provide most common 2D and 3D chart types, including XY tables and financial charts. By using the custom functions of the chart control, such as modifying the coordinate axis, graph note, and legend, you can create any chart effects you need. In addition to common chart types, it also provides a wide range of data visualization controls such as waveform charts, data entries, and icons. This section mainly shows the use of the waveform chart control nested in the table control to display the trend of monthly sales details, as well as the use of the data bar control and graphical control to show the completion of annual sales performance.

1. Create a report file

Create an application named rptSalesDashboard. the ActiveReports report file of rdlx uses the ActiveReports page report as the project template. After the report is created, select convert to continuous page layout (CPL) Report from the report menu items of, converts a fixed-page report to a continuous report.

2. Open the report resource manager and create a report data source according to the following information:
Name: NWind_CHS
Type: Micorsoft OleDb Provider
Ole db Provider: Microsoft. Jet. OLEDB.4.0
Server or file name: Data \ NWind_CHS.mdb

3. Add a dataset

Right-click the new NWind_CHS data source and select the Add dataset menu item to add the following two datasets:

General-Name: SalesByCategory

Query-query:

Select

Category. category name, t .*

from

(

SELECT

DATEPART ("m", Order. Order Date)

AS

Subscription month, category. Category ID,

SUM

(Order details. Quantity)

AS

Sales Volume

FROM

(Order

INNERJOIN

Order Details

ON

Order. Order ID = order details. Order ID)

INNERJOIN

Product

ON

Order details. Product ID = product. Product ID)

INNERJOIN

Category

ON

Product. Category ID = category. Category ID

WHERE

DATEDIFF ("yyyy", Order. Order Date, '2017-01-01 ') = 0

GROUPBY

DATEPART ("m", Order. Order Date), category. Category ID, category. category name

ORDERBY

DATEPART ("m", Order. Order Date), category. Category ID, category. category name)

as

T

INNERJOIN

Category

ON

T. Category ID = category. Category ID

 

General-Name: SalesBySupplier

Query-query:

SELECT

Supplier. Company Name,

First

(Product. Product Name)

AS

Product Name,

SUM

(Order details. Quantity)

AS

Sales volume,

SUM

(Order details. unit price * Order details. Quantity)

AS

Sales amount

FROM

Order Details

INNERJOIN

(Product

INNERJOIN

Supplier

ON

Product. Supplier ID = supplier. Supplier ID)

ON

Order details. Product ID = product. Product ID

GROUPBY

Supplier. company name, product. Product ID, product. Product Name

ORDERBY

Supplier. Company Name;

 

4. design the report page

4.1 Add the Table control from the Visual Studio toolbox to the report design interface, and set the properties of the Table control according to the following list:

General-dataset Name: SalesByCategory
Detailed data grouping: Name: tablew.detail_group
Group expression: = [Category ID]

 

The controls used in each cell and their attributes are as follows:

Cell Widget Attribute
Cells [3, 1] TextBox Value: = Fields! Category name. Value
Cells [3, 2] TextBox Value: = Fields! Category name. Value
Cells [3, 3] Sparkline SeriesValue: = Fields! Sales volume. Value
Range. Backdrop. GradientStyle: VerticalCenter
Range. Backdrop. FillColor: Gray
Range. Backdrop. GradientEndColor: = Theme. Colors! Accent3
Range. LowerBound: = Fields! Sales volume. Value <Avg (Fields! Sales volume. Value, "SalesByCategory") * 0.8
Range. UpperBound: = Fields! Sales volume. Value> Avg (Fields! Sales volume. Value, "SalesByCategory") * 1.5
SparklineType: Columns
Cells [3, 4] Bullet BestValue: 2.5
Range1Boundary: 0.85
Range2Boundary: 1.65
TargetStyle. LineColor: Brown
TargetStyle. LineWidth: 5pt
TargetValue: 1
TickMarks: Inside
TicksStyle. LineColor: Gray
TicksStyle. LineWidth: 1pt
Value: = Fields! Sales volume. Value/Avg (Fields! Sales volume. Value, "SalesByCategory ")
ValueColor: = Theme. Colors! HyperlinkFollowed
WorstValue: 0
Cells [4, 4] Image MIMEType: image/png
Source: Database
Value: = IconSet ("Arrows", Fields! Sales volume. Value/Avg (Fields! Sales volume. Value, "SalesByCategory") >=1.5, Fields! Sales volume. Value/Avg (Fields! Sales volume. Value, "SalesByCategory") >=1.2, Fields! Sales volume. Value/Avg (Fields! Sales volume. Value, "SalesByCategory") >=1.0, Fields! Sales volume. Value/Avg (Fields! Sales volume. Value, "SalesByCategory") >=0.8, Fields! Sales volume. Value/Avg (Fields! Sales volume. Value, "SalesByCategory") <0.8)

 

4.2 Add the Table control from the Visual Studio toolbox to the report design interface, and set the properties of the Table control according to the following list:

General-dataset Name: SalesBySupplier
Sort: Expression: = [sales volume]
Direction: Descending
Detailed data grouping: Name: tablew.detail_group
Group expression: = [Category ID]
Filter: Expression: = [sales volume]
Operator: TopN
Value: 10

The controls used in each cell and their attributes are as follows:

Cell Widget Attribute
Cells [3, 1] TextBox Value: = Fields! Product Name. Value
Cells [3, 2] TextBox Value: = Fields! Company Name. Value
Cells [3, 3] TextBox = Fields! Sales volume. Value
Cells [3, 4] Bullet BestValue: 1.6
LabelFormat: 0%
Range1Boundary: 0.4
Range2Boundary: 0.8
TargetShape: Dot
TargetStyle. LineColor: Brown
TargetStyle. LineWidth: 3pt
TargetValue: 0.6
TickMarks: Inside
TicksStyle. LineColor: LightGray
TicksStyle. LineWidth: 1pt
Value = Fields! Sales volume. Value/Avg (Fields! Sales volume. Value, "SalesBySupplier ")
ValueColor: = Theme. Colors! HyperlinkFollowed
WorstValue: 0
Cells [4, 4] Image MIMEType: image/png
Source: Database
Value: = IconSet ("Flags", Fields! Sales volume. Value/Avg (Fields! Sales volume. Value, "SalesBySupplier")> 1.2, Fields! Sales volume. Value/Avg (Fields! Sales volume. Value, "SalesBySupplier")> 1.0, Fields! Sales volume. Value/Avg (Fields! Sales volume. Value, "SalesBySupplier") <= 1.0, False, False)

The final design results are as follows:

650) this. width = 650; "width =" 644 "height =" 395 "title =" ActiveReports report function display sales data console "style =" border-width: 0px; display: inline; "alt =" ActiveReports report function display sales data console "src =" http://www.bkjia.com/uploads/allimg/131228/20425064Q-0.png "border =" 0 "/>

5. Run the program

650) this. width = 650; "width =" 644 "height =" 495 "title =" ActiveReports report function display data visualization "style =" border-width: 0px; display: inline; "alt =" ActiveReports report function display data visualization "src =" http://www.bkjia.com/uploads/allimg/131228/2042501132-1.png "border =" 0 "/>

Online Demo and source code:


Http://www.gcpowertools.com.cn/products/activereports_demo.htm
650) this. width = 650; "width =" 644 "height =" 508 "title =" ActiveReports report function display "style =" border-width: 0px; display: inline; "alt =" ActiveReports report function display "src =" http://www.bkjia.com/uploads/allimg/131228/2042502C7-2.png "border =" 0 "/>

This article from the "grape city control blog" blog, please be sure to keep this source http://powertoolsteam.blog.51cto.com/2369428/1255872

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.