




全文預(yù)覽已結(jié)束
下載本文檔
版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡介
長久以來,oracle運(yùn)行的excel報(bào)表經(jīng)常采用csv格式,用戶需要view output,然后另存為本地csv文件,才能用excel打開,而且不能保留excel格式,包括字段長度,字段格式掩碼,以及公式等。因?yàn)轫?xiàng)目需要excel文件包含公式,所以采用以下方案解決。(1)將格式template文件在excel中制做,保存時(shí),選取XML Spreadsheet格式,生成xml 模板文件,這樣這個(gè)文件可以包含公式等。(2)采用fnd_file.put_line方式將xml模板文件輸出,數(shù)據(jù)列可以依據(jù)編程要求修改。(3)建立concurrent program采用XML輸出方式。(4)這樣用戶在view output時(shí)候,瀏覽器可以自動(dòng)打開這個(gè)excel文件。附上package源代碼,本例子在application 11.5.8,和本機(jī)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ì)明體 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等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。
最新文檔
- 2023年都市情感行業(yè)洞察報(bào)告及未來五至十年預(yù)測分析報(bào)告
- 高低壓考試試題及答案
- 建筑制圖基礎(chǔ)A電大考試試題及答案
- 2025年熱障涂層項(xiàng)目分析及研究報(bào)告
- 建筑水暖考試試題及答案
- 空乘妝容考試試題及答案
- 叉車常識(shí)考試試題及答案
- 河源社工考試試題及答案
- 電力二建考試試題及答案
- a類安全員證考試試題及答案
- 關(guān)于菜鳥驛站轉(zhuǎn)讓合同范本
- DL-T1342-2014電氣接地工程用材料及連接件
- 學(xué)校體育工作條例
- 施工現(xiàn)場視頻監(jiān)控系統(tǒng)施工方案
- 公安情報(bào)學(xué)試卷附有答案
- 2024年貴州省貴陽市南明區(qū)中考一??荚囄锢碓囶}
- 電梯維護(hù)保養(yǎng)規(guī)則(TSG T5002-2017)
- 水準(zhǔn)測量記錄表自動(dòng)計(jì)算(轉(zhuǎn)點(diǎn))
- 信息化時(shí)代背景下小學(xué)體育與健康課程改革研究 論文
- 量化考研-2024中國大學(xué)生考研白皮書-新東方
- 潛在失效模式及后果分析(FMEA)作業(yè)規(guī)范全套
評(píng)論
0/150
提交評(píng)論