public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport() { regularFeeInfo rpt = new regularFeeInfo(); rpt.Site = this.Site; return(rpt); }
public override void btnprint_Click(object sender, EventArgs e) { DataSet ds3 = Connection.GetDataSet("select classcode from tbl_classmaster where classname='" + cmbclass.Text + "'"); classno = Convert.ToInt32(ds3.Tables[0].Rows[0].ItemArray[0].ToString()); string str = ""; str = " SELECT tbl_feeheads.feeheads, tbl_classfeeregular.feeamt, '" + cmbclass.Text + "' as ClassName FROM tbl_classfeeregular INNER JOIN tbl_feeheads ON tbl_classfeeregular.feecode = tbl_feeheads.feecode inner join tbl_sankay ts on ts.sankaycode=tbl_classfeeregular.Stream WHERE (tbl_classfeeregular.classno = '" + classno.ToString() + "' and tbl_classfeeregular.Stream='" + strcmbfaculty.SelectedValue.ToString() + "' )"; str = str + "select sum(feeamt) from tbl_classfeeregular where classno='" + classno.ToString() + "'"; str = str + "SELECT schoolname, schooladdress, logoimage FROM tbl_school"; DataSet ds4 = Connection.GetDataSet(str); if (ds4 != null) { //ds4.WriteXmlSchema(@"D:\Barcodes\a\regularFeeInfo.xsd"); regularFeeInfo fr = new regularFeeInfo(); fr.PrintOptions.PaperOrientation = PaperOrientation.Portrait; fr.PrintOptions.PaperSize = CrystalDecisions.Shared.PaperSize.PaperLetter; fr.SetDataSource(ds4); ShowAllReports s = new ShowAllReports(); s.crystalReportViewer1.ReportSource = fr; s.Show(); } }