Exemplo n.º 1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Rep_DepositPositionProductWiserpt rd = new Rep_DepositPositionProductWiserpt();

            ConnectionInfo conne = new ConnectionInfo();


            conne.ServerName   = ConfigurationManager.AppSettings["ServerName"].ToString();
            conne.DatabaseName = ConfigurationManager.AppSettings["DatabaseName"].ToString();
            conne.UserID       = ConfigurationManager.AppSettings["UserID"].ToString();
            conne.Password     = ConfigurationManager.AppSettings["Password"].ToString();


            TableLogOnInfo tablelogs = new TableLogOnInfo();

            Database db   = rd.Database;
            Tables   tbls = db.Tables;

            foreach (CrystalDecisions.CrystalReports.Engine.Table tab in tbls)
            {
                tablelogs = tab.LogOnInfo;
                tablelogs.ConnectionInfo = conne;
                tab.ApplyLogOnInfo(tablelogs);
                tab.Location = ConfigurationManager.AppSettings["DatabaseName"] + ".dbo." + tab.Name; //most important line whole report is depend on this line
            }

            CrystalReportViewer1.ReportSource = rd;
            CrystalReportViewer1.Zoom(Convert.ToInt16(ConfigurationManager.AppSettings["ReportZoom"]));
            CrystalReportViewer1.SelectionFormula = "{REP_BRANCH_BALANCES.ACCT_TYPE} in  [115, 116, 137, 136, 138] and {REP_BRANCH_BALANCES.TRANDATE} = cdate('" + txtAsOnDate.Text + "')";
            CrystalReportViewer1.RefreshReport();
        }
Exemplo n.º 2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            ReportDocument rpt     = new ReportDocument();
            String         rptPath = Server.MapPath("~\\CRfiles");

            rpt.Load(rptPath + @"\DeclaracionJurada1.rpt");
            //rpt.FileName = rptPath + @"\DeclaracionJurada1.rpt";

            if (!IsPostBack)
            {
                DataSet data = getDataSwornDeclaration();
                Session["data"] = data;
            }

            rpt.SetDataSource((DataSet)Session["data"]);
            rpt.ParameterFields["@CustName"].CurrentValues.Add(Data.CrParameterConvert("NESTLE"));
            rpt.ParameterFields["@CustAddress"].CurrentValues.Add(Data.CrParameterConvert("DIRECCION"));
            rpt.ParameterFields["@CustPhone"].CurrentValues.Add(Data.CrParameterConvert("TELEFONO"));
            rpt.ParameterFields["@CustCode"].CurrentValues.Add(Data.CrParameterConvert("399"));
            rpt.ParameterFields["@CustNit"].CurrentValues.Add(Data.CrParameterConvert("1-9"));
            rpt.ParameterFields["@CustLegalRep"].CurrentValues.Add(Data.CrParameterConvert("Representantelegal"));
            rpt.ParameterFields["@ResolutionRate"].CurrentValues.Add(Data.CrParameterConvert("2020"));
            rpt.ParameterFields["@ResolutionDate"].CurrentValues.Add(Data.CrParameterConvert(DateTime.Now));
            rpt.ParameterFields["@ExpirationDate"].CurrentValues.Add(Data.CrParameterConvert(DateTime.Now));
            rpt.ParameterFields["@EndDate"].CurrentValues.Add(Data.CrParameterConvert(DateTime.Now));
            rpt.ParameterFields["@IsFrozen"].CurrentValues.Add(Data.CrParameterConvert(false));

            CrystalReportViewer1.ReportSource = rpt;
            //CrystalReportViewer1.ParameterFieldInfo["@CustName"].CurrentValues.Add(pCustomerName);
            //CrystalReportViewer1.ParameterFieldInfo["@CustAddress"].CurrentValues.Add(pCustomerAddress);
            //CrystalReportViewer1.ParameterFieldInfo["@CustPhone"].CurrentValues.Add(pCustomerPhone);
            //CrystalReportViewer1.ParameterFieldInfo["@CustCode"].CurrentValues.Add(pCustomerCode);
            //CrystalReportViewer1.ParameterFieldInfo["@CustNit"].CurrentValues.Add(pCustomerNit);
            //CrystalReportViewer1.ParameterFieldInfo["@ResolutionRate"].CurrentValues.Add(pResolutionRate);
            //CrystalReportViewer1.ParameterFieldInfo["@ResolutionDate"].CurrentValues.Add(pResolutionDate);
            //CrystalReportViewer1.ParameterFieldInfo["@ExpirationDate"].CurrentValues.Add(pExpirationDate);
            //CrystalReportViewer1.ParameterFieldInfo["@EndDate"].CurrentValues.Add(pEndDate);

            //CrystalReportViewer1.ParameterFieldInfo["@CustName"].CurrentValues.Add(Data.CrParameterConvert("NESTLE"));
            //CrystalReportViewer1.ParameterFieldInfo["@CustAddress"].CurrentValues.Add(Data.CrParameterConvert("DIRECCION"));
            //CrystalReportViewer1.ParameterFieldInfo["@CustPhone"].CurrentValues.Add(Data.CrParameterConvert("TELEFONO"));
            //CrystalReportViewer1.ParameterFieldInfo["@CustCode"].CurrentValues.Add(Data.CrParameterConvert("399"));
            //CrystalReportViewer1.ParameterFieldInfo["@CustNit"].CurrentValues.Add(Data.CrParameterConvert("1-9"));
            //CrystalReportViewer1.ParameterFieldInfo["@CustLegalRep"].CurrentValues.Add(Data.CrParameterConvert("Representantelegal"));
            //CrystalReportViewer1.ParameterFieldInfo["@ResolutionRate"].CurrentValues.Add(Data.CrParameterConvert("2020"));
            //CrystalReportViewer1.ParameterFieldInfo["@ResolutionDate"].CurrentValues.Add(Data.CrParameterConvert(DateTime.Now));
            //CrystalReportViewer1.ParameterFieldInfo["@ExpirationDate"].CurrentValues.Add(Data.CrParameterConvert(DateTime.Now));
            //CrystalReportViewer1.ParameterFieldInfo["@EndDate"].CurrentValues.Add(Data.CrParameterConvert(DateTime.Now));
            //CrystalReportViewer1.ParameterFieldInfo["@IsFrozen"].CurrentValues.Add(Data.CrParameterConvert(false));

            CrystalReportViewer1.RefreshReport();
            CrystalReportViewer1.ReuseParameterValuesOnRefresh = true;
            CrystalReportViewer1.Zoom(80);
            CrystalReportViewer1.DataBind();
        }
