protected void CreateReport() { string repName = "RepDs_" + m_rptID.ToString(); /* DateTime dtBegin=DateTime.Now.AddMonths(-10); * DateTime dtEnd=DateTime.Now ;*/ ReportDoc rdc = new ReportDoc(Config.DbConnectionString, Utils.GetInt(Config.GetConfigValue("SQLCommandTimeout")), DBase); GetDataSet(rdc, repName); if (Config.GetConfigValue("TestRegime") == "true") { Log.Write(this, Config.GetConfigValue("ReportFilesPath") + "\\" + GetReportName()); if (ds != null) { Log.Write(this, "Tables : " + ds.Tables.Count.ToString()); if (ds.Tables.Count > 0) { Log.Write(this, "Table Name : " + ds.Tables[0].TableName); Log.Write(this, "Rows : " + ds.Tables[0].Rows.Count.ToString()); } } else { Log.Write(this, "ds is NULL"); } } CrystalDecisions.CrystalReports.Engine.ReportDocument r_d = rdc.GetReportDocument(Config.GetConfigValue("ReportFilesPath") + "\\" + GetReportName(), ds); TableLogOnInfo logOnInfo = new TableLogOnInfo(); logOnInfo = r_d.Database.Tables[ds.Tables[0].TableName].LogOnInfo; /* // Set the connection information for the table in the report. * logOnInfo.ConnectionInfo.ServerName = rdc.m_DBLogonInfo.Server ; * logOnInfo.ConnectionInfo.DatabaseName =rdc.m_DBLogonInfo.Database; * logOnInfo.ConnectionInfo.UserID = rdc.m_DBLogonInfo.User ; * logOnInfo.ConnectionInfo.Password = rdc.m_DBLogonInfo.Password ; * logOnInfo.TableName = ds.Tables[0].TableName;*/ CrView.LogOnInfo.Add(logOnInfo); if (Config.GetConfigValue("TestRegime") == "true") { Log.Write(this, "LogOn Info was set :" + logOnInfo.ToString()); } CrView.ReportSource = r_d; }
private bool GetDataSet(ReportDoc rdc, string repName) { object [] ob = null; if (Session[repName] != null) { ds = (DataSet)Session[repName]; return(true); } switch (m_rptID) { case 1: ds = rdc.CreateReportSource("wntUsersSignup", "UsersSignup", new object[] { "@dtBegin", m_dtb, "@dtEnd", m_dte, "@NoBots", m_noBots }); break; case 2: ob = new object[] { "@dtBegin", m_dtb, "@dtEnd", m_dte, "@CurrencyPlay", m_chNM?1:0, "@CurrencyMoney", m_chM?1:0, "@UserID", m_uid, "@NoBots", m_noBots }; ds = rdc.CreateReportSource("wntHandsPlayed", "HandsPlayed", ob); break; case 7: ob = new object[] { "@dtBegin", m_dtb, "@dtEnd", m_dte, "@UserID", m_uid, "@NoBots", m_noBots }; ds = rdc.CreateReportSource("wntHandsPlayedByUser", "HandsPlayedByUser", ob); break; case 8: ob = new object[] { "@dtBegin", m_dtb, "@dtEnd", m_dte, "@UserID", m_uid, "@NoBots", m_noBots }; ds = rdc.CreateReportSource("wntTimeSpendByUser", "TimeSpendByUser", ob); break; case 9: ob = new object[] { "@dtBegin", m_dtb, "@dtEnd", m_dte, "@UserID", m_uid, "@NoBots", m_noBots }; ds = rdc.CreateReportSource("wntUserTransations", "UserTransations", ob); break; case 11: int crType = 2; if (m_chNM) { crType = 1; } else if (m_chM) { crType = 2; } ob = new object[] { "@dtBegin", m_dtb, "@dtEnd", m_dte, "@CurrencyTypeID", crType, "@UserID", m_uid, "@NoBots", m_noBots }; ds = rdc.CreateReportSource("wntMostWinsForPlayer", "MostWinsForPlayer", ob); break; case 12: ob = new object[] { "@dtBegin", m_dtb, "@dtEnd", m_dte, "@CurrencyPlay", m_chNM?1:0, "@CurrencyMoney", m_chM?1:0, "@NoBots", m_noBots }; ds = rdc.CreateReportSource("wntMostActivePlayers", "MostActivePlayers", ob); break; case 13: ds = rdc.CreateReportSource("wntNotPlayedPlayers", "NotPlayedPlayers", new object[] { "@dtBegin", m_dtb, "@dtEnd", m_dte, "@NoBots", m_noBots }); break; case 14: ds = rdc.CreateReportSource("wntMostPopularGames", "MostPopularGames", new object[] { "@dtBegin", m_dtb, "@dtEnd", m_dte, "@NoBots", m_noBots }); break; case 15: ds = rdc.CreateReportSource("wntMostPopularGames", "LeastPopularGames", new object[] { "@dtBegin", m_dtb, "@dtEnd", m_dte, "@asLeast", 1, "@NoBots", m_noBots }); break; case 16: ds = rdc.CreateReportSource("rptClientSessionHistoryWithLoginNames", "ClientSessionHistoryWithLoginNames", new object[] { "@dtBegin", m_dtb, "@dtEnd", m_dte, "@NoBots", m_noBots, "@LoginNames", m_strloginname, "@UIDs", m_struid }); break; case 17: ds = rdc.CreateReportSource("rptCurrentBalanceQuery", "CurrentBalance", new object[] { "@NoBots", m_noBots, "@CurrencyPlay", m_chNM?1:0, "@CurrencyMoney", m_chM?1:0, "@LoginNames", m_strloginname, "@UIDs", m_struid }); break; case 18: ds = rdc.CreateReportSource("rptLastLoginTimeQuery", "LastLoginTime", new object[] { "@NoBots", m_noBots, "@LoginNames", m_strloginname, "@UIDs", m_struid }); break; case 19: ds = rdc.CreateReportSource("rptNumberPIDSonMachines", "NumberPIDsonMachines", new object[] { "@NoBots", m_noBots, "@LoginNames", m_strloginname, "@UIDs", m_struid, "@dtBegin", m_dtb, "@dtEnd", m_dte, "@MACAddress", m_strmacaddress }); break; case 20: ds = rdc.CreateReportSource("rptSpecificMachineHistory", "SpecificMachineHistory", new object[] { "@NoBots", m_noBots, "@LoginNames", m_strloginname, "@UIDs", m_struid, "@dtBegin", m_dtb, "@dtEnd", m_dte, "@MACAddress", m_strmacaddress }); break; case 21: ds = rdc.CreateReportSource("rptCollusionHandsPlayed", "CollusionHandsPlayed", new object[] { "@NoBots", m_noBots, "@LoginNames", m_strloginname, "@UIDs", m_struid, "@dtBegin", m_dtb, "@dtEnd", m_dte }); break; case 22: ds = rdc.CreateReportSource("rptPlayerGameHistory", "PlayerGameHistory", new object[] { "@NoBots", m_noBots, "@LoginNames", m_strloginname, "@UIDs", m_struid, "@dtBegin", m_dtb, "@dtEnd", m_dte }); break; case 23: ds = rdc.CreateReportSource("rptDailyRanksIndividual", "DailyRanksIndividual", new object[] { "@NoBots", m_noBots, "@LoginNames", m_strloginname, "@UIDs", m_struid, "@dtBegin", m_dtb, "@dtEnd", m_dte, "@CurrencyPlay", m_chNM?1:0, "@CurrencyMoney", m_chM?1:0 }); break; default: return(false); } Session[repName] = ds; return(true); }
private int OnLineReport(int mID) { int ret = -1; DateTime m_dtb = DateTime.Now; DateTime m_dte = DateTime.Now; DataSet ds; lbResult.Text = ""; int uID = 0; string dtPref = "From " + txdtFrom.Value + " to " + txdtTo.Value; try { if (txdtFrom.Disabled == false) { m_dtb = DateTime.Parse(txdtFrom.Value.Trim()); m_dte = DateTime.Parse(txdtTo.Value.Trim()); } if (txPID.Disabled == false) { uID = Utils.GetInt(txPID.Value); if (uID == 0 && txLoginName.Value != String.Empty) { uID = DBase.ExecuteReturnInt("wntGetUserID", new object[] { "@LoginName", txLoginName.Value }); } } } catch (Exception ex) { Log.Write(this, ex); return(1); } ReportDoc rdc = new ReportDoc(Config.DbConnectionString, 600, DBase); switch (mID) { case 3: int Intr = Utils.GetInt(txDiscretCount.Value); if (Intr <= 0) { return(2); } int iType = Utils.GetInt(slIntrType.Value); ds = rdc.CreateReportSource("wntConcurrentPlayers", "ConcurrentPlayers", new object[] { "@dtBegin", m_dtb, "@dtEnd", m_dte, "@Interval", Intr, "@IntervalType", iType, "@NoBots", chnoBots.Checked?1:0 }); if (ds.Tables[0].Rows.Count > 0) { lbResult.Text = dtPref + "<br>Maximum concurrent players: " + ds.Tables[0].Rows[0]["Maximum"].ToString() + "<br>Minimum concurrent players: " + ds.Tables[0].Rows[0]["Minimum"].ToString(); } else { lbResult.Text = dtPref + " No data"; } ret = 0; break; case 5: ds = rdc.CreateReportSource("wntBiggestHand", "BiggestHand", new object[] { "@dtBegin", m_dtb, "@dtEnd", m_dte, "@NoBots", chnoBots.Checked?1:0 }); if (ds.Tables[0].Rows.Count > 0) { lbResult.Text = dtPref + "<br>Biggest Chip Hand ID: " + ds.Tables[0].Rows[0]["HandID"].ToString() + "<br>Amount: " + ds.Tables[0].Rows[0]["Amount"].ToString(); } else { lbResult.Text = dtPref + " Biggest Chip Hand ID: 0 , Amount: 0"; } ret = 0; break; case 6: ds = rdc.CreateReportSource("wntUsersSignupAndPlay", "UsersSignupAndPlay", new object[] { "@dtBegin", m_dtb, "@dtEnd", m_dte, "@NoBots", chnoBots.Checked?1:0 }); if (ds.Tables[0].Rows.Count > 0) { lbResult.Text = dtPref + "<br>Players registered: " + ds.Tables[0].Rows[0]["Registered"].ToString() + "<br>Played a game: " + ds.Tables[0].Rows[0]["Played"].ToString(); } else { lbResult.Text = dtPref + " Registered: 0 , Played a game: 0"; } ret = 0; break; case 8: ds = rdc.CreateReportSource("wntTimeSpendByUser", "TimeSpendByUser", new object[] { "@dtBegin", m_dtb, "@dtEnd", m_dte, "@UserID", uID, "@NoBots", chnoBots.Checked?1:0 }); if (ds.Tables[0].Rows.Count > 0) { lbResult.Text = dtPref + "<br>Average Time Spent on the System is " + ds.Tables[0].Rows[0]["SpentTime"].ToString() + " minutes per user "; } else { lbResult.Text = dtPref + "<br>Average Time Spent on the System is 0"; } ret = 0; break; } return(ret); }