using System; using System.Drawing; using System.Collections; using System.ComponentModel; using System.Windows.Forms; using CrystalDecisions.CrystalReports.Engine; using CrystalDecisions.Shared; namespace DLLCrystal {/// /// frmCrystalView Abstract illustration. /// summary> INTERNAL CLASS FRMCRYSTALVIEW: System.Windows.Forms.Form {Private Crystaldecisions.windows.Forms.CrystalReportViewer crview; /// // / / The required designer variable. /// summary> private system.componentmodel.container components = null; private string [] STRINFO;
Public FRMCRYSTALVIEW (String [] strinfomation) {// // Windows Form Designer Support for // InitializeComponent ();
// // Todo: Add any constructor code // strinfo = strINFomation after INITIALIZECOMPONENT call;
/// /// Clean all the resources being used. /// summary> Protected Override Void Dispose (Bool Disposing) {if (disponents! = Null) {components.dispose ();}} Base.Dispose
#REGION Windows Form Designer The code /// /// designer supports the required method - do not use the code editor to modify the // / this method. /// summary> private void InitializeComponent () {this.crView = new CrystalDecisions.Windows.Forms.CrystalReportViewer (); this.SuspendLayout (); // // crView // this.crView.ActiveViewIndex = -1; This.crView.dock = system.windows.Forms.dockStyle.Fill; this.crView.Location = new system.drawing.point (0); this.crView.Name = "crView"; this.crView.reportsource = null; this.crView.ShowRefreshButton = false; this.crView.Size = new System.Drawing.Size (640, 509); this.crView.TabIndex = 0; // // frmCrystalView // this.AutoScaleBaseSize = new System. Drawing.size (6, 14); this.clientsize = new system.drawing.size (640, 509); this.controls.add (this.crView); this.name = "frMcrystalView"; this.text = "Preview Report "; this.Load = new system.eventhandler (this.frmcrystalview_load); this.ResumeLayout (false);} #ENDREGION
private void frmCrystalView_Load (object sender, System.EventArgs e) {ReportDocument rdView = new ReportDocument (); rdView.Load (@strInfo [0]); foreach (Table tbView in rdView.Database.Tables) {TableLogOnInfo tliView = new TableLogOnInfo ( ); tliView = tbView.LogOnInfo; tliView.ConnectionInfo.ServerName = strInfo [1]; tliView.ConnectionInfo.DatabaseName = strInfo [2]; tliView.ConnectionInfo.UserID = strInfo [3]; tliView.ConnectionInfo.Password = strInfo [4 ]; TBVIEW.ApplyLogonInfo (TLIVIEW);