Exemplo n.º 3
0
    protected void Page_Load(object sender, EventArgs e)
    {
        con.Open();
        SqlCommand cmd = con.CreateCommand();

        cmd.CommandText = "SELECT     Bill_Id,Customer_Email,Product_Amount,No_Products,Delivery_Address,Bill_Date FROM         dbo.[Bill]";
        DataTable      dt = new DataTable();
        SqlDataAdapter da = new SqlDataAdapter(cmd);

        da.Fill(dt);
        con.Close();
        CrystalReportBill cr = new CrystalReportBill();

        cr.SetDataSource(dt);
        CrystalReportViewer1.ReportSource = cr;
        CrystalReportViewer1.Zoom(75);
    }
Exemplo n.º 4
0
    protected void Page_Load(object sender, EventArgs e)
    {
        con.Open();
        SqlCommand cmd = con.CreateCommand();

        cmd.CommandText = "SELECT     Order_Id,Bill_Id,Customer_Email,Product_Id,Product_Name,Product_Quantity,Order_Amount,Date FROM         dbo.[Order]";
        DataTable      dt = new DataTable();
        SqlDataAdapter da = new SqlDataAdapter(cmd);

        da.Fill(dt);
        con.Close();
        CrystalReportOrder cr = new CrystalReportOrder();

        cr.SetDataSource(dt);
        CrystalReportViewer1.ReportSource = cr;
        CrystalReportViewer1.Zoom(75);
    }
Exemplo n.º 5
0
    protected void Page_Load(object sender, EventArgs e)
    {
        con.Open();
        SqlCommand cmd = con.CreateCommand();

        cmd.CommandText = "SELECT     Customer_name, Customer_email_id, Mobile_No, Customer_address FROM         dbo.Customer WHERE Active=@a";
        cmd.Parameters.AddWithValue("@a", "yes");
        DataTable      dt = new DataTable();
        SqlDataAdapter da = new SqlDataAdapter(cmd);

        da.Fill(dt);
        con.Close();
        CrystalReportCustomer cr = new CrystalReportCustomer();

        cr.SetDataSource(dt);
        CrystalReportViewer1.ReportSource = cr;
        CrystalReportViewer1.Zoom(75);
    }
