Beispiel #1
0
        public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport()
        {
            BenificiaryPaymentStatementCrystalReport rpt = new BenificiaryPaymentStatementCrystalReport();

            rpt.Site = this.Site;
            return(rpt);
        }
Beispiel #2
0
        private void button4_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     = "******";
            BenificiaryPaymentStatementCrystalReport cr = new BenificiaryPaymentStatementCrystalReport();

            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;
        }
        private void button1_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrWhiteSpace(benifiComboBox.Text))
            {
                MessageBox.Show("Select Benificiary First", "Error", MessageBoxButtons.OK, MessageBoxIcon.Stop);
            }
            else
            {
                ReportViewer   f2         = new ReportViewer();
                ParameterField paramField = new ParameterField();

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

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

                //set the parameter field name
                paramField.Name = "Benificiary Name";

                //set the parameter value
                paramDiscreteValue.Value = benifiComboBox.Text;

                //add the parameter value in the ParameterField object
                paramField.CurrentValues.Add(paramDiscreteValue);

                //add the parameter in the ParameterFields object
                paramFields.Add(paramField);

                //set the parameterfield information in the crystal report
                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   = "tcp:KyotoServer,49172";
                with1.DatabaseName = "BankReconciliationDB";
                with1.UserID       = "sa";
                with1.Password     = "******";
                BenificiaryPaymentStatementCrystalReport cr = new BenificiaryPaymentStatementCrystalReport();
                tables = cr.Database.Tables;
                foreach (Table table in tables)
                {
                    reportLogonInfo = table.LogOnInfo;
                    reportLogonInfo.ConnectionInfo = reportConInfo;
                    table.ApplyLogOnInfo(reportLogonInfo);
                }
                f2.crystalReportViewer1.ParameterFieldInfo = paramFields;
                f2.crystalReportViewer1.ReportSource       = cr;
                this.Visible = false;

                f2.ShowDialog();
                this.Visible = true;
            }
        }
        private void button1_Click(object sender, EventArgs e)
        {
            ReportViewer   f2         = new ReportViewer();
            ParameterField paramField = new ParameterField();

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

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

            //set the parameter field name
            paramField.Name = "Benificiary Name";

            //set the parameter value
            paramDiscreteValue.Value = comboBox1.Text;

            //add the parameter value in the ParameterField object
            paramField.CurrentValues.Add(paramDiscreteValue);

            //add the parameter in the ParameterFields object
            paramFields.Add(paramField);

            //set the parameterfield information in the crystal report
            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     = "******";
            BenificiaryPaymentStatementCrystalReport cr = new BenificiaryPaymentStatementCrystalReport();

            tables = cr.Database.Tables;
            foreach (Table table in tables)
            {
                reportLogonInfo = table.LogOnInfo;
                reportLogonInfo.ConnectionInfo = reportConInfo;
                table.ApplyLogOnInfo(reportLogonInfo);
            }
            f2.crystalReportViewer1.ParameterFieldInfo = paramFields;
            f2.crystalReportViewer1.ReportSource       = cr;
            this.Visible = false;

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