private DataTable ViewReport()
{
ReportBAL objBaseReport = new ReportBAL();
objBaseReport.GVSerialNumber = txtGiftVoucher.Text.Trim();
if (objBaseReport.GVSerialNumber == "")
objBaseReport.GVSerialNumber = "0";
objBaseReport.ShopId = Convert.ToInt32(ddlShop.SelectedValue);
objBaseReport.FromDate = txtFromDate.Text;
objBaseReport.ToDate = txtToDate.Text;
objBaseReport.IsDateChk = true;
DataSet ds = objDAL.ReportGiftVoucher(objBaseReport);
return ds.Tables[0];
}
private void BindReport()
{
DataTable dtComp = new DataTable();
dtComp = objDAL.GetMasterCompany();
if (dtComp.Rows.Count > 0)
{
CompanyName = Convert.ToString(dtComp.Rows[0]["CName"]);
CompanyAddress = Convert.ToString(dtComp.Rows[0]["CAddress"]);
}
ReportDataSource rds = new ReportDataSource();
rds.Name = "GiftVoucher";
rds.Value = ViewReport();
ReportViewer1.LocalReport.ReportPath = Server.MapPath("rptGiftVoucher.rdlc");
ReportViewer1.LocalReport.DataSources.Clear();
ReportViewer1.LocalReport.DataSources.Add(rds);
ReportViewer1.LocalReport.EnableExternalImages = true;
ReportParameter rp = new ReportParameter("CompanyName", CompanyName);
ReportParameter rp1 = new ReportParameter("Address", CompanyAddress);
ReportViewer1.LocalReport.SetParameters(new ReportParameter[] { rp, rp1 });
ReportViewer1.LocalReport.Refresh();
}
protected void btnSearch_Click(object sender, EventArgs e)
{
try
{
BindReport();
ReportViewer1.Visible = true;
divSearch.Style.Add("display", "none");
}
catch (Exception ex)
{
uctrlPositiveMessage.Visible = false;
uctrlErrorMessage.Visible = true;
ErrorMessage.Text = "Error:" + ex.Message;
}
}
Subscribe to:
Post Comments (Atom)
What is AI? Artificial Intelligence (AI) is the ability of machines or computer systems to perform tasks that normally require human intell...
-
What is WCF? Microsoft refers WCF as a programming platform that is used to build Service-oriented applications. Windows Communication F...
-
SQLConnects.cs using System; using System.Collections.Generic; using System.Text; using Microsoft.Practices.EnterpriseLibrary.Data.Sql; n...
-
Step1- Register the Crstal Report DLL (Not Need to include the DLL In Bin Folder) by using the following lines <%@ Register Ass...
No comments:
Post a Comment