Exemplo n.º 6
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (IsPostBack == false)
            {
                txtDateFrom.Text = DateTime.Now.AddDays(-3).ToString("dd-MMM-yyyy");
                txtDateTo.Text   = DateTime.Now.ToString("dd-MMM-yyyy");
                CrystalReportViewer1.Zoom(Convert.ToInt16(ConfigurationManager.AppSettings["ReportZoom"]));
            }

            //conne.ServerName = ConfigurationManager.AppSettings["ServerName"];
            //   conne.DatabaseName = ConfigurationManager.AppSettings["DatabaseName"];
            //   conne.UserID = ConfigurationManager.AppSettings["UserID"];
            //   conne.Password = "******";//ConfigurationManager.AppSettings["Password"];



            ConnectionInfo conne = new ConnectionInfo();


            conne.ServerName   = ConfigurationManager.AppSettings["ServerName"].ToString();
            conne.DatabaseName = ConfigurationManager.AppSettings["DatabaseName"].ToString();
            conne.UserID       = ConfigurationManager.AppSettings["UserID"].ToString();
            conne.Password     = ConfigurationManager.AppSettings["Password"].ToString();


            TableLogOnInfo tablelogs = new TableLogOnInfo();

            Database db   = rd.Database;
            Tables   tbls = db.Tables;

            foreach (CrystalDecisions.CrystalReports.Engine.Table tab in tbls)
            {
                tablelogs = tab.LogOnInfo;
                tablelogs.ConnectionInfo = conne;
                tab.ApplyLogOnInfo(tablelogs);
                tab.Location = ConfigurationManager.AppSettings["DatabaseName"] + ".dbo." + tab.Name; //most important line whole report is depend on this line
            }

            CrystalReportViewer1.ReportSource = rd;

            CrystalReportViewer1.SelectionFormula = "{Rep_SummaryOfDeposit.TranDate} >= cdate('" + txtDateFrom.Text + "') and {Rep_SummaryOfDeposit.TranDate} <=cdate('" + txtDateTo.Text + "')";
            CrystalReportViewer1.RefreshReport();
        }
Exemplo n.º 7
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (Session["Bill_Id"] != null)
     {
         int i = (int)Session["Bill_Id"];
         con.Open();
         SqlCommand cmd = con.CreateCommand();
         cmd.CommandText = "SELECT        dbo.[Order].Order_Id, dbo.[Order].Bill_Id, dbo.[Order].Customer_Email, dbo.[Order].Product_Id, dbo.[Order].Product_Name, dbo.[Order].Product_Quantity, dbo.[Order].Order_Amount, dbo.[Order].Date, dbo.Bill.Delivery_Address FROM            dbo.Bill INNER JOIN dbo.[Order] ON dbo.Bill.Bill_Id = dbo.[Order].Bill_Id WHERE dbo.[Order].Bill_Id=@w AND dbo.[Bill].Bill_Id=@w";
         cmd.Parameters.AddWithValue("@w", i);
         DataTable      dt = new DataTable();
         SqlDataAdapter da = new SqlDataAdapter(cmd);
         da.Fill(dt);
         con.Close();
         CrystalReportImpBilling cr = new CrystalReportImpBilling();
         cr.SetDataSource(dt);
         CrystalReportViewer1.ReportSource = cr;
         CrystalReportViewer1.Zoom(75);
     }
     else
     {
         Response.Redirect("Main.aspx");
     }
 }
