Example #1
0
 private void DisplayReportList()
 {
     BenQGuru.eMES.ReportView.ReportViewFacade rptFacade = new BenQGuru.eMES.ReportView.ReportViewFacade(this.DataProvider);
     object[] objsEntry = rptFacade.GetAllRptViewEntry();
     if (objsEntry == null || objsEntry.Length == 0)
     {
         return;
     }
     BenQGuru.eMES.Domain.ReportView.RptViewEntry[] entryList = new BenQGuru.eMES.Domain.ReportView.RptViewEntry[objsEntry.Length];
     objsEntry.CopyTo(entryList, 0);
     for (int i = 0; i < entryList.Length; i++)
     {
         BenQGuru.eMES.Domain.ReportView.RptViewEntry entry = entryList[i];
         if (entry.ParentEntryCode == "" && FormatHelper.StringToBoolean(entry.Visible) == true)
         {
             string strArrRptName = "";
             string strArrRptId   = "";
             for (int n = 0; n < entryList.Length; n++)
             {
                 if (entryList[n].ParentEntryCode == entry.EntryCode &&
                     entryList[n].EntryType == ReportEntryType.Report &&
                     FormatHelper.StringToBoolean(entryList[n].Visible) == true &&
                     entryList[n].ReportID != "")
                 {
                     strArrRptName += "\"" + entryList[n].EntryName + "\",";
                     strArrRptId   += "\"" + entryList[n].ReportID + "\",";
                 }
             }
             if (strArrRptName.Length > 0)
             {
                 strArrRptName = strArrRptName.Substring(0, strArrRptName.Length - 1);
                 strArrRptId   = strArrRptId.Substring(0, strArrRptId.Length - 1);
             }
             string strRegName = "var arrRptName" + i.ToString() + "=new Array(" + strArrRptName + ");";
             string strRegId   = "var arrRptId" + i.ToString() + "=new Array(" + strArrRptId + ");";
             string strScript  = "<script language=javascript>\r\n" + strRegName + "\r\n" + strRegId + "\r\n" + "InitReportList(\"" + entry.EntryName + "\",arrRptName" + i.ToString() + ",arrRptId" + i.ToString() + ");\r\n</script>\r\n";
             this.ClientScript.RegisterStartupScript(typeof(string), "Rpt" + i.ToString(), strScript);
         }
     }
 }
Example #2
0
 private void DisplayDefaultReport()
 {
     if (this.Session["PublishedReportId"] == null || this.Session["PublishedReportId"].ToString() == "")
     {
         BenQGuru.eMES.ReportView.ReportViewFacade          rptFacade = new BenQGuru.eMES.ReportView.ReportViewFacade(this.DataProvider);
         BenQGuru.eMES.Domain.ReportView.RptViewUserDefault objDef    = (BenQGuru.eMES.Domain.ReportView.RptViewUserDefault)rptFacade.GetRptViewUserDefault(this.GetUserCode());
         if (objDef != null && objDef.DefaultReportID != "")
         {
             if (rptFacade.GetRptViewDesignMain(objDef.DefaultReportID) != null)
             {
                 string strScript = "<script language=javascript>document.getElementById('content').src='ReportView/FRptViewMP.aspx?reportid=" + objDef.DefaultReportID + "';</script>";
                 this.ClientScript.RegisterStartupScript(typeof(string), "DefaultReport", strScript);
             }
         }
     }
     else    // 显示刚发布的报表
     {
         string strScript = "<script language=javascript>document.getElementById('content').src='ReportView/FRptViewMP.aspx?reportid=" + this.Session["PublishedReportId"].ToString() + "';</script>";
         this.ClientScript.RegisterStartupScript(typeof(string), "DefaultReport", strScript);
         this.Session.Remove("PublishedReportId");
     }
 }