protected void EH_ImportAction(StripToolItem aSender) { if (RsViewEngine.dlgOpenCollection.ShowDialog() == DialogResult.OK) { RsViewEngine.LoadCollection(RsViewEngine.dlgOpenCollection.FileName); } }
protected void EH_LoadCollection(object aSender, EventArgs aEArgs) { if (_dlgOpenCollection.ShowDialog() == DialogResult.OK) { RsViewEngine.LoadCollection(_dlgOpenCollection.FileName); } }
public void OpenReport() { try { updateDisplay(RsViewEngine.Locale.GetTagText("wait_Init")); createCrystalViewer(); //_Document.RefreshReport += new EventHandler(EH_RefreshReport); opened = true; updateDisplay(RsViewEngine.Locale.GetTagText("wait_Open") + "\n" + _RptFile); ReportProvider = new RsReportProvider(_RptFile); } catch (Exception E) { RsViewEngine.TreatCriticalError(E); } /// <summary> /// Collecting and if possible setting up datasource logon info /// </summary> updateDisplay(RsViewEngine.Locale.GetTagText("wait_DSBuild")); List <InternalConnectionInfo> lConnections = ReportProvider.GetAllConnections(); foreach (InternalConnectionInfo iConnInfo in lConnections) { string lConnectionName = iConnInfo.DatabaseName == "" ? iConnInfo.ServerName : iConnInfo.DatabaseName; if (FileFormats.IsExcel(lConnectionName)) { continue; } CSecurityNode lSec = RsViewEngine.RSSecurity.GetSecurityNode("report", lConnectionName, _RptFile); if (lSec == null) { lSec = RsViewEngine.RSSecurity.GetSecurityNode("DatasourceSecurity", lConnectionName); } if (lSec != null) { iConnInfo.SetLogon(lSec.UserName, lSec.Password); } else { if (!ShowAuthDialog(lConnectionName, iConnInfo)) { System.Windows.Forms.Application.Exit(); } } } addRptToViewer(); hideDisplay(); }
/// <summary> /// Returns true, if connection logon accepted by user, owtherwise false. /// If user requires the authentication info also stored /// </summary> /// <param name="aConnectionInfo">The connection info</param> /// <returns>True if dialog accepted, false if not</returns> protected bool ShowAuthDialog(string aConnectionName, InternalConnectionInfo aConnectionInfo) { dlgSetupLogin.ConnectionName = aConnectionName; if (dlgSetupLogin.ShowDialog() == DialogResult.OK) { if (dlgSetupLogin.Authenticate) { aConnectionInfo.SetLogon(dlgSetupLogin.UserName, dlgSetupLogin.Password); } switch (dlgSetupLogin.SaveMode) { case TLogonInfoSave.lisSaveForDataSource: if (dlgSetupLogin.Authenticate) { CSecurityData.AddSecNode( RsViewEngine.RSSecurity, dlgSetupLogin.ConnectionName, "DatasourceSecurity", dlgSetupLogin.UserName, dlgSetupLogin.Password ); RsViewEngine.SaveSecurity(); } break; case TLogonInfoSave.lisSaveForReport: if (dlgSetupLogin.Authenticate) { CSecurityData.AddSecNode( RsViewEngine.RSSecurity, dlgSetupLogin.ConnectionName, "report", dlgSetupLogin.UserName, dlgSetupLogin.Password, _RptFile ); RsViewEngine.SaveSecurity(); } break; } return(true); } else { return(false); } }
protected void _bOkClick(object sender, System.EventArgs e) { try { if (Mode == SH_EXPIRED) { RsViewEngine.KillApplication(); } this.Size = new System.Drawing.Size((int)(this.Size.Width / Mode), this.Size.Height); this.DialogResult = System.Windows.Forms.DialogResult.OK; } catch { RsViewEngine.KillApplication(); } }
public void DoRemove() { XmlNode lThisData = RsViewEngine.Locale.GetFormData(LOCALE_ALIAS); CReportItem lSelected = getSelectedItem(); RsReportCollection lCollection = getSelectedCollection(); string lVerifyMsg; string lItemName; if (lSelected == null) { CRSMessageBox.ShowBox( XmlTools.getXmlNodeByAttrVal("name", "itemNotSelected_del", lThisData).InnerText, RsViewEngine.Locale.GetTagText("error"), MessageBoxButtons.OK, MessageBoxIcon.Exclamation ); return; } lItemName = lSelected.ItemName; if (lSelected is CReportRootFolder) { if (lSelected is CReportFavoritesRoot) { lVerifyMsg = XmlTools.getXmlNodeByAttrVal("name", "verify_eraseFavs", lThisData).InnerText; } else { lVerifyMsg = XmlTools.getXmlNodeByAttrVal("name", "verify_rmCollection", lThisData).InnerText + " " + lCollection.CollectionName + "?"; } DialogResult lDlgRes = CRSMessageBox.ShowBox( lVerifyMsg, RsViewEngine.Locale.GetTagText("verify"), MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation ); if (lDlgRes == DialogResult.Yes) { if (lSelected is CReportFavoritesRoot) { lCollection.ClearCollection(); lCollection.QuickSave(); lCollection.ApplyToGUI(); _eCollection.SelectedNode = lCollection.RootFolder.GUINode; } else { if (lCollection.Modified) { lDlgRes = CRSMessageBox.ShowBox( XmlTools.getXmlNodeByAttrVal("name", "nosaved_collection", lThisData).InnerText + " " + lCollection.CollectionName + "?", RsViewEngine.Locale.GetTagText("save"), MessageBoxButtons.YesNo, MessageBoxIcon.Question ); if (lDlgRes == DialogResult.Yes) { RsViewEngine.SaveCollection(lCollection); } } RsViewEngine.CloseCollection(lCollection); _eCollection.SelectedNode = RsViewEngine.Favorites.RootFolder.GUINode; } } } else { if (lSelected is CReportFolder) { lVerifyMsg = XmlTools.getXmlNodeByAttrVal("name", "verify_rmFolder", lThisData).InnerText + " " + lItemName + "?"; } else { lVerifyMsg = XmlTools.getXmlNodeByAttrVal("name", "verify_rmFile", lThisData).InnerText + " " + lItemName + "?"; } DialogResult lDlgRes = CRSMessageBox.ShowBox( lVerifyMsg, RsViewEngine.Locale.GetTagText("verify"), MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation ); if (lDlgRes == DialogResult.Yes) { _eCollection.SelectedNode = lSelected.GUINode; lSelected.Release(); lCollection.QuickSave(); } } }
protected void EH_Close(object aSender, EventArgs aEArgs) { RsViewEngine.ShutdownApplication(); }
private static void Main(string[] args) { System.Windows.Forms.Application.EnableVisualStyles(); System.Windows.Forms.Application.SetCompatibleTextRenderingDefault(true); if (!CEmbeddedApplication.IsEmbeddedApplication(args)) { RsViewEngine.InitializeCore(); RsViewEngine.InitializeApplication(); string lRpt = ""; // Argument processing: for (int i = 0; i < args.Length; i++) { if (args[i] == "-o" || args[i] == "--open") { lRpt = args.Length > i + 1 ? args[i + 1] : ""; } } #if DEBUG #warning RS View: DEBUG build ReportSmart.Controls.CRSMessageBox.ShowBox("ReportSmart View now running in DEBUG mode.", "Debug"); #elif (DEMO) #warning RS View: DEMO build #else #warning RS View: RELEASE build #endif #if DEMO try { string lProjID = RsViewEngine.GetProjectID(); long lVal = AppAuth.chkshwauthfrw(AppAuth.crdtstamp(RsViewEngine.ReferenceTime, _YM, _MM, _DM), _YM, _MM, _DM, _PERIOD); long lChkval = AppAuth.gnchkval(_YM, _MM, _DM, _PERIOD); CdlgDemoAlert.ShowDemoAlert(lVal, lChkval, _PERIOD); if ((lVal - lChkval) <= 0) { RsViewEngine.KillApplication(); } Math.Sqrt((lVal - lChkval)); } catch { RsViewEngine.KillApplication(); } #endif if (lRpt != "") { RsViewEngine.MainForm.OpenReport(FileSystem.NameOf(lRpt), lRpt); } System.Windows.Forms.Application.Run(RsViewEngine.MainForm); } else { CEmbeddedApplication lEmbApp = new CEmbeddedApplication(args[1]); RsViewEngine.InitializeCore(); RsViewEngine.InitializeEmbedded(lEmbApp); CRSReportViewerEmbedded lViewer = new CRSReportViewerEmbedded(); lViewer.EmbeddedApplication = lEmbApp; lViewer.ReportFile = args[2]; lViewer.ReportTitle = args[3]; lViewer.Location = new System.Drawing.Point(0, 0); lViewer.Size = new System.Drawing.Size(640, 480); lViewer.Anchor = (AnchorStyles)(AnchorStyles.Left | AnchorStyles.Top | AnchorStyles.Right | AnchorStyles.Bottom); lViewer.EmbeddedApplication.IntegrateControl(lViewer); Messaging.SendMessage(lViewer.EmbeddedApplication.Handle, Messaging.WM_REGISTERME, (uint)lViewer.Handle, 0); lViewer.OpenReport(); System.Windows.Forms.Application.ApplicationExit += new EventHandler(RsViewEngine.EH_ApplicationExit); System.Windows.Forms.Application.Run(); } }