Exemplo n.º 8
0
 private void cmdZoom_Click(object sender, EventArgs e)
 {
     CrystalReportViewer1.Zoom(Convert.ToInt32(txtUpDown.Value));
 }
        private void GenerateReport()
        {
            DataSet _ds = new DataSet();

            BLL_Dml   _objbll = new BLL_Dml();
            _database _objdb  = new _database();

            _objdb.DBName = "dbCML";
            _clsdocument _objcls = new _clsdocument();

            _objcls.project_code = lblprj.Text;


            DataTable _dt = new DataTable();


            ReportDocument cryRpt = new ReportDocument();

            if (lblprjid.Text != "50")
            {
                DataTable _dt1     = new DataTable();
                _clsuser  _objcls1 = new _clsuser();
                _objcls1.project_code = lblprj.Text;;

                _dt  = _objbll.load_ProgressTrackingsheet(_objcls, _objdb);
                _dt1 = _objbll.Get_Project_Logo(_objcls1, _objdb);



                //_dt.TableName = "ProgressTrackingReport";

                //_dt.WriteXmlSchema(Server.MapPath("") + "\\ProgressTrackingReport.xml");


                //_dt1.TableName = "ProjectLogo";

                //_dt1.WriteXmlSchema(Server.MapPath("") + "\\ProjectLogo.xml");

                if (lblprjid.Text == "57")
                {
                    cryRpt.Load(Server.MapPath("ProgressTrackingReport_Mc12.rpt"));
                }
                else
                {
                    cryRpt.Load(Server.MapPath("ProgressTrackingReport.rpt"));
                }

                cryRpt.Database.Tables[1].SetDataSource(_dt1);
            }

            else
            {
                _dt = _objbll.load_ProgressTrackingsheet1(_objcls, _objdb);
                cryRpt.Load(Server.MapPath("ProgressTrackingReport_Oph.rpt"));
            }

            cryRpt.Database.Tables[0].SetDataSource(_dt);

            CrystalReportViewer1.ReportSource = cryRpt;
            CrystalReportViewer1.Zoom(90);
            CrystalReportViewer1.DataBind();
            Session["Report"] = cryRpt;
            CrystalReportViewer1.RefreshReport();
        }
