Reporting Services中如何对数据进行分页合计?

Report services中不直接支持分页合计,实现这个功能得加些vb code(report code).
  • 右键report区域(BIDS中最外层的黄色区域),选择report properties;打开code tab.
  • 加入如下代码

public shared Dim _rowCount As Int32=0
public shared Dim _sum as Int32=0

public Function AddToRowCount() as Int32
 _rowCount = _rowCount + 1
 return _rowCount
End Function

public Function AddToSum(ByVal quantity as Int32) as Int32
 return quantity
End Function

public function GetSum() as Int32
 Dim currentSum= _sum
 return currentSum
end function

public Function GetCurrentCountAndReset() As Int32
  Dim currentRowCount = _rowCount
  _rowCount = 0
  Return currentRowCount
End Function

  • 实现row index.


  • 实现quantity sum.


在Footer加入textbox, 并设置表达式为=Code.GetSum

This entry was posted in 计算机与 Internet. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s