Beispiel #1
0
        private void button3_Click(object sender, EventArgs e)
        {
            //AccountWiseTransaction f2 = new AccountWiseTransaction();
            //this.Visible = false;
            //f2.ShowDialog();
            //this.Visible = true;
            //Step1BankReconciliationAllTran f2 = new Step1BankReconciliationAllTran();
            //this.Visible = false;
            //f2.ShowDialog();
            //this.Visible = true;
            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     = "******";
            Step1BankReconciliation cr = new Step1BankReconciliation();

            tables = cr.Database.Tables;
            foreach (Table table in tables)
            {
                reportLogonInfo = table.LogOnInfo;
                reportLogonInfo.ConnectionInfo = reportConInfo;
                table.ApplyLogOnInfo(reportLogonInfo);
            }
            //f2.crystalReportViewer1.ParameterFieldInfo = paramFields;
            //set the parameterfield information in the crystal report
            f2.crystalReportViewer1.ReportSource = cr;
            this.Visible = false;
            f2.ShowDialog();
            this.Visible = true;
        }
        private void button10_Click(object sender, EventArgs e)
        {
            //creating an object of ParameterField class
            ParameterField paramField  = new ParameterField();
            ParameterField paramField1 = new ParameterField();

            //creating an object of ParameterFields class
            ParameterFields paramFields  = new ParameterFields();
            ParameterFields paramFields1 = new ParameterFields();

            //creating an object of ParameterDiscreteValue class
            ParameterDiscreteValue paramDiscreteValue  = new ParameterDiscreteValue();
            ParameterDiscreteValue paramDiscreteValue1 = new ParameterDiscreteValue();

            //set the parameter field name
            paramField.Name  = "AccountNum";
            paramField1.Name = "BankName";
            //set the parameter value
            paramDiscreteValue.Value  = accountNoComboBox.Text;
            paramDiscreteValue1.Value = bankSelectionComboBox.Text;
            //add the parameter value in the ParameterField object
            paramField.CurrentValues.Add(paramDiscreteValue);
            paramField1.CurrentValues.Add(paramDiscreteValue1);

            //add the parameter in the ParameterFields object
            paramFields.Add(paramField);
            paramFields1.Add(paramField1);
            //set the parameterfield information in the crystal report



            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     = "******";
            Step1BankReconciliation cr = new Step1BankReconciliation();

            tables = cr.Database.Tables;
            foreach (Table table in tables)
            {
                reportLogonInfo = table.LogOnInfo;
                reportLogonInfo.ConnectionInfo = reportConInfo;
                table.ApplyLogOnInfo(reportLogonInfo);
            }
            f2.crystalReportViewer1.ParameterFieldInfo = paramFields;
            f2.crystalReportViewer1.ParameterFieldInfo = paramFields1;
            //set the parameterfield information in the crystal report
            f2.crystalReportViewer1.ReportSource = cr;
            this.Visible = false;

            f2.ShowDialog();
            this.Visible = true;
        }