Exemplo n.º 1
0
        public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport()
        {
            rptDueFee rpt = new rptDueFee();

            rpt.Site = this.Site;
            return(rpt);
        }
Exemplo n.º 2
0
 public override void btnprint_Click(object sender, EventArgs e)
 {
     if (dataGridView1.RowCount > 0)
     {
         if (ChkIdDueGreater.Checked)
         {
             if (chkClassWise.Checked == true && chkSection.Checked == false)
             {
                 DataView dv = dtTotalFee.DefaultView;
                 dv.RowFilter             = "ClassNo='" + cmbClass.SelectedValue + "' And SessionCode='" + cmbSession.SelectedValue + "' and [Due Fee]>0";
                 dv.Sort                  = "Name";
                 dataGridView1.DataSource = dv;
             }
             else if (chkClassWise.Checked == true && chkSection.Checked == true)
             {
                 DataView dv = dtTotalFee.DefaultView;
                 dv.RowFilter             = "ClassNo='" + cmbClass.SelectedValue + "' And SessionCode='" + cmbSession.SelectedValue + "' And SectionNo='" + cmbSection.SelectedValue + "' and [Due Fee]>0";
                 dv.Sort                  = "Name";
                 dataGridView1.DataSource = dv;
             }
             else
             {
                 DataView dv = dtTotalFee.DefaultView;
                 dv.RowFilter             = "[Due Fee]>0";
                 dv.Sort                  = "Name";
                 dataGridView1.DataSource = dv;
             }
         }
         DataSet ds = Connection.GetDataSet("SELECT schoolname, schooladdress, schoolcity, schoolphone, affiliate_by, principal, registrationno, logoimage   From   tbl_school");
         ds.Tables.Add(Connection.GetDataTableFromDataGridView(dataGridView1));
         ds.WriteXmlSchema(@"" + Connection.GetAccessPathId() + @"Barcodes\a\DueFee.xsd");
         rptDueFee fr1 = new rptDueFee();
         fr1.PrintOptions.PaperOrientation = PaperOrientation.Portrait;
         fr1.PrintOptions.PaperSize        = CrystalDecisions.Shared.PaperSize.PaperLetter;
         fr1.SetDataSource(ds);
         ShowAllReports s1 = new ShowAllReports();
         s1.crystalReportViewer1.ReportSource = fr1;
         fr1.SetParameterValue("Session", cmbSession.Text);
         if (chkClassWise.Checked && !chkClassWise.Checked)
         {
             fr1.SetParameterValue("ReportTitle", cmbStudentStatus.Text + " Due Fee Detail For Class - " + cmbClass.Text.Trim());
         }
         else if (chkClassWise.Checked && chkSection.Checked)
         {
             fr1.SetParameterValue("ReportTitle", cmbStudentStatus.Text + " Due Fee Detail For Class - " + cmbClass.Text.Trim() + " " + cmbSection.Text.Trim());
         }
         else
         {
             fr1.SetParameterValue("ReportTitle", cmbStudentStatus.Text + " Due Fee Detail");
         }
         s1.Show();
     }
 }