private void button6_Click(object sender, EventArgs e) { ReportViewer f2 = new ReportViewer(); TableLogOnInfos reportLogonInfos = new TableLogOnInfos(); TableLogOnInfo reportLogonInfo = new TableLogOnInfo(); ConnectionInfo reportConInfo = new ConnectionInfo(); Tables tables = default(Tables); // Table table = default(Table); var with1 = reportConInfo; with1.ServerName = "LAPTOP-19NF5E9"; with1.DatabaseName = "BankReconciliationDBProNovember"; with1.UserID = "sa"; with1.Password = "******"; SummaryOfBalanceCrystalReport cr = new SummaryOfBalanceCrystalReport(); tables = cr.Database.Tables; foreach (Table table in tables) { reportLogonInfo = table.LogOnInfo; reportLogonInfo.ConnectionInfo = reportConInfo; table.ApplyLogOnInfo(reportLogonInfo); } f2.crystalReportViewer1.ReportSource = cr; this.Visible = false; f2.ShowDialog(); this.Visible = true; }
public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport() { SummaryOfBalanceCrystalReport rpt = new SummaryOfBalanceCrystalReport(); rpt.Site = this.Site; return(rpt); }
private void button6_Click_1(object sender, EventArgs e) { ParameterField paramField1 = new ParameterField(); //creating an object of ParameterFields class ParameterFields paramFields1 = new ParameterFields(); //creating an object of ParameterDiscreteValue class ParameterDiscreteValue paramDiscreteValue1 = new ParameterDiscreteValue(); //set the parameter field name paramField1.Name = "id"; //set the parameter value paramDiscreteValue1.Value = x; //add the parameter value in the ParameterField object paramField1.CurrentValues.Add(paramDiscreteValue1); //add the parameter in the ParameterFields object paramFields1.Add(paramField1); ReportViewer f2 = new ReportViewer(); TableLogOnInfos reportLogonInfos = new TableLogOnInfos(); TableLogOnInfo reportLogonInfo = new TableLogOnInfo(); ConnectionInfo reportConInfo = new ConnectionInfo(); Tables tables = default(Tables); // Table table = default(Table); var with1 = reportConInfo; with1.ServerName = "LAPTOP-19NF5E9"; with1.DatabaseName = "BankReconciliationDBProNovember"; with1.UserID = "sa"; with1.Password = "******"; SummaryOfBalanceCrystalReport cr = new SummaryOfBalanceCrystalReport(); tables = cr.Database.Tables; foreach (Table table in tables) { reportLogonInfo = table.LogOnInfo; reportLogonInfo.ConnectionInfo = reportConInfo; table.ApplyLogOnInfo(reportLogonInfo); } f2.crystalReportViewer1.ParameterFieldInfo = paramFields1; f2.crystalReportViewer1.ReportSource = cr; this.Visible = false; f2.ShowDialog(); this.Visible = true; }