Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/348.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 如何禁用";“网格线”;Excel报表中的选项?_Java_Jasper Reports_Export To Excel_Xls - Fatal编程技术网

Java 如何禁用";“网格线”;Excel报表中的选项?

Java 如何禁用";“网格线”;Excel报表中的选项?,java,jasper-reports,export-to-excel,xls,Java,Jasper Reports,Export To Excel,Xls,我有一个jasper报告,在excel中输出,我想禁用excel中的“网格线”选项,背景为全白色 我怎样才能在jasper报告中做到这一点 编辑:下面的例子对我有用 您可以直接在jrxml中设置此属性 ,默认值为true jrxml示例 <jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" x

我有一个jasper报告,在excel中输出,我想禁用excel中的“网格线”选项,背景为全白色

我怎样才能在jasper报告中做到这一点

编辑:下面的例子对我有用


您可以直接在jrxml中设置此属性

,默认值为
true

jrxml示例

<jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="reputation" printOrder="Horizontal" pageWidth="595" pageHeight="842" whenNoDataType="AllSectionsNoDetail" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" isSummaryNewPage="true" uuid="a88bd694-4f90-41fc-84d0-002b90b2d73e">
     <property name="net.sf.jasperreports.export.xls.show.gridlines" value="false"/>
     ....
</jasperReport>
JRXlsExporter exporterXls = new JRXlsExporter();
exporterXls.setExporterInput(new SimpleExporterInput(jasperPrint));
exporterXls.setExporterOutput(new SimpleOutputStreamExporterOutput(new File("excelTest.xls")));
SimpleXlsReportConfiguration configXls = new SimpleXlsReportConfiguration();
configXls.setShowGridLines(false);
//set your additional settings
exporterXls.setConfiguration(configXls);
exporterXls.exportReport();
<jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="reputation" printOrder="Horizontal" pageWidth="595" pageHeight="842" whenNoDataType="AllSectionsNoDetail" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" isSummaryNewPage="true" uuid="a88bd694-4f90-41fc-84d0-002b90b2d73e">
     <property name="net.sf.jasperreports.export.xls.show.gridlines" value="false"/>
     ....
</jasperReport>
JRXlsExporter exporterXls = new JRXlsExporter();
exporterXls.setExporterInput(new SimpleExporterInput(jasperPrint));
exporterXls.setExporterOutput(new SimpleOutputStreamExporterOutput(new File("excelTest.xls")));
SimpleXlsReportConfiguration configXls = new SimpleXlsReportConfiguration();
configXls.setShowGridLines(false);
//set your additional settings
exporterXls.setConfiguration(configXls);
exporterXls.exportReport();
注意:代码显示了xls(因为标记了xls)示例,但相同 属性可用于
SimpleXlsxReportConfiguration
(xlsx)


您可以直接在jrxml中设置此属性

,默认值为
true

jrxml示例

<jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="reputation" printOrder="Horizontal" pageWidth="595" pageHeight="842" whenNoDataType="AllSectionsNoDetail" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" isSummaryNewPage="true" uuid="a88bd694-4f90-41fc-84d0-002b90b2d73e">
     <property name="net.sf.jasperreports.export.xls.show.gridlines" value="false"/>
     ....
</jasperReport>
JRXlsExporter exporterXls = new JRXlsExporter();
exporterXls.setExporterInput(new SimpleExporterInput(jasperPrint));
exporterXls.setExporterOutput(new SimpleOutputStreamExporterOutput(new File("excelTest.xls")));
SimpleXlsReportConfiguration configXls = new SimpleXlsReportConfiguration();
configXls.setShowGridLines(false);
//set your additional settings
exporterXls.setConfiguration(configXls);
exporterXls.exportReport();
<jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="reputation" printOrder="Horizontal" pageWidth="595" pageHeight="842" whenNoDataType="AllSectionsNoDetail" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" isSummaryNewPage="true" uuid="a88bd694-4f90-41fc-84d0-002b90b2d73e">
     <property name="net.sf.jasperreports.export.xls.show.gridlines" value="false"/>
     ....
</jasperReport>
JRXlsExporter exporterXls = new JRXlsExporter();
exporterXls.setExporterInput(new SimpleExporterInput(jasperPrint));
exporterXls.setExporterOutput(new SimpleOutputStreamExporterOutput(new File("excelTest.xls")));
SimpleXlsReportConfiguration configXls = new SimpleXlsReportConfiguration();
configXls.setShowGridLines(false);
//set your additional settings
exporterXls.setConfiguration(configXls);
exporterXls.exportReport();
注意:代码显示了xls(因为标记了xls)示例,但相同 属性可用于
SimpleXlsxReportConfiguration
(xlsx)


谢谢你,如果你能帮我回答另一个问题的话,这正是我想要的:我有一份报告,只需要在每页表格的最后一行打印图像。当表达式出现时,我如何创建打印?@sergioBertolazo嗯,你可能不知道它是表的最后一行,在它太晚之前,尝试重新思考报告,例如使用groupFooter栏(页面上的组)并将图像放在其中,或者在pageFooter栏中使用负坐标。谢谢你的帮助,我可以使用资源“resetType=page”解决此问题