Exemplo n.º 10
0
        private void ShowCrystalReport()
        {
            if (ReportObject.ReportType != null)
            {
                switch (ReportObject.ReportType)
                {
                case "DailyBuyReport":
                    dtCommonDataTable = new DataTable();
                    dtCommonDataTable = objReportBLL.GetDailyBuyReport();
                    //dtCommonDataTable.TableName = "DailyBuyReport";
                    //dtCommonDataTable.WriteXmlSchema(Server.MapPath(".") + "/XMLFile.xml");
                    reportPath = "~/Rpt/DailyBuyReport.rpt";
                    break;

                case "DailyLocalSaleReport":
                    dtCommonDataTable = new DataTable();
                    dtCommonDataTable = objReportBLL.GetDailyLocalSaleReport();
                    //dtCommonDataTable.TableName = "DailyLocalSaleReport";
                    //dtCommonDataTable.WriteXmlSchema(Server.MapPath(".") + "/XMLFile.xml");
                    reportPath = "~/Rpt/DailyLocalSaleReport.rpt";
                    break;

                case "ConsignmentWiseSale":
                    dtCommonDataTable = new DataTable();
                    dtCommonDataTable = objReportBLL.GetConsignmentWiseSaleReport();
                    //dtCommonDataTable.TableName = "ConsignmentWiseSaleReport";
                    //dtCommonDataTable.WriteXmlSchema(Server.MapPath(".") + "/XMLFile.xml");
                    reportPath = "~/Rpt/ConsignmentWiseSale.rpt";
                    break;

                case "DailyStockReport":
                    dtCommonDataTable = new DataTable();
                    dtCommonDataTable = objReportBLL.GetDailyStockReport();
                    //dtCommonDataTable.TableName = "DailyStockReport";
                    //dtCommonDataTable.WriteXmlSchema(Server.MapPath(".") + "/XMLFile2.xml");
                    reportPath = "~/Rpt/DailyStockReport.rpt";
                    break;

                case "DailyDueStatement":
                    dtCommonDataTable = new DataTable();
                    dtCommonDataTable = objReportBLL.GetDailyDueStatementReport();
                    //dtCommonDataTable.TableName = "DailyBuyReport";
                    //dtCommonDataTable.WriteXmlSchema(Server.MapPath(".") + "/XMLFile.xml");
                    reportPath = "~/Rpt/DailyDueStatement.rpt";
                    break;

                case "DailyPayStatement":
                    dtCommonDataTable = new DataTable();
                    dtCommonDataTable = objReportBLL.GetDailyPayStatementReport();
                    //dtCommonDataTable.TableName = "DailyBuyReport";
                    //dtCommonDataTable.WriteXmlSchema(Server.MapPath(".") + "/XMLFile.xml");
                    reportPath = "~/Rpt/DailyPayStatement.rpt";
                    break;

                case "DailyForeignSaleReport":
                    dtCommonDataTable = new DataTable();
                    dtCommonDataTable = objReportBLL.GetDailyForeignSaleReport();
                    //dtCommonDataTable.TableName = "DailyForeignSalesReport";
                    //dtCommonDataTable.WriteXmlSchema(Server.MapPath(".") + "/XMLFile.xml");
                    reportPath = "~/Rpt/DailyForeignSaleReport.rpt";
                    break;

                case "DailyPartlyLedger":
                    dtCommonDataTable = new DataTable();
                    dtCommonDataTable = objReportBLL.GetDailyPartlyLedgerReport();
                    //dtCommonDataTable.TableName = "DailyPartyLedgerReport";
                    //dtCommonDataTable.WriteXmlSchema(Server.MapPath(".") + "/XMLFile.xml");
                    reportPath = "~/Rpt/DailyPartlyLedger.rpt";
                    break;

                case "DailyTotalProductionCost":
                    dtCommonDataTable = new DataTable();
                    dtCommonDataTable = objReportBLL.GetDailyTotalProductionCostReport();
                    //dtCommonDataTable.TableName = "DailyTotalProductionCost";
                    //dtCommonDataTable.WriteXmlSchema(Server.MapPath(".") + "/XMLFile7.xml");
                    reportPath = "~/Rpt/DailyTotalProductionCost.rpt";
                    break;

                case "IncomeStatementReport":
                    dtCommonDataTable = new DataTable();
                    dtCommonDataTable = objReportBLL.GetIncomeStatementReport();
                    //dtCommonDataTable.TableName = "IncomeStatementReport";
                    //dtCommonDataTable.WriteXmlSchema(Server.MapPath(".") + "/XMLFileB.xml");
                    reportPath = "~/Rpt/IncomeStatementReport.rpt";
                    break;

                case "SalesLedgerAccount":
                    dtCommonDataTable = new DataTable();
                    dtCommonDataTable = objReportBLL.GetSalesLedgerAccount();
                    //dtCommonDataTable.TableName = "SalesLedgerAccountReport";
                    //dtCommonDataTable.WriteXmlSchema(Server.MapPath(".") + "/XMLFileB.xml");
                    reportPath = "~/Rpt/SalesLedgerAccountReport.rpt";
                    break;

                case "PurchaseLedgerAccount":
                    dtCommonDataTable = new DataTable();
                    dtCommonDataTable = objReportBLL.GetPurchaseLedgerAccount();
                    //dtCommonDataTable.TableName = "PurchaseLedgerAccountReport";
                    //dtCommonDataTable.WriteXmlSchema(Server.MapPath(".") + "/XMLFileB.xml");
                    reportPath = "~/Rpt/PurchaseLedgerAccountReport.rpt";
                    break;

                case "ChequePayment":
                    dtCommonDataTable = new DataTable();
                    dtCommonDataTable = objReportBLL.GetChequePaymentForPurchase();
                    //dtCommonDataTable.TableName = "ChequePaymentForPurchaseReport";
                    //dtCommonDataTable.WriteXmlSchema(Server.MapPath(".") + "/ChequePayment.xml");
                    reportPath = "~/Rpt/ChequePaymentForPurchaseReport.rpt";
                    break;

                case "ChequeReceived":
                    dtCommonDataTable = new DataTable();
                    dtCommonDataTable = objReportBLL.GetChequeReceivedForSale();
                    //dtCommonDataTable.TableName = "ChequeReceivedForSaleReport";
                    //dtCommonDataTable.WriteXmlSchema(Server.MapPath(".") + "/ChequeReceived.xml");
                    reportPath = "~/Rpt/ChequeReceivedForSaleReport.rpt";
                    break;

                case "ConsignmentWiseTruckFare":
                    dtCommonDataTable = new DataTable();
                    dtCommonDataTable = objReportBLL.GetConsignmentWiseTruckFare();
                    //dtCommonDataTable.TableName = "ConsignmentWiseTruckFairReport";
                    //dtCommonDataTable.WriteXmlSchema(Server.MapPath(".") + "/ConsignmentWiseTruckFair.xml");
                    reportPath = "~/Rpt/ConsignmentWiseTruckFairReport.rpt";
                    break;

                case "DailyTotalCostEverySubject":
                    dtCommonDataTable = new DataTable();
                    dtCommonDataTable = objReportBLL.GetDailyTotalCostEverySubject();
                    //dtCommonDataTable.TableName = "DailyTotalCostEverySubjectReport";
                    //dtCommonDataTable.WriteXmlSchema(Server.MapPath(".") + "/DailyTotalCostEverySubject.xml");
                    reportPath = "~/Rpt/DailyTotalCostEverySubjectReport.rpt";
                    break;

                case "BuyerDetail":
                    dtCommonDataTable = new DataTable();
                    dtCommonDataTable = objReportBLL.GetBuyerDetail();
                    //dtCommonDataTable.TableName = "BuyerDetailReport";
                    //dtCommonDataTable.WriteXmlSchema(Server.MapPath(".") + "/BuyerDetail.xml");
                    reportPath = "~/Rpt/BuyerDetailReport.rpt";
                    break;

                default: break;
                }

                var document = new ReportDocument();
                document.Load(Server.MapPath(reportPath));
                document.SetDataSource(dtCommonDataTable);
                document.SetParameterValue("@DateRange", "Date From " +
                                           Convert.ToDateTime(ReportObject.FromDate).ToString("dd/MM/yy") + " To " + Convert.ToDateTime(ReportObject.ToDate).ToString("dd/MM/yy"));
                CrystalReportViewer1.ReportSource   = document;
                CrystalReportViewer1.DisplayToolbar = true;
                CrystalReportViewer1.ToolPanelView  = ToolPanelViewType.None;
                CrystalReportViewer1.Zoom(125);
            }
        }
