如何将数据库中的多张图片添加到报告“详细信息”中?
我正在 iReport 中构建报告,以便可以从数据库数据生成 PDF。除了我的“描述”字段之外,我还有多个图像,我想将它们显示在详细信息带中。图片的数量取决于我为其生成 PDF 的确切报告。显示这些图像的最佳方法是什么?我希望它们一个一个地显示在另一个下面,并带有适当的标题。文件名/位置与标题一起存储在“图片”表中。我想我需要一个子报告?
I'm building a report in iReport so I can generate PDFs from my db data. Along with my "description" field I have multiple images which I'd like to display in the detail band. The amount of pictures depends on the exact report I'm generating the PDF for. What is the best approach for display these images? I'd like them displayed one under the other with their appropriate captions. The filename/locations are store in a "pictures" table along with the captions. I assume I need a subreport?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使用imageExpression属性来管理要显示的WHAT图片。例如:
借助 printWhenExpression 属性,您可以管理需要显示图像的时间。例如:
是的,您不能在一份报告中使用多个查询(数据源)。是的,您需要一个子报告。
您可以将子报表中的数据返回到主数据。您可以在 $IREPORT_HOME$\ireport\samples\Subreports 文件夹中查看示例报告并阅读此案例。
更新:
我刚刚发现有用的文章 使用动态图像创建 jasper 报告。也许它对你有帮助。
You can use imageExpression property to managing WHAT picture to display. For example:
With help of printWhenExpression property you can manage WHEN you need to show image. For example:
Yes, you cannot use several queries (datasources) in one report. And yes, you need a subreport.
You can return data from subreport to master data. You can view sample report at $IREPORT_HOME$\ireport\samples\Subreports folder and read this case.
UPDATED:
I've just found useful as I think article Creating jasper reports with dynamic images. May be it helps you.