コード例 #1
0
    protected void btnPDFExport_Click(object sender, EventArgs e)
    {
        FreightEasy.PNL.AirExportPNL pnlDS = new FreightEasy.PNL.AirExportPNL();
        pnlDS.GetAllRecords(elt_account_number, Session["MAWB"].ToString(),
                            "", "");
        DataSet             ds  = pnlDS;
        ReportSourceManager rsm = null;

        try
        {
            rsm = new ReportSourceManager();
            rsm.LoadDataSet(ds);
            rsm.LoadCompanyInfo(elt_account_number, Server.MapPath("../../../ClientLogos/" + elt_account_number + ".jpg"));
            rsm.WriteXSD(Server.MapPath("../../../CrystalReportResources/xsd/AirExportPNL.xsd"));
            rsm.BindNow(Server.MapPath("../../../CrystalReportResources/rpt/AirExportPNL.rpt"));
            Response.Clear();
            Response.Buffer      = true;
            Response.ContentType = "application/pdf";
            Response.AddHeader("Content-Type", "application/pdf");
            Response.AddHeader("Content-disposition", "attachment;filename=AirExportPNL_" + System.DateTime.Today.ToString("yyyy-MM-dd") + ".pdf");

            MemoryStream oStream;
            oStream = (MemoryStream)rsm.getReportDocument().ExportToStream(ExportFormatType.PortableDocFormat);

            Response.BinaryWrite(oStream.ToArray());
        }
        catch { }
        finally
        {
            rsm.CloseReportDocumnet();
            Response.Flush();
            Response.End();
        }
    }
コード例 #2
0
    protected void BindGridData()
    {
        FreightEasy.PNL.AirExportPNL myDs = new FreightEasy.PNL.AirExportPNL();
        myDs.GetAllRecords(elt_account_number, Session["MAWB"].ToString(),
                           "", "");
        DataSet ds = myDs;

        UltraWebGrid1.DataSource = ds;
        UltraWebGrid1.DataBind();
        UltraWebGrid1.ExpandAll();
    }
コード例 #3
0
    protected void Button1_Click(object sender, EventArgs e)
    {
        FreightEasy.PNL.AirExportPNL myDs = new FreightEasy.PNL.AirExportPNL();
        myDs.GetAllRecords(elt_account_number, lstSearchNum.Text,
                           "", "");
        DataSet ds = new DataSet();

        foreach (DataTable dt in myDs.Tables)
        {
            ds.Tables.Add(dt.Copy());
        }
        Session["Accounting_sSelectionParam"] = "AEPNL";
        Session["AEPNLDS"] = ds;
        ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "RediretThis", "window.top.location.href='/AirExport/AEPNL/dataready'", true);

        // Response.Redirect("PNLResultAE.aspx?MAWB=" + lstSearchNum.Text);
    }