8
Hello, I would like to know some options of reports with Asp.Net MVC.
I tried to use Reportviewer but it gets typed with the bank and not to use with objects.
Would anyone have any suggestions?
Thank you.
8
Hello, I would like to know some options of reports with Asp.Net MVC.
I tried to use Reportviewer but it gets typed with the bank and not to use with objects.
Would anyone have any suggestions?
Thank you.
9
Yes. Some.
4
A library I use is selectpdf, which makes it possible to generate pdf reports from html documents with css styling, making it much easier to format the generated report.
It has extensive documentation that can be found on its own http://selectpdf.com/pdf-library-for-net/, and also you can use it with its free version or its commercial version, the free version instead with some limitations, but itself can do a lot with it.
Example:
// create a new pdf document
PdfDocument doc = new PdfDocument();
// add a new page to the document
PdfPage page = doc.AddPage();
// create a new pdf font
PdfFont font = doc.AddFont(PdfStandardFont.Helvetica);
font.Size = 20;
// create a new text element and add it to the page
PdfTextElement text = new PdfTextElement(50, 50, "Hello world!", font);
page.Add(text);
// save pdf document
doc.Save(Response, false, "Sample.pdf");
// close pdf document
doc.Close();
Using it, a problem you may have and when rendering html page with some model, and to solve this problem you can use the Razorengine library.
Example:
string template = "Hello @Model.Name! Welcome to Razor!";
string result = Razor.Parse(template, new { Name = "World" });
Price salty eim...even more with the dollar on the rise
Yes, it really is a little expensive, but in itself taking its limitations using its free version, give to do a lot of things with it.
4
I like iTextShap. It’s free and easy to use. I have an example code with mvc on github. Source code for the example: https://github.com/rogermedeirosdasilva/Exemplos/blob/master/VSBS_ReportPDF/Report_PDF.zip
Videos explaining the use and class creation for reuse. https://youtu.be/owQ8Xj6gGvg
2
Thank you all for the good suggestions I received, but I ended up choosing to generate the reports in HTML and I am using Mvcrazortopdf to generate the pdfs.
Project link on Github: https://github.com/andyhutch77/MvcRazorToPdf
Browser other questions tagged c# .net report
You are not signed in. Login or sign up in order to post.
I didn’t know the Rotary, the same is already Favorite.
– Tobias Mesquita