如何在Asp.net MVC中的PDF文档中生成大约5000条账单格式记录 [英] How do I generate approximately 5000 records of Bill Format in PDF document in Asp.net MVC

查看:71
本文介绍了如何在Asp.net MVC中的PDF文档中生成大约5000条账单格式记录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好先生,



我正在开发一个Asp.net MVC4应用程序,我需要生成个人用户账单的PDF文档。我从数据库中获取数据,在我的操作结果中,我从模型中获取数据,并希望以PDF格式生成视图,并且还想设计布局。

1.所以我只是想要从列表中的模型(数据库)生成我的PDF视图数据吗?

2.生成包含大量记录的PDF有什么问题吗?

3。如何设计账单格式,我可以使用DIV和CSS完成任务吗?



请帮帮我



感谢和问候

Amardeep Singh

Hello Sir,

I am working on a Asp.net MVC4 application in which I am required to generate the PDF document of the individual users bill. I am fetching the data from the database and in my Action Result I am getting the data from the model and want to generate the view as PDF and also want to design the layout.
1. So Simply I want to generate my view data in PDF coming from model(Database) in a list?
2. Is there any problem in generating the PDF containing huge records?
3. How do I design my bill format, can I use DIV and CSS to accomplish the task?

Please help me

Thanks & Regards
Amardeep Singh

推荐答案

从MVC返回文件与返回视图不同。您最好的选择通常是将其作为FileContentResult()或File()返回,并让用户决定如何处理它。如果关闭或未安装PDF扩展,这也会迁移他们可能在浏览器中查看的任何问题。



1.数据库不是您的模型,你表模式是。获取相关(对该客户)的信息并将其传递给您用于解析为PDF的任何信息。



2.如果您的个人客户下载他们的个人记录如果你有几个同时这样做,你会看到减速。我无法猜测性能命中,你需要加载测试来确定。否则,它是一个标准查询,其输出只是重定向到PDF解析器而不是视图。



3.这完全取决于您选择的PDF解析机制(或写)。
Returning a file from MVC is not the same as returning a view. Your best bet is often to return it as a FileContentResult() or File() and let the user decide what to do with it. This also migrates any issues they might have viewing it in the browser, in case PDF extensions are turned off or not installed.

1. The Database is not your model, you table schema is. Get the relevant (to that customer) information and pass it to whatever you're using to parse into PDF.

2. If your having individual customers downloading their individual records, you will see slowdown if you have several doing so at the same time. I can't guess at the performance hit, you'll need to load test to determine that. Otherwise, it's a standard query where output is simply redirected to a PDF parser rather than a view.

3. This is wholly contingent on the PDF parsing mechanism that you choose (or write).


这篇关于如何在Asp.net MVC中的PDF文档中生成大约5000条账单格式记录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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