原創(chuàng)|使用教程|編輯:郝浩|2013-10-12 15:25:14.000|閱讀 829 次
概述:本系列教程主要為大家講解如何使用DevExpress Document Server進(jìn)行Excel工作表的相關(guān)操作。
# 界面/圖表報(bào)表/文檔/IDE等千款熱門軟控件火熱銷售中 >>
相關(guān)鏈接:
文檔操作組件DevExpress Document Server的表格服務(wù)器,能夠在無(wú)需Excel下完成對(duì)Excel等表格文檔的靈活操作,實(shí)現(xiàn)大多數(shù)Excel功能。本系列教程主要為大家講解如何使用DevExpress Document Server進(jìn)行Excel工作表的相關(guān)操作。
使用Worksheet.ActiveView中的WorksheetView.Orientation屬性能夠?qū)崿F(xiàn)工作表頁(yè)面放心的設(shè)置,PageOrientation枚舉已經(jīng)列出了可用的方向類型。可以參考以下代碼:
// Set the page orientation to Landscape. workbook.Worksheets[0].ActiveView.Orientation = PageOrientation.Landscape;
Worksheet.ActiveView返回的WorksheetView.Margins可以設(shè)置頁(yè)邊距,但首先要選擇頁(yè)邊距的度量單位,這個(gè)需要通過(guò)Workbook.Unit屬性來(lái)設(shè)置,其中的DocumentUnit枚舉就包括了所有可用的單位。
// Select a unit of measure used within the workbook. workbook.Unit = DevExpress.Office.DocumentUnit.Inch; // Access page margins. Margins pageMargins = workbook.Worksheets[0].ActiveView.Margins; // Specify page margins. pageMargins.Left = 1; pageMargins.Top = 1.5F; pageMargins.Right = 1; pageMargins.Bottom = 0.8F; // Specify header and footer margins. pageMargins.Header = 1; pageMargins.Footer = 0.4F;
Worksheet.ActiveView中的WorksheetView.PaperKind屬性用于設(shè)置頁(yè)面的紙張尺寸,System.Drawing.Printing.PaperKind枚舉中包括了所有可用的頁(yè)面尺寸。WorksheetView.PaperKind屬性在打印時(shí)是有效的。可以參考以下代碼:
// Select the page's paper size. workbook.Worksheets[0].ActiveView.PaperKind = System.Drawing.Printing.PaperKind.A4;
DevExpress Document Server提供了WorksheetView.Zoom屬性來(lái)實(shí)現(xiàn)放大和縮小工作表,不過(guò)只支持整倍數(shù)的縮放。這個(gè)縮放在打印時(shí)無(wú)效。參考以下代碼:
// Zoom in the worksheet view. workbook.Worksheets[0].ActiveView.Zoom = 150;
通過(guò)DevExpress Document Server放大了1.5倍的工作表如下圖所示:
本站文章除注明轉(zhuǎn)載外,均為本站原創(chuàng)或翻譯。歡迎任何形式的轉(zhuǎn)載,但請(qǐng)務(wù)必注明出處、不得修改原文相關(guān)鏈接,如果存在內(nèi)容上的異議請(qǐng)郵件反饋至chenjj@fc6vip.cn
文章轉(zhuǎn)載自:慧都控件網(wǎng)