Example #1
0
    protected void btnPDFExport_Click(object sender, EventArgs e)
    {
        FreightEasy.Accounting.APDispute myDs = new FreightEasy.Accounting.APDispute();
        myDs.GetAllRecords(elt_account_number, Session["VENDOR"].ToString(),
                           Session["SDATE"].ToString(), Session["EDATE"].ToString());
        DataSet ds = myDs;

        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/APDispute.xsd"));
            rsm.BindNow(Server.MapPath("../../../CrystalReportResources/rpt/APDispute.rpt"));
            Response.Clear();
            Response.Buffer      = true;
            Response.ContentType = "application/pdf";
            Response.AddHeader("Content-Type", "application/pdf");
            Response.AddHeader("Content-disposition", "attachment;filename=APDispute_" + 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();
        }
    }
Example #2
0
    protected void BindGridData()
    {
        FreightEasy.Accounting.APDispute myDs = new FreightEasy.Accounting.APDispute();
        myDs.GetAllRecords(elt_account_number, Session["VENDOR"].ToString(),
                           Session["SDATE"].ToString(), Session["EDATE"].ToString());
        DataSet ds = myDs;

        UltraWebGrid1.DataSource = ds;
        UltraWebGrid1.DataBind();
        UltraWebGrid1.ExpandAll();
    }
Example #3
0
    protected void btnGo_Click(object sender, ImageClickEventArgs e)
    {
        FreightEasy.Accounting.APDispute myDs = new FreightEasy.Accounting.APDispute();
        string elt_account_number             = Request.Cookies["CurrentUserInfo"]["elt_account_number"];

        myDs.GetAllRecords(elt_account_number, hVendorAcct.Value,
                           Webdatetimeedit1.Text, Webdatetimeedit2.Text);

        Session["Accounting_sPeriodBegin"] = Webdatetimeedit1.Text;
        Session["Accounting_sPeriodEnd"]   = Webdatetimeedit2.Text;
        Session["Accounting_sCompanName"]  = this.lstVendorName.Text;



        DataSet ds = new DataSet();

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