WEB开发网
开发学院数据库MSSQL Server 一步一步学习sqlserver BI--应用开发 阅读

一步一步学习sqlserver BI--应用开发

 2008-11-24 10:10:34 来源:WEB开发网   
核心提示: /** <summary>/// 填充按游戏和部门交叉统计的数据/// </summary>/// <param name="model"></param>/// <param name="timeKey&

/**//// <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,我做展现的时候,有部分就是用的这个家伙,修改了它的一些代码,感觉非常实用。

上一页  1 2 3 4 

Tags:学习 sqlserver BI

编辑录入:爽爽 [复制链接] [打 印]
赞助商链接