在帖子上生成涂鸦报告

发布于 2025-01-02 19:59:32 字数 336 浏览 0 评论 0原文

最近我一直在使用 doodle reporting 来生成 Excel 和 pdf 报告。我使用按钮链接来执行此操作,因为报告不是动态的。

但现在我有一个要求,参数是动态的,我有一个参数表单,用户将填写这些表单并点击提交。该表单将提交给另一个操作,该操作应生成 pdf 报告。

当我尝试此代码时:

return new ReportResult(report, new PdfReportWriter());

它只是在页面中生成报告,但我无法下载。知道怎么做吗?

我已经包含了所有必需的 dll,并且可以在使用 actionLink 时生成。

Lately I've been using doodle reporting to generate excel and pdf reports. I was doing that with a button link because the report is not dynamic.

But now I have a requirement where the parameters are dynamic, where I have a form of parameters and the users will fill these form and hit submit. The form will submit to another action and that action should generate a pdf report.

When I tried this code:

return new ReportResult(report, new PdfReportWriter());

It just generate the report in the page and I'm unable to download. Any idea how?

I've already included all the required dlls and I'm able to generate when I'm using an actionLink.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

最丧也最甜 2025-01-09 19:59:32

要解决该问题,请指定内容类型和文件名:

return new ReportResult(report, new ExcelReportWriter(), "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet") { FileName = "Report.xls" }; 

To solve the problem specify the content type and filename:

return new ReportResult(report, new ExcelReportWriter(), "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet") { FileName = "Report.xls" }; 
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文