一步一步学习sqlserver BI--应用开发
2008-11-24 10:10:34 来源:WEB开发网/**//// <summary>
/// 填充按游戏和部门交叉统计的数据
/// </summary>
/// <param name="model"></param>
/// <param name="timeKey"></param>
/// <param name="depKey"></param>
public void Fill(GameByDepartmentTotalModel model,DateTime time,int timeKey,string dep,int depKey)
{
CellSet cellSet = new GameByDepartmentTotalDac().Count(timeKey, depKey);
GameByDepartmentTotalModel.FactGameTradeDataRow newRow;
for (int i = 1; i < cellSet.Axes[1].Positions.Count; i++)
{
newRow = model.FactGameTradeData.NewFactGameTradeDataRow();
newRow.Game = cellSet.Axes[1].Positions[i].Members[0].Caption;
newRow.Department = dep;
newRow.TradeDate = time;
for (int j = 0; j < cellSet.Axes[0].Positions.Count; j++)
{
if (cellSet.Axes[0].Positions[j].Members[0].Name == "[Measures].[Total Orders Count]")
{
newRow.TotalOrders = TypeParse.ToInt32(cellSet[j, i].FormattedValue);
}
else if (cellSet.Axes[0].Positions[j].Members[0].Name == "[Measures].[Total Amount Count]")
{
newRow.TotalAmount = TypeParse.ToInt32(cellSet[j, i].FormattedValue);
}
else if (cellSet.Axes[0].Positions[j].Members[0].Name == "[Measures].[Total Money Count]")
{
newRow.TotalMoney = TypeParse.ToDecimal(cellSet[j, i].FormattedValue);
}
else if (cellSet.Axes[0].Positions[j].Members[0].Name == "[Measures].[Un Paid Cancel Amount Count]")
{
newRow.UnPaidCancelAmount = TypeParse.ToInt32(cellSet[j, i].FormattedValue);
}
else if (cellSet.Axes[0].Positions[j].Members[0].Name == "[Measures].[Un Paid Cancel Money Count]")
{
newRow.UnPaidCancelMoney = TypeParse.ToDecimal(cellSet[j, i].FormattedValue);
}
else if (cellSet.Axes[0].Positions[j].Members[0].Name == "[Measures].[Paid Cancel Amount Count]")
{
newRow.PaidCancelAmount = TypeParse.ToInt32(cellSet[j, i].FormattedValue);
}
else if (cellSet.Axes[0].Positions[j].Members[0].Name == "[Measures].[Paid Cancel Money Count]")
{
newRow.PaidCancelMoney = TypeParse.ToDecimal(cellSet[j, i].FormattedValue);
}
}
model.FactGameTradeData.AddFactGameTradeDataRow(newRow);
}
}
好了,目前为止,我们已经从多维数据库里面返回我们需要统计的数据了,爱怎么展现就怎么展现吧。数据列表,柱状图,曲线图,饼状图等等。在以后的章节中我会介绍一款开源的非常成熟的图形控件ZedGraph,我做展现的时候,有部分就是用的这个家伙,修改了它的一些代码,感觉非常实用。
- ››sqlserver安装和简单的使用
- ››SqlServer触发器、存储过程和函数
- ››SQLServer建立交叉表查询
- ››SqlServer强制断开数据库连接的方法
- ››SQLServer 2005 海量数据解决方案
- ››SQLServer 2008数据库查看死锁、堵塞的SQL语句
- ››SqlServer 插入多条数据
- ››SQLServer 2008 R2导出的SQL文件中没有数据
- ››SQLSERVER通过游标查询两个数据表共有字段名组合成...
- ››sqlserver2008实现拼音首字母和随机n位数的生成
- ››SQLServer与Java数据类型对应表
- ››Bing地图得到诺基亚助力
更多精彩
赞助商链接