如何在 asp.net 中将两个远点数据设置为单个 excell 文件



我知道如何设置单个Farpoint数据以在excel中打印但我不知道一个 Excell 文件中的两个 Farpoint 数据。我想要一个 excel 文件中的两个 Farpoint

      string newfilepath = "";
        string newfilepathmnt = "";
        object mngrclassobj = Session["Mngrobj"];
        SessionManager mngrclass = (SessionManager)mngrclassobj;
        newfilepath = mngrclass.ExcelPath + "TruckUtilizationBaseFiguresCompany.xls";
        newfilepathmnt = mngrclass.ExcelPath + "TruckUtilizationbaseFiguresCompany.xls";

        string filepath = newfilepath;
        string filepathmnt = newfilepathmnt; 
        fpsDetails.SaveExcel(filepath, FarPoint.Web.Spread.Model.IncludeHeaders.BothCustomOnly);
        fpsMonthlySetup.SaveExcel(filepathmnt, FarPoint.Web.Spread.Model.IncludeHeaders.BothCustomOnly);

        FileInfo file = new FileInfo(filepath);

要将工作表保存到同一个Excel工作簿,您需要将工作表添加到FpSpread的一个实例中,然后使用SaveExcel保存该实例。请尝试创建一个新的 FpSpread,使用 FpSpread.Sheets.Add 将这些工作表添加到其中,然后调用 FpSpread.SaveExcel。

最新更新