public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport()
        {
            rptSalaryPaymentRecord rpt = new rptSalaryPaymentRecord();

            rpt.Site = this.Site;
            return(rpt);
        }
Beispiel #2
0
 private void btnSalaryPaymentReport_Click(object sender, EventArgs e)
 {
     if (dataGridView1.RowCount > 0)
     {
         DataSet   ds = Connection.GetDataSet(" SELECT schoolname, schooladdress, affiliate_by, logoimage  FROM tbl_school");
         DataTable dt = Connection.GetDataTableFromDataGridView(dataGridView1);
         ds.Tables.Add(dt);
         ds.WriteXmlSchema(@"" + Connection.GetAccessPathId() + @"Barcodes\a\SalaryPaymentRecord.xsd");
         rptSalaryPaymentRecord cr1 = new rptSalaryPaymentRecord();
         cr1.PrintOptions.PaperOrientation = PaperOrientation.Landscape;
         cr1.PrintOptions.PaperSize        = CrystalDecisions.Shared.PaperSize.PaperLetter;
         cr1.SetDataSource(ds);
         cr1.SetParameterValue("Month", new DateTime(Convert.ToInt16(cmbYear.Text), cmbMonth.SelectedIndex, 1));
         ShowAllReports s = new ShowAllReports();
         s.crystalReportViewer1.ReportSource = cr1;
         s.Show();
     }
 }