Jsp 如何使用displaytag格式化导出到pdf/rtf的数据?
如何使用显示标记格式化导出到PDF/RTF的数据 我的displaytag.propertiesJsp 如何使用displaytag格式化导出到pdf/rtf的数据?,jsp,export,displaytag,Jsp,Export,Displaytag,如何使用显示标记格式化导出到PDF/RTF的数据 我的displaytag.properties export.types=csv excel xml pdf rtf export.excel=true export.csv=true export.xml=true export.pdf=true export.rtf=true export.rtf.class=org.displaytag.export.DefaultRtfExportView export.pdf.class=org.dis
export.types=csv excel xml pdf rtf
export.excel=true
export.csv=true
export.xml=true
export.pdf=true
export.rtf=true
export.rtf.class=org.displaytag.export.DefaultRtfExportView
export.pdf.class=org.displaytag.export.DefaultPdfExportView
我在显示标签中使用了标题和页脚
为了在不同的行上显示一些颜色,我配置了一个html装饰器。这个decorator扩展了TableDecorator,HTML视图正按照我的预期工作
像这个html,我如何为PDF创建一个装饰器
对于这个类,我想扩展哪个类,需要编写哪些方法
我只想根据特定行中的数据为行添加一些颜色
有人有什么想法吗?最好写一个decorator并添加为
<display:setProperty name="decorator.media.pdf" value="org.displaytag.sample.decorators.ItextTotalWrapper" /
注意:您可以在上面的类中更改字体。你可以在这门课上使用颜色
在资源文件夹中创建displaytag.properties文件并添加以下值
export.pdf.class=decorators.myPdfExportView
我希望这个例子对你有用。但通过使用ApacheFop,甚至还有其他方法可以做到这一点。通过这种方式,您需要为pdf指定样式表。但我认为它更复杂
如果你想去的话
export.pdf.class=decorators.myPdfExportView