FineReport learning (C) - Dynamic compartment operation

table of Contents

  1, the entry operation described dynamic compartment
  2, entry small case
  3, "more", "accounting", "chain" action
  4 "accumulated layer by layer" and "cross-layer integrated" operating
  5 conditions are summarized

1. Get started operations dynamic compartment

  • First, a formula, the formula: "display column [column display parent column: Offset]." At this point you do not know what is the meaning of this formula, there are currently impression on the line, the following learning you will understand.
  • Dynamic compartment operation is similar to Math EXCEL table, you enter the equivalent of "= ..." such a formula in a cell. The definition is not very good narrative, through the following case illustrates, more intuitive.

2, the entry of small case

First, create a regular report -> use sql to import selected data set

select strftime('%m',订购日期) as 月份,应付金额 from 订单
where strftime('%Y',订购日期) = '2011'

Results are as follows:
Here Insert Picture Description
followed by a style template designs and binding data.
Here Insert Picture Description
Results preview
Here Insert Picture Description

① for the first operation a dynamic compartment
-- 公式: 显示列[显示列的父列:偏移量]
=b2[a2:-1]
-- 注意:-1表示的是偏移量。
-- 当偏移量为正数,表示正着数,偏移量分别是1,2,3...
-- 当偏移量为正数,表示倒着数,偏移量分别是-1,-2,-3...    

In any cell, enter the following formula
Here Insert Picture Description
after storage for preview effect
Here Insert Picture Description

② calculating a second dynamic compartment
-- 公式: 显示列[显示列的父列:偏移量]
=b2[!0]

In any cell, enter the following formula
Here Insert Picture Description
after storage for preview effect
Here Insert Picture Description
this case the cell, to scale
Here Insert Picture Description
and set retention digital bits, to two decimal
Here Insert Picture Description
save Again, a preview effect
Here Insert Picture Description

③ third compartment dynamic operation: a digital filter to remove some
-- 公式: 显示列[显示列的父列:偏移量]
=b2[!0]{a2!=3}

In any cell, enter the following formula, is adjusted to scale, set the scale to two significant figures retained
Here Insert Picture Description
after storage for preview effect
Here Insert Picture Description

3, "more", "accounting", "chain" operation

select strftime('%m',订购日期) as 月份,应付金额 
from 订单
where strftime('%Y',订购日期) = '2011'

Result of the SQL statement to the data source, complete the following requirements.
Here Insert Picture Description

① compare
  • Each value of the amount due, compared with the first value, make a difference operation.

First, create a common reporting template, and then import the data.
Here Insert Picture Description
Then, report design style, and then bind the data source. The "amount payable" two significant figures.
Here Insert Picture Description
Then, the "amount due" to the summary summation.
Here Insert Picture Description
Then again, add the "Compare" column. Because the difference in each value is the first value of the following requirements, it is necessary to write equation (Equation as shown). And "comparison" column to two significant figures.
Here Insert Picture Description
After saving, the effect is as follows preview
Here Insert Picture Description

② accounting
  • Proportion, by definition is a separate data calculation, the proportion occupied in the total amount.

On the basis of the above operation, adding "accounting" column. Function comes directly proportion operation is relatively simple, as follows.
Here Insert Picture Description
Then adjust the "accounting" format column, save the format "percent", and two significant digits.
Here Insert Picture Description
After saving, the effect is as follows preview
Here Insert Picture Description

③ chain
  • Chain is a monthly rate calculation data with the previous month.

On the basis of the above operation, adding "chain" column. Directly own function chain, relatively simple, operation is as follows.
Here Insert Picture Description
Then adjust the "chain" column format stored in the format of "percent", and two significant digits.
Here Insert Picture Description
After saving, the effect is as follows preview
Here Insert Picture Description

4, "accumulated layer by layer" and "cross-layer integrated" operation

select strftime('%Y',订购日期) as 年份, strftime('%m',订购日期) as 月份,应付金额 
from 订单
where 年份 in('2011','2010')

Result of the SQL statement to the data source, complete the following requirements.
Here Insert Picture Description

  • Accumulated in layers: layer by layer in the packet report is accumulated in each group, respectively, each with the upper hierarchy data is added to obtain the cumulative results of this layer, and cut off by year.
  • The cumulative cross-layer: cross-layer accumulation, not cut off by year, and demand has been accumulated.

First, create a common reporting template, and then import the data.
Here Insert Picture Description
Then, report design style, and then bind the data source. The "amount payable" two significant figures.
Here Insert Picture Description
Then, the "amount due" to the summary summation.
Here Insert Picture Description
Then add a "layer by layer the accumulated" column and the "cumulative cross-layer" column. We are all directly own official functions, operations, as shown. Add to "accumulated layer by layer" column, the effect is as follows:
Here Insert Picture Description
add "cumulative cross-layer" column, the effect is as follows:
Here Insert Picture Description
Next, the "accumulated layer by layer" column and the "cumulative cross-layer" column, respectively, to retain two decimal places.
Here Insert Picture Description
Once saved, the effect preview
Here Insert Picture Description

5, conditions are summarized

The red block belonging conditions are summarized.
Here Insert Picture Description
Writing the formula: = COUNT (C2 [0!] {A2 = Katex the parse error: the Expected 'the EOF', GOT '&' AT position. 4: A2 & & C2> 2500}): C2 Extended ... A2 && C2> 2500}, {} filters inside, a2 = $ a2 represents a group in the current A3; c2> 2500 represents the total amount equal to or greater than 2500.

count(c2[!0]{a2=$a2 &&c2>2500})

First, we enter the above formula in the cell
Here Insert Picture Description
then set the cell's parent cell is left [year], because we are in accordance with the [annual] packet statistics.
Here Insert Picture Description
After saving, a preview of the effect
Here Insert Picture Description

Published 114 original articles · won praise 506 · views 90000 +

Guess you like

Origin blog.csdn.net/weixin_41261833/article/details/105208555