




全文预览已结束
下载本文档
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
长久以来,oracle运行的excel报表经常采用csv格式,用户需要view output,然后另存为本地csv文件,才能用excel打开,而且不能保留excel格式,包括字段长度,字段格式掩码,以及公式等。因为项目需要excel文件包含公式,所以采用以下方案解决。(1)将格式template文件在excel中制做,保存时,选取XML Spreadsheet格式,生成xml 模板文件,这样这个文件可以包含公式等。(2)采用fnd_file.put_line方式将xml模板文件输出,数据列可以依据编程要求修改。(3)建立concurrent program采用XML输出方式。(4)这样用户在view output时候,浏览器可以自动打开这个excel文件。附上package源代码,本例子在application 11.5.8,和本机excel 2003,ie6.0测试正常一下为Sample函数包: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. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 精酿啤酒行业市场分析及流程研究
- 环评公众参与中的利益相关者沟通策略研究报告2025
- 电子厂员工入职笔试题及答案-企业管理
- 护理铺床试题及答案
- 茅台酒厂考试题及答案
- 2025年中职钳工考试题目及答案
- 2025年烟囱设计题目及答案
- 物理实验浮力考试题及答案
- 足球考试题库及答案
- 2025年山西省《保密知识竞赛必刷50题》考试题库及完整答案
- 2025年高级政工师理论考试题库(浓缩500题)
- 耳前瘘管的护理小讲课
- 冠心病危险因素管理
- 高速安全知识
- 人工呼吸笔试题及答案
- 《C语言程序设计(第2版)(微课版)》全套教学课件
- 流程仿真与优化-深度研究
- 指向社会责任的“海水稻渗透现象”主线式情境教学实践
- MZ-T 《殡葬公共服务网络平台技术要求》编制说明
- 舌癌手术护理配合
- 2025年游泳馆设施维护承包合同
评论
0/150
提交评论