




全文預(yù)覽已結(jié)束
下載本文檔
版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進行舉報或認領(lǐng)
文檔簡介
長久以來,oracle運行的excel報表經(jīng)常采用csv格式,用戶需要view output,然后另存為本地csv文件,才能用excel打開,而且不能保留excel格式,包括字段長度,字段格式掩碼,以及公式等。因為項目需要excel文件包含公式,所以采用以下方案解決。(1)將格式template文件在excel中制做,保存時,選取XML Spreadsheet格式,生成xml 模板文件,這樣這個文件可以包含公式等。(2)采用fnd_file.put_line方式將xml模板文件輸出,數(shù)據(jù)列可以依據(jù)編程要求修改。(3)建立concurrent program采用XML輸出方式。(4)這樣用戶在view output時候,瀏覽器可以自動打開這個excel文件。附上package源代碼,本例子在application 11.5.8,和本機excel 2003,ie6.0測試正常一下為Sample函數(shù)包:create or replace package TEST_XML_PKG isprocedure main(errbuf OUT VARCHAR2, retcode OUT VARCHAR2);end TEST_XML_PKG;/create or replace package body TEST_XML_PKG isprocedure main(errbuf OUT VARCHAR2, retcode OUT VARCHAR2)isbeginfnd_file.put_line(fnd_file.output,<?xml version=1.0?>);fnd_file.put_line(fnd_file.output,<?mso-application progid=Excel.Sheet?>);fnd_file.put_line(fnd_file.output,<Workbook xmlns=urn:schemas-microsoft-com:office:spreadsheet);fnd_file.put_line(fnd_file.output, xmlns:o=urn:schemas-microsoft-com:office:office);fnd_file.put_line(fnd_file.output, xmlns:x=urn:schemas-microsoft-com:office:excel);fnd_file.put_line(fnd_file.output, xmlns:ss=urn:schemas-microsoft-com:office:spreadsheet);fnd_file.put_line(fnd_file.output, xmlns:html=>/TR/REC-html40>);fnd_file.put_line(fnd_file.output, <DocumentProperties xmlns=urn:schemas-microsoft-com:office:office>);fnd_file.put_line(fnd_file.output,<Author>Authorised User</Author>);fnd_file.put_line(fnd_file.output,<LastAuthor>Authorised User</LastAuthor>);fnd_file.put_line(fnd_file.output,<Created>2005-01-26T07:43:18Z</Created>);fnd_file.put_line(fnd_file.output,<Company>test</Company>);fnd_file.put_line(fnd_file.output,<Version>11.6360</Version>);fnd_file.put_line(fnd_file.output, </DocumentProperties>);fnd_file.put_line(fnd_file.output, <ExcelWorkbook xmlns=urn:schemas-microsoft-com:office:excel>);fnd_file.put_line(fnd_file.output,<WindowHeight>5070</WindowHeight>);fnd_file.put_line(fnd_file.output,<WindowWidth>10635</WindowWidth>);fnd_file.put_line(fnd_file.output,<WindowTopX>360</WindowTopX>);fnd_file.put_line(fnd_file.output,<WindowTopY>75</WindowTopY>);fnd_file.put_line(fnd_file.output,<ProtectStructure>False</ProtectStructure>);fnd_file.put_line(fnd_file.output,<ProtectWindows>False</ProtectWindows>);fnd_file.put_line(fnd_file.output, </ExcelWorkbook>);fnd_file.put_line(fnd_file.output, <Styles>);fnd_file.put_line(fnd_file.output,<Style. ss:ID=Default ss:Name=Normal>);fnd_file.put_line(fnd_file.output, <Alignment ss:Vertical=Center/>);fnd_file.put_line(fnd_file.output, <Borders/>);fnd_file.put_line(fnd_file.output, <Font ss:FontName=新細明體 x:Family=Roman ss:Size=12/>);fnd_file.put_line(fnd_file.output, <Interior/>);fnd_file.put_line(fnd_file.output, <NumberFormat/>);fnd_file.put_line(fnd_file.output, <Protection/>);fnd_file.put_line(fnd_file.output,</Style>);fnd_file.put_line(fnd_file.output,<Style. ss:ID=s21>);fnd_file.put_line(fnd_file.output, <Font ss:FontName=Arial Unicode MS x:CharSet=134 x:Family=Swiss);fnd_file.put_line(fnd_file.output, ss:Size=12/>);fnd_file.put_line(fnd_file.output,</Style>);fnd_file.put_line(fnd_file.output,<Style. ss:ID=s22>);fnd_file.put_line(fnd_file.output, <Font ss:FontName=Arial Unicode MS x:CharSet=134 x:Family=Swiss);fnd_file.put_line(fnd_file.output, ss:Size=12 ss:Color=#FF0000/>);fnd_file.put_line(fnd_file.output,</Style>);fnd_file.put_line(fnd_file.output, </Styles>);fnd_file.put_line(fnd_file.output, <Worksheet ss:Name=Sheet1>);fnd_file.put_line(fnd_file.output,<Table ss:ExpandedColumnCount=3 ss:ExpandedRowCount=1 x:FullColumns=1);fnd_file.put_line(fnd_file.output, x:FullRows=1 ss:DefaultColumnWidth=54 ss:DefaultRowHeight=16.5>);fnd_file.put_line(fnd_file.output, <Row ss:Height=17.25>);fnd_file.put_line(fnd_file.output, <Cell ss:StyleID=s22><Data ss:Type=Number>11</Data></Cell>);fnd_file.put_line(fnd_file.output, <Cell ss:StyleID=s21><Data ss:Type=Number>4</Data></Cell>);fnd_file.put_line(fnd_file.output,<Cell ss:StyleID=s21 ss:Formula=RC-2*RC-1><Data ss:Type=Number>44</Data></Cell>);fnd_file.put_line(fnd_file.output, </Row>);fnd_file.put_line(fnd_file.output,</Table>);fnd_file.put_line(fnd_file.output,<WorksheetOptions xmlns=urn:schemas-microsoft-com:office:excel>);fnd_file.put_line(fnd_file.output, <Print>);fnd_file.put_line(fnd_file.output, <ValidPrinterInfo/>);fnd_file.put_line(fnd_file.output, <PaperSizeIndex>9</PaperSizeIndex>);fnd_file.put_line(fnd_file.output, <HorizontalResolution>600</HorizontalResolution>);fnd_file.put_line(fnd_file.output, <VerticalResolution>0</VerticalResolution>);fnd_file.put_line(fnd_file.output, </Print>);fnd_file.put_line(fnd_file.output, <Selected/>);fnd_file.put_line(fnd_file.output, <Panes>);fnd_file.put_line(fnd_file.output, <Pane>);fnd_file.put_line(fnd_file.output, <Number>3</Number>);fnd_file.put_line(fnd_file.output, <ActiveCol>2</ActiveCol>);fnd_file.put_line(fnd_file.output, </Pane>);fnd_file.put_line(fnd_file.output, </Panes>);fnd_file.put_line(fnd_file.output, <ProtectObjects>False</ProtectObjects>);fnd_file.put_line(fnd_file.output, <ProtectScenarios>False</ProtectScenarios>);fnd_file.put_line(fnd_file.output,</WorksheetOptions>);fnd_file.put_line(fnd_file.output, </Worksheet>);fnd_file.put_line(fnd_file.output, <Worksheet ss:Name=Sheet2>);fnd_file.put_line(fnd_file.output,<Table ss:ExpandedColumnCount=0 ss:ExpandedRowCount=0 x:FullColumns=1);fnd_file.put_line(fnd_file.output, x:FullRows=1 ss:DefaultColumnWidth=54 ss:DefaultRowHeight=16.5/>);fnd_file.put_line(fnd_file.output,<WorksheetOptions xmlns=urn:schemas-microsoft-com:office:excel>);fnd_file.put_line(fnd_file.output, <ProtectObjects>False</ProtectObjects>);fnd_file.put_line(fnd_file.output, <ProtectScenarios>False</ProtectScenarios>);fnd_file.put_line(fnd_file.output,</WorksheetOptions>);fnd_file.put_line(fnd_file.output, </Worksheet>);fnd_file.put_line(fnd_file.output, <Workshee
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 紡織工程師證書考試適應(yīng)性培訓(xùn)試題及答案
- 藥用拉丁語試題及答案
- 高空作業(yè)試題及答案解析
- 紡織品設(shè)計師證書考試基礎(chǔ)材料試題及答案
- 紡織品設(shè)計的文化傳播與市場反響試題及答案
- 紡織品的設(shè)計倫理與可持續(xù)性考量試題及答案
- 伐木合同協(xié)議書
- 合作協(xié)議書和合同協(xié)議書
- 長期委托加工合同協(xié)議書
- 二手房合同協(xié)議書
- 2021年廣東深圳中考滿分作文《這創(chuàng)意讓我激動不已》
- 安裝窗戶高空作業(yè)合同安全責(zé)任書
- 小學(xué)低年級游戲化學(xué)習(xí)對數(shù)學(xué)興趣激發(fā)的研究
- 甲狀腺手術(shù)甲狀旁腺保護
- 2024年初三數(shù)學(xué)競賽考試試題
- 2024年醫(yī)院依法執(zhí)業(yè)培訓(xùn)課件
- DL∕T 1009-2016 水電廠計算機監(jiān)控系統(tǒng)運行及維護規(guī)程
- 阿里巴巴員工紀律制度
- 人教部編版七(下)語文《愛蓮說》練習(xí)
- 關(guān)于菜鳥驛站轉(zhuǎn)讓合同范本
- DL-T1342-2014電氣接地工程用材料及連接件
評論
0/150
提交評論