在Jasper报告的XSL导出中拉伸单元格 [英] Stretching of cell in XSL export of Jasper reports

查看:163
本文介绍了在Jasper报告的XSL导出中拉伸单元格的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

对于XSL导出中单元格的垂直拉伸,我设置为此单元格参数Stretch with overflow,使用特殊的xsl属性< property name =net.sf.jasperreports.export.xls .auto.fit.rowvalue =true/> 并按框架元素覆盖单元格。主报告中的一切都很好。但子报告中存在问题。细胞没有伸展。我有这样的代码:

For the vertical stretching of cell in XSL export I set to this cell parameter "Stretch with overflow", use the special xsl property <property name="net.sf.jasperreports.export.xls.auto.fit.row" value="true"/> and cover cells by frame element. All is fine in the main report. But there is problem in the subreports. Cells are not stretching. I have such a code:

< detail>
< band height =16splitType =Stretch>
< property name =local_mesure_unitheightvalue =pixel/>
< property name =com.jaspersoft.studio.unit.heightvalue =px/>
< frame>
< reportElement positionType =Floatx =0y =0width =400height =15uuid =>
< property name =local_mesure_unityvalue =pixel/>
< property name =com.jaspersoft.studio.unit.yvalue =px/>
< property name =local_mesure_unitheightvalue =pixel/>
< property name =com.jaspersoft.studio.unit.heightvalue =px/>
< / reportElement>
< textField isStretchWithOverflow =true>
< reportElement style =subCellstretchType =RelativeToTallestObjectx =0y =0width =80height =15uuid =>
< property name =local_mesure_unitheightvalue =pixel/>
< property name =com.jaspersoft.studio.unit.heightvalue =px/>
< property name =net.sf.jasperreports.export.xls.auto.fit.rowvalue =true/>
< / reportElement>
< textFieldExpression><![CDATA [$ F {operator}!= null?$ F {operator}:]]>< / textFieldExpression>
< / textField>
< textField isStretchWithOverflow =true>
< reportElement style =subCellstretchType =RelativeToTallestObjectx =80y =0width =80height =15uuid =>
< property name =local_mesure_unitheightvalue =pixel/>
< property name =com.jaspersoft.studio.unit.heightvalue =px/>
< property name =net.sf.jasperreports.export.xls.auto.fit.rowvalue =true/>
< / reportElement>
< textFieldExpression><![CDATA [$ F {casino}!= null?$ F {casino}:]]>< / textFieldExpression>
< / textField>
< textField isStretchWithOverflow =true>
< reportElement style =subCellstretchType =RelativeToTallestObjectx =160y =0width =75height =15uuid =>
< property name =local_mesure_unitheightvalue =pixel/>
< property name =com.jaspersoft.studio.unit.heightvalue =px/>
< property name =net.sf.jasperreports.export.xls.auto.fit.rowvalue =true/>
< / reportElement>
< textFieldExpression><![CDATA [$ F {cabinet}!= null?$ F {cabinet}:]]>< / textFieldExpression>
< / textField>
< textField isStretchWithOverflow =true>
< reportElement style =subCellstretchType =RelativeToTallestObjectx =235y =0width =80height =15uuid =>
< property name =local_mesure_unitheightvalue =pixel/>
< property name =com.jaspersoft.studio.unit.heightvalue =px/>
< property name =net.sf.jasperreports.export.xls.auto.fit.rowvalue =true/>
< / reportElement>
< box topPadding =1bottomPadding =2/>
< textFieldExpression><![CDATA [$ F {serial}]]>< / textFieldExpression>
< / textField>
< textField isStretchWithOverflow =true>
< reportElement style =subCellstretchType =RelativeToTallestObjectx =315y =0width =60height =15uuid =>
< property name =local_mesure_unitheightvalue =pixel/>
< property name =com.jaspersoft.studio.unit.heightvalue =px/>
< property name =net.sf.jasperreports.export.xls.auto.fit.rowvalue =true/>
< / reportElement>
< textFieldExpression><![CDATA [$ F {soft}]]>< / textFieldExpression>
< / textField>
< textField isStretchWithOverflow =true>
< reportElement style =subCellstretchType =RelativeToTallestObjectx =375y =0width =25height =15uuid =>
< property name =local_mesure_unitheightvalue =pixel/>
< property name =com.jaspersoft.studio.unit.heightvalue =px/>
< property name =local_mesure_unitwidthvalue =pixel/>
< property name =com.jaspersoft.studio.unit.widthvalue =px/>
< property name =net.sf.jasperreports.export.xls.auto.fit.rowvalue =true/>
< / reportElement>
< textFieldExpression><![CDATA [$ F {isOnline} == true?是:否]]>< / textFieldExpression>
< / textField>
< / frame>
< / band>
< / detail>

推荐答案

我一直在处理这个问题很长时间和AFAIK这是一个XLS格式问题,无法完全解决。你可以尝试一些技巧,包括: http://community.jaspersoft.com/questions/844164/shrink-fit-property-when-exporting-excel

I have been dealing with this problem for a long time and AFAIK it is an XLS format issue and cannot be solved completely. There is a number of tricks you can try though, including these: http://community.jaspersoft.com/questions/844164/shrink-fit-property-when-exporting-excel

这篇关于在Jasper报告的XSL导出中拉伸单元格的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