ireport 导出word格式
导出word格式 在它的文档中也没有,
// String sql = "select * from cfg_static_user_relation"; 如果传SQL语句的话用该句
String ReportModel ="/test/test.jasper";
File reportFile = new File(application.getRealPath(ReportModel));
System.out.println(reportFile);
if(!reportFile.exists())
throw new JRRuntimeException("报表绘制失败,找不到报表配置文件!");
JasperReport jasperReport = (JasperReport)JRLoader.loadObject(reportFile.getPath());
// Connection conn=null;
// conn=JdbcConnectionFactory.getConnection();
Collection coll = UserService.generalCollecion();
JRDataSource sor = new JRBeanCollectionDataSource(coll);
System.out.println(application.getRealPath("test/1224215057359.png"));
Map parameters = new HashMap();
parameters.put("re",application.getRealPath("test/1224215057359.png"));
// JasperPrint jasperPrint = JasperFillManager.fillReport(jasperReport ,parameters,conn);
JasperPrint jasperPrint = JasperFillManager.fillReport(jasperReport ,parameters,sor);
JRExporter exporter = new JRRtfExporter();
String tmpFilename = System.currentTimeMillis() + ".doc";
response.setContentType("application/msword;charset=utf-8");
response.setHeader("Content-Disposition", "attachment; filename="+tmpFilename);
exporter.setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint);
exporter.setParameter(JRExporterParameter.OUTPUT_STREAM, response.getOutputStream());
exporter.exportReport();
这样就可以导出WORD格式了
--------------------------------------------------------------------------------
提问者对于答案的评价:
我的已经出来了‘
哎
我用的是金山的WSP办公
换了office的就可以了
jquery ajax 访问servlet导出word的方法 可以访问 但是response返回的
导出文件和下载文件一样,不定义输出格式是不会输出文件的,只会返回默认格式的内容
谁了解用jquery将网页内容导出word的方法
这个有专门的插件,例如PageOffice还有软行什么的,做专业的网上Office开发的,可以去看看
jquery 怎么通过tableexport 将html导出pdf文件
tableExport是一个jQuery插件可以将HTML中表导出JSON、XML、PNG、CSV、TXT,SQL,MS-Word,Ms-Excel Ms-Powerpoint、PDF,功能相当强大。
jquery怎么自定义导出按钮
您可以创建一个带有工具栏(toolbar)和按钮(button)的对话框(dialog),可以从 HTML 标记创建。这个教程描述如何添加工具栏(toolbar)和按钮(button)到对话框(dialog),没有任何的 javascript 代码。
创建对话框(Dialog)
<div id="dd" class="easyui-dialog" title="My Dialog" style="width:400px;height:200px;padding:10px"
toolbar="#dlg-toolbar" buttons="#dlg-buttons">
Dialog Content.
</div>
创建工具栏(Toolbar)
<div id="dlg-toolbar">
<table cellpadding="0" cellspacing="0" style="width:100%">
<tr>
<td>
<a href="#" class="easyui-linkbutton" iconCls="icon-edit" plain="true">Edit</a>
<a href="#" class="easyui-linkbutton" iconCls="icon-help" plain="true">Help</a>
</td>
<td style="text-align:right">
<input></input><a href="#" class="easyui-linkbutton" iconCls="icon-search" plain="true"></a>
</td>
</tr>
</table>
</div>
创建按钮(Buttons)
<div id="dlg-buttons">
<table cellpadding="0" cellspacing="0" style="width:100%">
<tr>
<td>
<img src="email.gif"/>
</td>
<td style="text-align:right">
<a href="#" class="easyui-linkbutton" iconCls="icon-save" onclick="javascript:alert('save')">Save</a>
<a href="#" class="easyui-linkbutton" iconCls="icon-cancel" onclick="javascript:$('#dd').dialog('close')">Close</a>
</td>
</tr>
</table>
</div>
请注意,对话框(dialog)的工具栏(toolbar)和按钮(buttons)属性也可以通过 string 值指定,它将充当作为一个选择器去选择一个适当的 DIV 元素,并追加到工具栏(toolbar)或者按钮(buttons)的位置。
请教如何用JQuery导入导出excel表格
可以用javascript的文件相关的函数,我忘记具体怎么做了(曾经做过,不难。),只有大体思路。javascript(网页)操作本地文件是要有个许可的,一般在浏览器的安全选项卡里面要设置一下。用生成一个对象,这个对象关联到excel对象(要求客户端必须装excel)。然后写excel表格的单元格等等。到网上搜索一下javascript操作excel就会有的。
请教如何用JQuery导入导出excel表格
用jtable 插件,表单很容易导出各种格式的数据。
转载请注明出处51数据库 » jqueryword导出 Jquery可以导出word么
穿婚纱当新娘