Khaleel Rahman

Khaleel Rahman

  • NA
  • 69
  • 6.4k

Cant get 2 datatable values in a crystal report

Oct 2 2017 2:02 AM
Im using 2 datatables to get the values in my report with 2 sub reports 
by using this code i can get only the values in dti how can i get both please help..!
im using a web application this report is to get the totoal of sales and expense  
 
 
 
 
 
protected void btnPrint_Click(object sender, EventArgs e)
{
DataTable dti = new DataTable();
DataTable dte = new DataTable();
try
{
InvoiceBLL invmbll = new InvoiceBLL();
if (txtFromDate.Text == "")
{
_fromDate = "1001-01-01";
}
else
{ _fromDate = DateTime.ParseExact(txtFromDate.Text, "dd/MM/yyyy", CultureInfo.InstalledUICulture).ToString("yyyy/MM/dd"); }
if (txtToDate.Text == "")
{
_toDate = "2100-12-31";
}
else
{ _toDate = DateTime.ParseExact(txtToDate.Text, "dd/MM/yyyy", CultureInfo.InstalledUICulture).ToString("yyyy/MM/dd"); }
dti = invmbll.GetInvoiceDaily(_fromDate,_toDate);
dte = invmbll.GetInvoiceDailyExpense(_fromDate, _toDate);
dti.TableName = "DailyCashIncomeReport";
dte.TableName = "DailyCashExpenseRpt";
string ReportName = Server.MapPath("~/Report/DailySalesExpenseReport.rpt");
Session["DTbl"] = dti;
Session["DTbl"] = dte;
Session["ReportName"] = ReportName;
Page page = (Page)HttpContext.Current.Handler;
if (page == null)
{
throw new InvalidOperationException("Cannot redirect to new window outside Page context.");
}
string url = "~/ShowReport.aspx";
url = page.ResolveClientUrl(url);
string windowFeatures = "";
if (!String.IsNullOrEmpty(windowFeatures))
{
script = @"window.open(""{0}"", ""{1}"", ""{2}"");";
}
else
{
script = @"window.open(""{0}"", ""{1}"");";
}
script = String.Format(script, url, "_blank", windowFeatures);
ScriptManager.RegisterStartupScript(page, typeof(Page), "Redirect", script, true);
}
catch (Exception ex) { throw new Exception(ex.ToString()); }
}

Answers (1)