Exemplo n.º 11
0
        protected void Page_Load(object sender, EventArgs e)
        {
            CrystalDecisions.CrystalReports.Engine.ReportDocument reportdocument = new ReportDocument();
            reportdocument = ReportFactory.GetReport(reportdocument.GetType());

            if (!IsPostBack)
            {
                string     reportname = Request.QueryString["Name"] + ".rpt";
                string     search     = Request.QueryString["Data"];
                ContextDto context    = new ContextDto();
                context.dbMainConnection = ConfigurationManager.ConnectionStrings["dbMainConnection"].ConnectionString;
                context.dbQLNSConnection = ConfigurationManager.ConnectionStrings["dbQLNSConnection"].ConnectionString;
                DataSet ds = new DataSet();
                if (reportname == "rptBaoCaoCongViec.rpt")
                {
                    GetListBaoCaoCongViecByCriteraBiz biz = new GetListBaoCaoCongViecByCriteraBiz(context);
                    if (search != null && search != "")
                    {
                        if (search.Split('|').Length > 1)
                        {
                            try
                            {
                                if (search.Split('|')[0] != "" && search.Split('|')[0] != "__/__/____")
                                {
                                    biz.TuNgay = DateTime.ParseExact(search.Split('|')[0], "dd/MM/yyyy", CultureInfo.GetCultureInfo("fr-FR")).ToString("yyyy-MM-dd");
                                }
                            }
                            catch
                            {
                                biz.TuNgay = "";
                            }
                            try
                            {
                                if (search.Split('|')[1] != "" && search.Split('|')[1] != "__/__/____")
                                {
                                    biz.DenNgay = DateTime.ParseExact(search.Split('|')[1], "dd/MM/yyyy", CultureInfo.GetCultureInfo("fr-FR")).ToString("yyyy-MM-dd");
                                }
                            }
                            catch
                            {
                                biz.DenNgay = "";
                            }
                            biz.NhanVien = search.Split('|')[2];
                            biz.PhongBan = search.Split('|')[3];
                            biz.LoginId  = search.Split('|')[4];
                            ds           = biz.Execute();
                        }
                    }
                }
                ds.Tables[0].TableName = "Tables";
                //ds.WriteXmlSchema(@"E:\rptBaoCaoCongViec.xml");
                string filepath = Server.MapPath("~/CrystalReport/Report/" + reportname);
                reportdocument.Load(filepath);
                reportdocument.SetDataSource(ds);
                reportdocument.DataDefinition.FormulaFields["tungay"].Text  = "'" + search.Split('|')[0] + "'";
                reportdocument.DataDefinition.FormulaFields["denngay"].Text = "'" + search.Split('|')[1] + "'";
                CrystalReportViewer1.HasCrystalLogo = false;
                //CrystalReportViewer1.SeparatePages = false;
                //CrystalReportViewer1.ToolPanelView = ToolPanelViewType.GroupTree;
                CrystalReportViewer1.Zoom(105);
                CrystalReportViewer1.ReportSource = reportdocument;

                Session["ReportDocument"] = reportdocument;
            }
            else
            {
                reportdocument = Session["ReportDocument"] as ReportDocument;
                CrystalReportViewer1.ReportSource = reportdocument;
            }
        }