如何从jsp页面获取两个日期之间的数据并生成PDF或Excel报告
我现在正在开发java项目,直到我完成从数据库获取数据并将其显示在jsp页面中的数据网格表中,然后将数据转换为PDF或Excel报告也完成了。但现在我的问题是,如果要获取数据历史记录,我必须引用两个日期之间的日期和日期,我必须以 PDF 或 Excel 形式显示数据,现在我在该过程中遇到了麻烦,请任何人告诉我该怎么做。
预先感谢......!
I am now working on java project till i had completed to get data from database and display it in table as datagrid in jsp page then that data to be converted to PDF or Excel report also done. But now my Problem is if to take history of data i have to refer date from and to date between two date i have to display data in PDF or Excel now i had strucked in that process please can anyone tell me how to do that.
with advance thanks.......!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
假设您知道如何从数据库获取数据(两个日期之间),并且您唯一的问题是将其输出到 pdf/excel。我实现它的最简单、最快的方法是输出为 CSV 格式 - 设置响应标头,如下所示:
assuming you know how to get the data from your DB (between the two dates) and your only problem is to output it to pdf/excel. The easiest and fastest way I would implement it is by output to CSV format - set the response header like this: