using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using FinancialEntityLayer;
using FinancialBusinessLayer;
using Financial_Application.Utiltiy;
using System.Data.Common;
using System.Data;
using System.Drawing.Design;
using System.Drawing.Imaging;
using CrystalDecisions.CrystalReports;
using CrystalDecisions.Shared;
using CrystalDecisions.ReportSource;
using CrystalDecisions.Web;
using CrystalDecisions.CrystalReports.Engine;
using CrystalDecisions.Web.Design;
namespace Financial_Application.Reports
{
public partial class Reports : System.Web.UI.Page
{
FinancialBusinessLayer.Report objBL = new FinancialBusinessLayer.Report();
FinancialEntityLayer.Report objEL = new FinancialEntityLayer.Report();
///DataSet ds;
ClientReport c = new ClientReport();
protected void Page_Load(object sender, EventArgs e)
{
}
protected void CrystalReportViewer1_Init(object sender, EventArgs e)
{
DataSet dsrpt = new DataSet();
try
{
DataTable dt;
dt = objBL.GetEntity();
dsrpt.Tables.Add(dt);
DataTable dt1;
FinancialEntityLayer.Report objEL = (FinancialEntityLayer.Report)Session["Assign"];
dt1 = objBL.GetEntityClientInfo(objEL);
dsrpt.Tables.Add(dt1);
//DataTable dt2;
//dt2 = objBL.GetEntityClientisin(objEL);
//dsrpt.Tables.Add(dt2);
CrystalReportViewer1.EnableDatabaseLogonPrompt = false;
c.SetDataSource(dsrpt);
CrystalReportViewer1.ReportSource = c;
Response.Buffer = false;
Response.ClearContent();
Response.ClearHeaders();
if(dt.Rows.Count==0 || dt1.Rows.Count==0)
{
lblError.Text = "Record Not Found";
}
else
{
Session["Ft"] = Session["Format"].ToString();
if (Session["Ft"] != null)
{
lblError.Text = Session["Ft"].ToString();
if (lblError.Text == "Pdf")
{
c.ExportToHttpResponse(ExportFormatType.PortableDocFormat, Response, true, "Client Report");
}
if (lblError.Text == "Excel")
{
c.ExportToHttpResponse(ExportFormatType.Excel, Response, true, "Client Report");
}
if (lblError.Text == "Text-File")
{
c.ExportToHttpResponse(ExportFormatType.RichText, Response, true, "Client Report");
}
if (lblError.Text == "Browser")
{
// ClientReport cr = new ClientReport();
string contentType ="";
contentType = "text/html";
contentType = "true";
c.ExportToHttpResponse(ExportFormatType.HTML32, Response, true, "Client Report");
}
}
else
{
c.ExportToHttpResponse(ExportFormatType.PortableDocFormat, Response, true, "Client Report");
}
}
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
}
}
protected void CrystalReportViewer1_Unload(object sender, EventArgs e)
{
CrystalReportViewer1.Dispose();
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using FinancialDatabaseLayer;
using FinancialEntityLayer;
using System.Configuration;
using System.Data;
using System.Data.Common;
using System.Data.SqlClient;
namespace FinancialBusinessLayer
{
public class Report
{
public DataTable GetEntity()
{
DataTable dt;
try
{
FinancialDatabaseLayer.DataBase objDB = new DataBase(ConfigurationManager.ConnectionStrings["FinancialConnectionString"].ConnectionString);
//FinancialEntityLayer.Report objEL = (FinancialEntityLayer.Report)Parameter;
// objDB.AddParameter("@cum_courrier_id", objEL.IntCourrier_id);
// objDB.AddParameter("@Mode", objEL.StrMode);
dt = objDB.getDataTable("usp_Client_Report", System.Data.CommandType.StoredProcedure,"Entity_master");
}
catch
{
dt = null;
}
return dt;
}
public DataTable GetEntityClientInfo(object Parameter)
{
DataTable dt = null;
try
{
FinancialDatabaseLayer.DataBase objDB = new DataBase(ConfigurationManager.ConnectionStrings["FinancialConnectionString"].ConnectionString);
FinancialEntityLayer.Report objEL = (FinancialEntityLayer.Report)Parameter;
objDB.AddParameter("@client_id_from", objEL.ChrClFrom);
objDB.AddParameter("@client_id_to", objEL.ChrClTo);
objDB.AddParameter("@cm_groupcd", objEL.ChrGrp);
objDB.AddParameter("@family", objEL.ChrFm);
objDB.AddParameter("@branch", objEL.ChrBranch);
objDB.AddParameter("@isin", objEL.ChrIsin);
dt = objDB.getDataTable("usp_client_master_search_on_multiple_value", System.Data.CommandType.StoredProcedure, "Client_master");
}
catch
{
dt = null;
}
return dt;
}
public DataTable GetEntityClientisin(object Parameter)
{
DataTable dt = null;
try
{
FinancialDatabaseLayer.DataBase objDB = new DataBase(ConfigurationManager.ConnectionStrings["FinancialConnectionString"].ConnectionString);
FinancialEntityLayer.Report objEL = (FinancialEntityLayer.Report)Parameter;
objDB.AddParameter("@isin", objEL.ChrIsin);
dt = objDB.getDataTable("usp_single_clientSmart_binding", System.Data.CommandType.StoredProcedure, "Client_master");
}
catch
{
dt = null;
}
return dt;
}
//public DataSet GetEntityClientInfo(object Parameter)
//{
// DataSet dt = null;
// try
// {
// FinancialDatabaseLayer.DataBase objDB = new DataBase(ConfigurationManager.ConnectionStrings["FinancialConnectionString"].ConnectionString);
// FinancialEntityLayer.Report objEL = (FinancialEntityLayer.Report)Parameter;
// objDB.AddParameter("@client_id_from", objEL.ChrClFrom);
// objDB.AddParameter("@client_id_to", objEL.ChrClTo);
// dt = objDB.ExecuteDataSet("usp_client_master_search_on_multiple_value", System.Data.CommandType.StoredProcedure);
// }
// catch
// {
// dt = null;
// }
// return dt;
//}
//public DataTable GetIsin(object Parameter)
//{
// DataTable dt;
// try
// {
// FinancialDatabaseLayer.DataBase objDB = new DataBase(ConfigurationManager.ConnectionStrings["FinancialConnectionString"].ConnectionString);
// FinancialEntityLayer.Report objEL = (FinancialEntityLayer.Report)Parameter;
// objDB.AddParameter("@Isin",objEL.ChrIsin);
// // objDB.AddParameter("@Mode", objEL.StrMode);
// dt = objDB.getDataTable("usp_Report_Isin", System.Data.CommandType.StoredProcedure, "Entity_master");
// }
// catch
// {
// dt = null;
// }
// return dt;
//}
public DataSet binddlScheme(object Parameter)
{
DataSet ds;
FinancialDatabaseLayer.DataBase objDB = new DataBase(ConfigurationManager.ConnectionStrings["FinancialConnectionString"].ConnectionString);
FinancialEntityLayer.Report objEL = (FinancialEntityLayer.Report)Parameter;
objDB.AddParameter("@Mode",objEL.StrMode);
ds = objDB.ExecuteDataSet("usp_Single_EntityReportBinding", System.Data.CommandType.StoredProcedure);
return ds;
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace FinancialEntityLayer
{
public class Report
{
public string StrMode
{ get; set; }
public char[] ChrClFrom
{ get; set; }
public char[] ChrClTo
{ get; set; }
public char[] ChrGrp
{ get; set; }
public char[] ChrSb
{ get; set; }
public char[] ChrFm
{ get; set; }
public char[] ChrIsin
{ get; set; }
public char[] ChrSet
{ get; set; }
public char[] ChrBranch
{ get; set; }
}
}
TAKE clientreport.rpt and drag n drop fields
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using FinancialEntityLayer;
using FinancialBusinessLayer;
using Financial_Application.Utiltiy;
using System.Data.Common;
using System.Data;
using System.Drawing.Design;
using System.Drawing.Imaging;
using CrystalDecisions.CrystalReports;
using CrystalDecisions.Shared;
using CrystalDecisions.ReportSource;
using CrystalDecisions.Web;
using CrystalDecisions.CrystalReports.Engine;
using CrystalDecisions.Web.Design;
namespace Financial_Application.Reports
{
public partial class Reports : System.Web.UI.Page
{
FinancialBusinessLayer.Report objBL = new FinancialBusinessLayer.Report();
FinancialEntityLayer.Report objEL = new FinancialEntityLayer.Report();
///DataSet ds;
ClientReport c = new ClientReport();
protected void Page_Load(object sender, EventArgs e)
{
}
protected void CrystalReportViewer1_Init(object sender, EventArgs e)
{
DataSet dsrpt = new DataSet();
try
{
DataTable dt;
dt = objBL.GetEntity();
dsrpt.Tables.Add(dt);
DataTable dt1;
FinancialEntityLayer.Report objEL = (FinancialEntityLayer.Report)Session["Assign"];
dt1 = objBL.GetEntityClientInfo(objEL);
dsrpt.Tables.Add(dt1);
//DataTable dt2;
//dt2 = objBL.GetEntityClientisin(objEL);
//dsrpt.Tables.Add(dt2);
CrystalReportViewer1.EnableDatabaseLogonPrompt = false;
c.SetDataSource(dsrpt);
CrystalReportViewer1.ReportSource = c;
Response.Buffer = false;
Response.ClearContent();
Response.ClearHeaders();
if(dt.Rows.Count==0 || dt1.Rows.Count==0)
{
lblError.Text = "Record Not Found";
}
else
{
Session["Ft"] = Session["Format"].ToString();
if (Session["Ft"] != null)
{
lblError.Text = Session["Ft"].ToString();
if (lblError.Text == "Pdf")
{
c.ExportToHttpResponse(ExportFormatType.PortableDocFormat, Response, true, "Client Report");
}
if (lblError.Text == "Excel")
{
c.ExportToHttpResponse(ExportFormatType.Excel, Response, true, "Client Report");
}
if (lblError.Text == "Text-File")
{
c.ExportToHttpResponse(ExportFormatType.RichText, Response, true, "Client Report");
}
if (lblError.Text == "Browser")
{
// ClientReport cr = new ClientReport();
string contentType ="";
contentType = "text/html";
contentType = "true";
c.ExportToHttpResponse(ExportFormatType.HTML32, Response, true, "Client Report");
}
}
else
{
c.ExportToHttpResponse(ExportFormatType.PortableDocFormat, Response, true, "Client Report");
}
}
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
}
}
protected void CrystalReportViewer1_Unload(object sender, EventArgs e)
{
CrystalReportViewer1.Dispose();
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using FinancialDatabaseLayer;
using FinancialEntityLayer;
using System.Configuration;
using System.Data;
using System.Data.Common;
using System.Data.SqlClient;
namespace FinancialBusinessLayer
{
public class Report
{
public DataTable GetEntity()
{
DataTable dt;
try
{
FinancialDatabaseLayer.DataBase objDB = new DataBase(ConfigurationManager.ConnectionStrings["FinancialConnectionString"].ConnectionString);
//FinancialEntityLayer.Report objEL = (FinancialEntityLayer.Report)Parameter;
// objDB.AddParameter("@cum_courrier_id", objEL.IntCourrier_id);
// objDB.AddParameter("@Mode", objEL.StrMode);
dt = objDB.getDataTable("usp_Client_Report", System.Data.CommandType.StoredProcedure,"Entity_master");
}
catch
{
dt = null;
}
return dt;
}
public DataTable GetEntityClientInfo(object Parameter)
{
DataTable dt = null;
try
{
FinancialDatabaseLayer.DataBase objDB = new DataBase(ConfigurationManager.ConnectionStrings["FinancialConnectionString"].ConnectionString);
FinancialEntityLayer.Report objEL = (FinancialEntityLayer.Report)Parameter;
objDB.AddParameter("@client_id_from", objEL.ChrClFrom);
objDB.AddParameter("@client_id_to", objEL.ChrClTo);
objDB.AddParameter("@cm_groupcd", objEL.ChrGrp);
objDB.AddParameter("@family", objEL.ChrFm);
objDB.AddParameter("@branch", objEL.ChrBranch);
objDB.AddParameter("@isin", objEL.ChrIsin);
dt = objDB.getDataTable("usp_client_master_search_on_multiple_value", System.Data.CommandType.StoredProcedure, "Client_master");
}
catch
{
dt = null;
}
return dt;
}
public DataTable GetEntityClientisin(object Parameter)
{
DataTable dt = null;
try
{
FinancialDatabaseLayer.DataBase objDB = new DataBase(ConfigurationManager.ConnectionStrings["FinancialConnectionString"].ConnectionString);
FinancialEntityLayer.Report objEL = (FinancialEntityLayer.Report)Parameter;
objDB.AddParameter("@isin", objEL.ChrIsin);
dt = objDB.getDataTable("usp_single_clientSmart_binding", System.Data.CommandType.StoredProcedure, "Client_master");
}
catch
{
dt = null;
}
return dt;
}
//public DataSet GetEntityClientInfo(object Parameter)
//{
// DataSet dt = null;
// try
// {
// FinancialDatabaseLayer.DataBase objDB = new DataBase(ConfigurationManager.ConnectionStrings["FinancialConnectionString"].ConnectionString);
// FinancialEntityLayer.Report objEL = (FinancialEntityLayer.Report)Parameter;
// objDB.AddParameter("@client_id_from", objEL.ChrClFrom);
// objDB.AddParameter("@client_id_to", objEL.ChrClTo);
// dt = objDB.ExecuteDataSet("usp_client_master_search_on_multiple_value", System.Data.CommandType.StoredProcedure);
// }
// catch
// {
// dt = null;
// }
// return dt;
//}
//public DataTable GetIsin(object Parameter)
//{
// DataTable dt;
// try
// {
// FinancialDatabaseLayer.DataBase objDB = new DataBase(ConfigurationManager.ConnectionStrings["FinancialConnectionString"].ConnectionString);
// FinancialEntityLayer.Report objEL = (FinancialEntityLayer.Report)Parameter;
// objDB.AddParameter("@Isin",objEL.ChrIsin);
// // objDB.AddParameter("@Mode", objEL.StrMode);
// dt = objDB.getDataTable("usp_Report_Isin", System.Data.CommandType.StoredProcedure, "Entity_master");
// }
// catch
// {
// dt = null;
// }
// return dt;
//}
public DataSet binddlScheme(object Parameter)
{
DataSet ds;
FinancialDatabaseLayer.DataBase objDB = new DataBase(ConfigurationManager.ConnectionStrings["FinancialConnectionString"].ConnectionString);
FinancialEntityLayer.Report objEL = (FinancialEntityLayer.Report)Parameter;
objDB.AddParameter("@Mode",objEL.StrMode);
ds = objDB.ExecuteDataSet("usp_Single_EntityReportBinding", System.Data.CommandType.StoredProcedure);
return ds;
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace FinancialEntityLayer
{
public class Report
{
public string StrMode
{ get; set; }
public char[] ChrClFrom
{ get; set; }
public char[] ChrClTo
{ get; set; }
public char[] ChrGrp
{ get; set; }
public char[] ChrSb
{ get; set; }
public char[] ChrFm
{ get; set; }
public char[] ChrIsin
{ get; set; }
public char[] ChrSet
{ get; set; }
public char[] ChrBranch
{ get; set; }
}
}
TAKE clientreport.rpt and drag n drop fields