示例#1
0
        private void LoadReport()
        {
            rsm = new ReportSourceManager();
            DataColumn col = null;

            string[] str = new string[10];

            str[0] = Session["Accounting_sPeriod"].ToString();
            str[1] = Request.Cookies["CurrentUserInfo"]["login_name"];
            str[2] = Session["PNLkey"].ToString();
            string rsType = Request.QueryString["rs"];

            string elt_num = Request.Cookies["CurrentUserInfo"]["elt_account_number"];

            try
            {
                rsm.LoadDataSet(ds);
                rsm.LoadCompanyInfo(elt_num, Server.MapPath("../../../ClientLogos/" + elt_num + ".jpg"));
                rsm.LoadOtherInfo(str);
                rsm.WriteXSD(Server.MapPath("../../../CrystalReportResources/xsd/pnl.xsd"));

                rsm.TableRename("Invoice", "cTmp");

                if (!rsm.BindNow(Server.MapPath("../../../CrystalReportResources/rpt/pnl_" + rsType + ".rpt")))
                {
                    Response.Write("failed to bind");
                    Response.End();
                }
            }
            catch (Exception e)
            {
                Response.Write(e.ToString());
                Response.End();
            }
        }