示例#1
0
    protected void btn_genRpt_Click(object sender, EventArgs e)
    {
        string  yrmo    = ddlYrmo.SelectedItem.Text;
        DataSet ds      = new DataSet();
        DataSet dsFinal = new DataSet();

        ds.Clear();
        dsFinal.Clear();
        string[][] cols       = { new string[] { "YRMO", "EBA Count", "EBA Amount", "Anthem Count", "Anthem Amount", "EBA Count Variance", "EBA vs Anthem % Count Variance", "Threshold", "Threshold Level" }, new string[] { "YRMO", "Source", "EBA Count", "Anthem Count" } };
        string[][] colsFormat = { new string[] { "string", "number", "decimal", "number", "decimal", "number", "decimal", "decimal", "string" }, new string[] { "string", "string", "number", "number" } };
        string[]   sheetnames = { "EAP", "EAP_Count_Details" };
        string[]   titles     = { "EAP Billing Reconciliation for YRMO - " + yrmo, "EAP Billing Headcounts Detail for YRMO - " + yrmo };

        try
        {
            ds = ReconDAL.GetEAPReconData(yrmo);
            ds.Tables[0].TableName = "eapTable";
            dsFinal.Tables.Add(ds.Tables[0].Copy());
            dsFinal.Tables[0].TableName = "eapTableF";
            ds.Clear();
            ds = ReconDAL.GetEAPReconDetails(yrmo);
            ds.Tables[0].TableName = "detTable";
            dsFinal.Tables.Add(ds.Tables[0].Copy());
            dsFinal.Tables[1].TableName = "detTableF";
            ds.Clear();
            ExcelReport.ExcelXMLRpt(dsFinal, "EAPRecon_" + yrmo, sheetnames, titles, cols, colsFormat);
        }
        catch (Exception ex)
        {
            MultiView1.SetActiveView(view_main);
            lbl_error.Text = "Error in generating excel report" + ex.Message;
        }
    }