



免费预览已结束,剩余1页可下载查看
下载本文档
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
长久以来,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年教师招聘之《小学教师招聘》题库必刷100题含答案详解ab卷
- 2025党章党规党纪知识考试题及参考答案
- 押题宝典教师招聘之《幼儿教师招聘》通关考试题库及参考答案详解(达标题)
- 教师招聘之《幼儿教师招聘》考前冲刺模拟题库提供答案解析及参考答案详解(研优卷)
- 教师招聘之《幼儿教师招聘》模拟考试高能及参考答案详解(培优b卷)
- 幼儿园贫困生资助自查报告
- 教师招聘之《小学教师招聘》通关模拟题库附答案详解(基础题)
- 教师招聘之《小学教师招聘》每日一练往年题考附答案详解
- SWITCH塞尔达传说旷野之息-1.6金手指127项修改使用说明教程
- 静脉导管常见并发症临床护理实践指南1
- 启东事业单位考试真题2022
- 导尿术导尿术课件
- 燃气轮机控制系统
- 规划用地性质调整论证报告
- 法考客观题历年真题及答案解析卷二(第3套)
- YS/T 261-2011锂辉石精矿
- 公路水运项目危大工程专项方案技术培训课件
- 五大连池市财政资金支出审批管理办法
- 货币与金融统计学课件
评论
0/150
提交评论