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

            rpt.Site = this.Site;
            return(rpt);
        }
Beispiel #2
0
        private void Load_Report()
        {
            d.con_open();
            SqlCommand cmd = new SqlCommand("Delete from tbl_feeTemp", d.con);

            cmd.ExecuteNonQuery();
            d.con_close();

            data();

            SqlDataAdapter da = new SqlDataAdapter("Select feetype as FeeType,Amount from tbl_feeTemp ORDER BY FeeType ASC", d.con);
            DataSet        ds = new DataSet();

            da.Fill(ds);

            FeeCrystalReport1 fc = new FeeCrystalReport1();

            fc.SetDataSource(ds.Tables[0]);

            SqlDataAdapter da2 = new SqlDataAdapter("select Sum(Amount) from tbl_feeTemp", d.con);
            DataSet        ds2 = new DataSet();

            da2.Fill(ds2);
            DataRow dr2;

            if (ds2.Tables[0].Rows.Count > 0)
            {
                dr2   = ds2.Tables[0].Rows[0];
                Total = Convert.ToDouble(dr2[0].ToString());
            }

            string         n   = "SELECT tbl_student.sname, tbl_stddivision.cstandard, tbl_stddivision.division, tbl_School.SchoolName, tbl_School.SchoolAddress, tbl_School.Phone FROM tbl_student INNER JOIN tbl_stddivision ON tbl_student.adno = tbl_stddivision.adno CROSS JOIN tbl_School where tbl_student.adno='" + SchoolManagement.rno + "'";
            SqlDataAdapter da1 = new SqlDataAdapter(n, d.con);
            DataSet        ds1 = new DataSet();

            da1.Fill(ds1);
            DataRow dr1;

            if (ds1.Tables[0].Rows.Count > 0)
            {
                dr1 = ds1.Tables[0].Rows[0];
                fc.SetParameterValue("StudName", dr1[0].ToString());
                fc.SetParameterValue("Std", dr1[1].ToString());
                fc.SetParameterValue("Division", dr1[2].ToString());
                fc.SetParameterValue("Addr", dr1[4].ToString());
                fc.SetParameterValue("SchoolPhno", dr1[5].ToString());
                //fc.SetParameterValue("Totinwords", "None");
                fc.SetParameterValue("TDate", DateTime.Now.ToString());
                fc.SetParameterValue("SchoolName", SchoolManagement.SchoolName);
                fc.SetParameterValue("TotalFee", Total);
            }
            crystalReportViewer1.ReportSource = fc;
        }
Beispiel #3
0
        private void FeeCollectionReprt_Load(object sender, EventArgs e)
        {
            //SqlDataAdapter da = new SqlDataAdapter("Select TrNo as TransNo,TType as FeeType,TDesc as Description,Amount as Amount from tbl_dailytransaction where TrNo=(Select isnull(max(TrNo),0) from tbl_dailytransaction)", d.con);
            //DataSet ds = new DataSet();
            //da.Fill(ds);

            //FeeCrystalReport1 fc = new FeeCrystalReport1();
            //fc.SetDataSource(ds.Tables[0]);
            //fc.SetParameterValue("TDate", DateTime.Now.ToString());
            //fc.SetParameterValue("SchoolName", SchoolManagement.SchoolName);
            //fc.SetParameterValue("[Total Amount]", SchoolManagement.Feettl.ToString());
            //crystalReportViewer1.ReportSource = fc;
            //SqlDataAdapter da = new SqlDataAdapter("Select TrNo as TransNo,TDesc as FeeType,isnull(Amount,0) as Amount from tbl_dailytransaction where TrNo=(Select isnull(max(TrNo),0) from tbl_dailytransaction)", d.con);
            d.con_open();
            SqlCommand cmd = new SqlCommand("Delete from tbl_feeTemp", d.con);

            cmd.ExecuteNonQuery();
            d.con_close();
            trnno = SchoolManagement.receiptno;

            data();
            //Amtwords = sm.

            //string st = "SELECT tbl_Transaction.TrNo, tbl_tutionfeepayment.amount, tbl_othrfeecollect.amount AS Expr1, tbl_buspayment.Amount AS Expr2 FROM tbl_tutionfeepayment INNER JOIN tbl_Transaction ON tbl_tutionfeepayment.receiptno = tbl_Transaction.TrNo INNER JOIN tbl_othrfeecollect ON tbl_Transaction.TrNo = tbl_othrfeecollect.ReceiptNo INNER JOIN tbl_buspayment ON tbl_Transaction.TrNo = tbl_buspayment.busrcptno where tbl_Transaction.TrNo=" + trnno;
            SqlDataAdapter da = new SqlDataAdapter("Select feetype as FeeType,Amount from tbl_feeTemp ORDER BY FeeType ASC", d.con);
            DataSet        ds = new DataSet();

            da.Fill(ds);
            //SchoolManagement.Feettl = 0;
            //DataRow dr;
            //for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
            //{
            //    dr = ds.Tables[0].Rows[i];
            //    SchoolManagement.Feettl = SchoolManagement.Feettl + Convert.ToDouble(dr[3].ToString());
            //}
            FeeCrystalReport1 fc = new FeeCrystalReport1();

            fc.SetDataSource(ds.Tables[0]);

            SqlDataAdapter da2 = new SqlDataAdapter("select Sum(Amount) from tbl_feeTemp", d.con);
            DataSet        ds2 = new DataSet();

            da2.Fill(ds2);
            DataRow dr2;

            if (ds2.Tables[0].Rows.Count > 0)
            {
                dr2   = ds2.Tables[0].Rows[0];
                Total = Convert.ToDouble(dr2[0].ToString());
            }

            string         n   = "SELECT tbl_student.sname, tbl_stddivision.cstandard, tbl_stddivision.division, tbl_School.SchoolName, tbl_School.SchoolAddress, tbl_School.Phone FROM tbl_student LEFT JOIN tbl_stddivision ON tbl_student.adno = tbl_stddivision.adno CROSS JOIN tbl_School where tbl_student.adno='" + SchoolManagement.rno + "'";
            SqlDataAdapter da1 = new SqlDataAdapter(n, d.con);
            DataSet        ds1 = new DataSet();

            da1.Fill(ds1);
            DataRow dr1;

            if (ds1.Tables[0].Rows.Count > 0)
            {
                dr1 = ds1.Tables[0].Rows[0];
                fc.SetParameterValue("StudName", dr1[0].ToString());
                fc.SetParameterValue("Std", dr1[1].ToString());
                fc.SetParameterValue("Division", dr1[2].ToString());
                fc.SetParameterValue("Addr", dr1[4].ToString());
                fc.SetParameterValue("SchoolPhno", dr1[5].ToString());
                //fc.SetParameterValue("Totinwords", "None");
                fc.SetParameterValue("TDate", DateTime.Now.ToString());
                fc.SetParameterValue("SchoolName", SchoolManagement.SchoolName);
                fc.SetParameterValue("TotalFee", Total);
            }
            crystalReportViewer1.ReportSource = fc;
        }