I. Overview
1)A report is commonly used for data calculation, data statistics and data presentation.
2)This article takes an annual income and expenditure statement as an example to introduce how FineReport helps you to do data calculation, data statistics and data presentation, as well as FineReport’s other functions such as sort order, intra-group calculation and typical formulas.
3)This article also introduces how to design a simple page format.
II. Design a basic report
1. Create a new data set
1) Click [+] and select [DB Query]
2) In the pop-up DB Query window, select [FRDemo] and enter the following SQL statement
select * from Annual
2. Design the report
1) Input headers in the cell range C2: I2:
Actual Cost, Budget Cost, Actual Expenditure, Budgeted Expenditure, Actual Income, Budgeted Income, Actual Profit
2) Drag datasets into cells
Drag [Region] into B3.
Drag [Month], [Actual Cost], [Budget cost], [Actual expenditure], [Budgeted expenditure], [Actual income], [Budgeted income] into the cell range B4: H4.
3) Preview
III. Add formulas
1. Add summary formulas into the cell range C3:H3
SUM(C4), SUM(D4), SUM(E4), SUM(F4), SUM(G4), SUM(H4)
2. Add formulas in I3 and I4
Formula: Actual Profit = Actual Income - Actual Expenditure - Actual Cost
I3: G3 - E3 - C3
I4: G4 - E4 - C4
3. Preview
VI. Set a parent cell
1. Click B4
2. In the right-hand pane, select [Expand] and set B3 as the left parent cell.
3. Preview
VII. Add a Tree Node button
1. Select B3
2. Add a widget and configure its settings in the right-hand Widget Setting pane as follows
Select Widget: Button
Button Type: Tree Node Button
3. Preview
VIII. Set conditional formatting
1. Select I4
2. Take the following steps to set the property: click [+], and select [foreground], [Current Row] and [Red]
3. Enter the formula: count(B4[!0]{B3=$B3&&I4>$I4})=0
Meaning: Get the highest profits within the region by calculation and mark it in red
4. Preview
IX. Add regional statistics
1. Select B5
2. Combine the cell range [B5:I5]
3. Enter the following formula: "Profitable Months: "+COUNT(B4{I4>0})
Meaning: Profitable months within the region
4. Set B3 as the left parent cell of B5
5. Preview
X. Set the sort order
1. Select B4
2. Select [Insert Cell Element] and [Advanced]
3. Sort: Ascending
4. Formula
switch($$$,"Jan",1,"Feb",2,"Mar",3,"Apr",4,"May",5,"Jun",6,"July",7,"Aug",8,"Sep",9,"Oct",10,"Nov",11,"Dec",12)