public void OpenView(ClientReportContext context, string viewid, Dictionary <string, object> message) { if (message.ContainsKey("cdimcode") && string.IsNullOrEmpty((string)message["cdimcode"])) { return; } PleaseChangeToSilverlight(); return; _context = context; _context.bPortalView = true; string reportid = null; string filterid = null; string filterclass = null; string classname = null; using (SqlDataReader reader = SqlHelper.ExecuteReader(ClientReportContext.Login.UfMetaCnnString, "select uap_report.filterid,uap_report.filterclass,uap_report.classname,uap_report.id as reportid from uap_report inner join uap_reportview on uap_report.id=uap_reportview.reportid where uap_reportview.id='" + viewid + "'")) { if (reader.Read()) { reportid = reader["reportid"].ToString(); filterid = reader["filterid"].ToString(); filterclass = reader["filterclass"].ToString(); classname = reader["classname"].ToString(); } } _context.Initialize(reportid, ReportStates.Browse, null, false); _context.FilterArgs.InitClass(null, filterid, filterclass, classname); _context.ViewID = viewid; RefreshView(true, message); }
public string OpenView(ClientReportContext context, string instanceid) { try { _context = context; _context.bPortalView = true; OpenView(instanceid); #region waste //_context.ViewID = "43866c9f-f43c-4f60-be38-5a6abfb847f5"; //EngineHelper eh = CreateEngine(); //CreateArgs e = new CreateArgs(); //e.bgetsql = true; //e.filterflag = ""; //eh.Engine.LoadFormat(null, _context.ViewID, e.filterflag, e.gsid, e.rawtable, e.basetable, null); //ParameterizedThreadStart ts = new ParameterizedThreadStart(eh.CreateReport); //Thread t = new Thread(ts); //t.Start(e); #endregion } catch (Exception ex) { ShowErrorMessage(ex.Message); } return(_title); }
private void InnerPreLoad(object login) { try { ClientReportContext context = new ClientReportContext(login); ClientReportContext.Port = Cryptography.LoginInfo.ProtocolPort["RePt"].ToString(); ClientReportContext.Protocal = Cryptography.LoginInfo.ProtocolPort["RePr"].ToString(); DefaultConfigs.RegChannel(ClientReportContext.Login.AppServer); ReportEngine re = DefaultConfigs.GetRemoteEngine(ClientReportContext.Login, ReportStates.Browse); re.PreLoad(); new ReportViewControl(); new GridReportControl(); AppDomain.CurrentDomain.Load("Infragistics2.Win.UltraWinGrid.v10.2"); AppDomain.CurrentDomain.Load("Infragistics2.Shared.v10.2"); AppDomain.CurrentDomain.Load("Infragistics2.Win.v10.2"); AppDomain.CurrentDomain.Load("Infragistics2.Win.UltraWinDock.v10.2"); AppDomain.CurrentDomain.Load("Infragistics2.Win.UltraWinDataSource.v10.2"); AppDomain.CurrentDomain.Load("Infragistics2.Win.UltraWinChart.v10.2"); AppDomain.CurrentDomain.Load("Infragistics2.Win.UltraWinToolbars.v10.2"); AppDomain.CurrentDomain.Load("Infragistics2.Win.SupportDialogs.v10.2"); //AppDomain.CurrentDomain.Load("Infragistics2.Win.UltraWinGrid.v6.3"); //AppDomain.CurrentDomain.Load("Infragistics2.Shared.v6.3"); //AppDomain.CurrentDomain.Load("Infragistics2.Win.v6.3"); //AppDomain.CurrentDomain.Load("Infragistics2.Win.UltraWinDock.v6.3"); //AppDomain.CurrentDomain.Load("Infragistics2.Win.UltraWinDataSource.v6.3"); //AppDomain.CurrentDomain.Load("Infragistics2.Win.UltraWinChart.v6.3"); //AppDomain.CurrentDomain.Load("Infragistics2.Win.UltraWinGrid.v6.1"); //AppDomain.CurrentDomain.Load("Infragistics2.Shared.v6.1"); //AppDomain.CurrentDomain.Load("Infragistics2.Win.v6.1"); //AppDomain.CurrentDomain.Load("Infragistics2.Win.UltraWinDataSource.v6.1"); //AppDomain.CurrentDomain.Load("Infragistics2.Win.UltraWinToolbars.v6.1"); AppDomain.CurrentDomain.Load("UFIDA.U8.UAP.UI.Runtime.Common"); AppDomain.CurrentDomain.Load("UFIDA.U8.UAP.UI.Runtime.View"); AppDomain.CurrentDomain.Load("UFIDA.U8.UAP.UI.Runtime.Controller"); AppDomain.CurrentDomain.Load("UFIDA.U8.UAP.UI.Runtime.Model"); AppDomain.CurrentDomain.Load("UFIDA.U8.UAP.UI.Runtime.List"); AppDomain.CurrentDomain.Load("UFIDA.U8.UAP.UI.Runtime.BusinessObject"); System.Diagnostics.Trace.WriteLine("Report preload end"); } catch (Exception e) { System.Diagnostics.Trace.WriteLine(e.Message); } }
public override Control CreatePartControl(IEditorPart part, IEditorInput input) { StringBuilder sb = new StringBuilder(); try { this.ReportEditorPart = part; this.ReportFormInput = input as ReportFormInput; sb.Append("CreatePartControl end 1"); this.ParseStaticReportInfo(); string reportId = this.GetObjectId(); sb.Append("CreatePartControl end 2"); object login = this.ReportFormInput.GetU8Login(); object rawFilter = null; bool isShowUI = false; bool isStaticReport = this.ReportFormInput.IsStaticReport(); int viewType = 1; sb.Append("CreatePartControl end 3"); if (!isStaticReport) { rawFilter = this.ReportFormInput.GetRawFilter(); isShowUI = this.ReportFormInput.IsShowUI(); } else { viewType = this.ReportFormInput.GetViewType(); } sb.Append("CreatePartControl end 4"); ClientReportContext context = new ClientReportContext(login); RemoteDataHelper rdh = new RemoteDataHelper(); sb.Append("CreatePartControl end 5"); context.ReportUIUserStateInfo = rdh.GetReportUserState(ClientReportContext.Login, reportId); sb.Append("CreatePartControl end 6"); ClientReportContext.Port = Cryptography.LoginInfo.ProtocolPort["RePt"].ToString(); ClientReportContext.Protocal = Cryptography.LoginInfo.ProtocolPort["RePr"].ToString(); sb.Append("CreatePartControl end 7"); DefaultConfigs.RegChannel(ClientReportContext.Login.AppServer); sb.Append("CreatePartControl end 8"); this.ReportViewControl = new ReportViewControl(); this.ReportViewControl.CanShowReport += new EventHandler(ReportViewControlShowReport); this.ReportViewControl.DoubleClick += new EventHandler(ReportViewControlDoubleClick); this.ReportViewControl.CloseContainerEvent += new CloseContainerHandler(ReportViewControl_ReportFilterEvent); this.ReportViewControl.UpdataGroupandCrossesToolbarEvent += new RefreshToolbarHandler(ReportViewControl_pdataGroupsToolbarEvent); this.ReportViewControl.RefreshViewsToolbarEvent += new RefreshToolbarHandler(ReportViewControl_RefreshViewsToolbarEvent); this.ReportViewControl.RefreshJoinQueryToolbarEvent += new RefreshToolbarHandler(ReportViewControl_RefreshJoinQueryToolbarEvent); // // pengzhzh 2012-8-9 // this.ReportViewControl.ModifyButtons += new System.Action(ButtonChangeModify); (this.ReportEditorPart as NetEditor).PageCloseRequest += new PageCloseRequestHandler(ReportPortalRunner_PageCloseRequest); sb.Append("CreatePartControl end 9"); if (isStaticReport) { this.ReportViewControl.Initialize(context, reportId, ReportStates.Static, (ReportType)viewType); } else { this.ReportViewControl.Initialize(context, reportId, ReportStates.Browse, rawFilter, isShowUI); } this.ReportFormInput.Text = "Loading"; sb.Append("CreatePartControl end 10"); (this.ReportEditorPart as NetEditor).Refresh(this.ReportFormInput); return(this.ReportViewControl); } catch (CanceledException) { CloseContainer(); return(null); } catch (Exception ex) { UFIDA.U8.UAP.Services.ReportExhibition.ReportViewControl.ShowInformationMessageBox(ex); UFIDA.U8.UAP.Services.ReportExhibition.ReportViewControl.ShowInformationMessageBox(ex.InnerException); System.Diagnostics.Trace.WriteLine("ReportPortalRunner.CreatePartControl Log:" + sb); CloseContainer(); return(null); } }