/// <summary> /// 下载固件版本分布数据 /// </summary> private void DownloadGJBB() { net91com.Stat.Core.PeriodOptions Period = GetQueryString("zhouqi").ToEnum <net91com.Stat.Core.PeriodOptions>(net91com.Stat.Core.PeriodOptions.LatestOneWeek); int excelsoft = Convert.ToInt32(GetQueryString("soft")); int excelplatform = Convert.ToInt32(GetQueryString("platform")); CheckHasRight(excelsoft, "Reports/TransverseReports/SoftGJBBTransverse.aspx"); List <Sjqd_StatUsersByGjbb> list = StatUsersByGjbbService.GetInstance().GetSoftGJBBTransverse(Period, Convert.ToInt32(UtilityService.GetInstance().GetMaxTimeCache(Period, ReportType.StatTerminationDistribution, CacheTimeOption.TenMinutes).ToString("yyyyMMdd")), excelsoft, (MobileOption)excelplatform); int all = list.Sum(p => p.UseCount); ThisResponse.ContentEncoding = System.Text.Encoding.GetEncoding("GBK"); AddHead("固件版本分布.xls"); ThisResponse.Write("固件版本\t用户数\t百分比\t\n"); string temp = string.Empty; list.ForEach(gjbb => { ThisResponse.Write((string.IsNullOrEmpty(gjbb.Gjbb) ? "未知" : gjbb.Gjbb) + "\t" + gjbb.UseCount + "\t" + (Convert.ToDecimal(gjbb.UseCount) / all * 100).ToString("0.00") + "\t\n"); }); ThisResponse.End(); }
private void DownResolution() { net91com.Stat.Core.PeriodOptions Period = GetQueryString("zhouqi").ToEnum <net91com.Stat.Core.PeriodOptions>(net91com.Stat.Core.PeriodOptions.LatestOneWeek); int excelsoft = Convert.ToInt32(GetQueryString("soft")); int excelplatform = Convert.ToInt32(GetQueryString("platform")); CheckHasRight(excelsoft, "Reports/TransverseReports/ResolutionReport.aspx"); List <Resolution> list = TerminalService.GetInstance().GetResolutions(excelsoft, excelplatform, (int)Period, Convert.ToInt32(UtilityService.GetInstance().GetMaxTimeCache(Period, ReportType.StatTerminationDistribution, CacheTimeOption.TenMinutes).ToString("yyyyMMdd")) ); ThisResponse.ContentEncoding = System.Text.Encoding.GetEncoding("GBK"); AddHead("分辨率分布.xls"); ThisResponse.Write("分辨率\t用户数\t百分比\t\n"); string temp = string.Empty; int allcount = list.Sum(p => p.UseCount); list.ForEach(resol => { ThisResponse.Write((string.IsNullOrEmpty(resol.ResolutionStr) ? "未知分辨率" : resol.ResolutionStr) + "\t" + string.Format("{0:N0}", (resol.UseCount)) + "\t" + (Convert.ToDecimal(resol.UseCount) / allcount * 100).ToString("0.00") + "\t\n"); }); ThisResponse.End(); }
protected void WriteString(string result) { ThisResponse.HeaderEncoding = Encoding.UTF8; ThisResponse.Write(result); ThisResponse.End(); }