翻譯|使用教程|編輯:李顯亮|2019-09-03 09:54:16.843|閱讀 552 次
概述:在接下來的系列教程中,將為開發者帶來Aspose.Cells for .NET的一系列使用教程,本文將介紹如何將文件保存到不同的響應對象,不如PDF、XLS等。
# 界面/圖表報表/文檔/IDE等千款熱門軟控件火熱銷售中 >>
相關鏈接:
Aspose.Cells for .NET是Excel電子表格編程API,可加快電子表格管理和處理任務,支持構建具有生成,修改,轉換,呈現和打印電子表格功能的跨平臺應用程序。
【下載體驗Aspose.Cells for .NET最新版】
在接下來的系列教程中,將為開發者帶來Aspose.Cells for .NET的一系列使用教程,例如關于加載保存轉換、字體、渲染、繪圖、智能標記等等。
在使用Aspose.Cells時,可以動態生成文件并將其直接發送到客戶機瀏覽器。為此,請使用Save方法的一個特殊重載版本,該版本接受以下參數:
//文檔目錄的路徑。 string dataDir = RunExamples.GetDataDir(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); HttpResponse Response = null; //加載源工作簿 Workbook workbook = new Workbook(); if (Response != null) { //以Excel2003 XLS格式保存 workbook.Save(Response, dataDir + "output.xls", ContentDisposition.Inline, new XlsSaveOptions()); Response.End(); }
//文檔目錄的路徑。 string dataDir = RunExamples.GetDataDir(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); HttpResponse Response = null; //加載源工作簿 Workbook workbook = new Workbook(); if (Response != null) { //以Xlsx格式保存 workbook.Save(Response, dataDir + "output.xlsx", ContentDisposition.Attachment, new OoxmlSaveOptions()); Response.End(); }
//文檔目錄的路徑。 string dataDir = RunExamples.GetDataDir(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); HttpResponse Response = null; //創建工作簿對象 Workbook workbook = new Workbook(); if (Response != null) { // 以Pdf格式保存 workbook.Save(Response, dataDir + "output.pdf", ContentDisposition.Attachment, new PdfSaveOptions()); Response.End(); }
更多Aspose.Cells for .NET教程示例,可點擊這里查看哦~
*想要購買Aspose.Cells for .NET正版授權的朋友可以了解詳情哦~
歡迎加入ASPOSE技術交流QQ群,各類資源及時分享,技術問題交流討論!(掃描下方二維碼加入群聊)
本站文章除注明轉載外,均為本站原創或翻譯。歡迎任何形式的轉載,但請務必注明出處、不得修改原文相關鏈接,如果存在內容上的異議請郵件反饋至chenjj@fc6vip.cn