亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

如何在 Acumatica Framework 上創建 Excel 報告?

如何在 Acumatica Framework 上創建 Excel 報告?

C#
嚕嚕噠 2021-11-14 15:40:48
我正在嘗試使用自定義按鈕創建包含頁面信息的 Excel 文檔。Excel 文檔應該是打開的,然后由用戶來保存它 - 與嵌入在一些 Acumatica 網格中的“導出到 Excel”按鈕完成的操作類似。我閱讀了這篇文章,其中要求類似的內容。但是,new PX.Export.Excel.Core.Package() 由于無法識別庫,因此添加對象 失敗。也許這在最新版本中已被棄用?我創建了這個控制臺項目using Excel = Microsoft.Office.Interop.Excel;namespace ConsoleApp1{    class Program    {        static void Main(string[] args)        {            var excelApp = new Excel.Application();            // Make the object visible.            excelApp.Visible = true; ;            // Create a new, empty workbook and add it to the collection returned             // by property Workbooks. The new workbook becomes the active workbook.            // Add has an optional parameter for specifying a praticular template.             // Because no argument is sent in this example, Add creates a new workbook.             excelApp.Workbooks.Add();            excelApp.Cells[1, "A"] = "SNO";            excelApp.Cells[2, "B"] = "A";            excelApp.Cells[2, "C"] = "1122";            Excel._Worksheet workSheet = (Excel.Worksheet)excelApp.ActiveSheet;        }    }}并正常工作。但是在 Acumatica 中我收到以下錯誤Retrieving the COM class factory for component with CLSID{00024500-0000-0000-C000-000000000046} failed due to the following error: 80070005 Access is denied.(Exception from HRESULT: 0x80070005 (E_ACCESSDENIED)).謝謝。
查看完整描述

1 回答

?
MYYA

TA貢獻1868條經驗 獲得超4個贊

您需要在擴展庫中添加 PX.Export.dll 的引用(來自 AcumaticaSite -> Bin 文件夾)以使用PX.Export.Excel.Core.Package().


查看完整回答
反對 回復 2021-11-14
  • 1 回答
  • 0 關注
  • 189 瀏覽

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號