ASP.NET MVC Reports wit PDF and EXCEL - asp.net-mvc

I Would like to get references on best way to generate reports in an MVC application that allows me to export the results to PDF and EXCEL.
I am currently creating a VIEW, filling a MODEL with data, and exporting view to PDF, using ROTATIVA.
But I have doubts if this is the best way to develop reports in MVC structure.
I checked the options in this post:
https://pt.stackoverflow.com/questions/94696/relat%C3%B3rios-com-asp-net-mvc
But neither of them works with Excel.
I also found out that I can still use RDLC in MVC at this link: http://www.dotnetawesome.com/2013/09/microsoft-report-in-mvc-4.html
But I can not add RDLC files in my project. I have the Report templates in my visual studio.
I have already installed ReportViewerForMVC in my project, but I'm still without the RDLC templates.
Any suggestions?
Thanks

Related

RDLC Sub Report in ASP.NET MVC using Views

I'm facing problem in generating RDLC Sub Report using ASP.NET MVC 5 Visual Studio 2019 using LINQ query.
I have two tables PartyType and Customer which is shown in Image given below. I want to show PartTypeName in Main Report and then according to that party Customer data will Show In SubReport RDLC.
This Type of Output I want.
I think what you're looking for is creating a master/detail report. There are tons of articles and videos online. Just do an online search for SSRS master detail example.

Generate a View/Page from a model in Blazor with Visual Studio

I am very new to Blazor and i am wondering if there is a way to generate a View from a Model and his Controller like with Razor to develop faster. In Visual Studio it is possible by right clicking on View Folder and choosing the Controller that we want.
Imagine having a User Model with data like Name, Adress etc. In Razor it is possible to generate a View (HTML, JS) containing those attributes related to User by choosing the model that we want (Edit, Create, Delete, etc).Then a complete form will show up with a generated HTML and JS in Pages Folder.
After a whole night of searching I found that this option given by Visual Studio is related with Scafolding and it is only avalaible for Blazor Server Side and Blazor Hosted applications. More information in the Syncfusion documentation

How to Export HTML to PDF Using Telerik with ASP.NET MVC

I have an existing ASP.NET MVC application where emails are sent to users with HTML content (Multiple tables) in the body.
Now I have to export and download same data as a PDF file in the browser. Since I have the HTML content already generated, my plan is to convert this HTML to PDF by using Telerik (Since i have license) in my MVC controller.
If HTML to PDF conversion is not possible, please let me know how can i create a PDF with multiple tables using Telerik DLLs as I've never used Telerik controls.
Any help is highly appreciated.
Thanks in advance.
If the data you send is in a Telerik grid you can simple try to do this:
http://demos.telerik.com/kendo-ui/grid/pdf-export
On the otherhand you can also try to use aspose: https://www.aspose.com/products/pdf/net
I fixed it by generating a PDF from scratch using telerik controls.

Using Crystal Report in MVC(ASP.net) application...(Not using *.aspx file)

Any good idea to use crystal report with MVC(ASP.net) application as a normal view like *.cshtml ,instead of *.aspx page.
Ok...Thanks Raphael...So final solution is,
In MVC3 directly cannot use ReportViewer Control from *.chtml page.Can use report in two ways
Create an pdf file on fly from your control class Or
Create a aspx page from where you can show your report using report viewer.
Sample application with crystal report and MVC3 ,can check this.
http://code.msdn.microsoft.com/Using-Crystal-Report-in-bb0e6229
It isn't possible to directly use reportviewer inside razor pages. Here you have a link that gives you 2 workaround
Using Reportviewer Control, within a Razor view, in the MVC3 Framework

Report Wizard in an MVC Application

After some research, I understand that we can use sql server reporting in an mvc application as long as the view engine is web form instead of razor.
The tutorial I have been trying to follow is:
Creating an ASP.net reporting using Visual Studio 2010
The problem is in Part 2. I cannot find the local classes listed as Data Source. The only choice is to set up a new xsd file to connect to the database. How can I have my reports to use my data repositories as their data source?
The credit goes to TNCodeMonkey!
Not only the project has to be compiled first, we must have an index.aspx file in the root folder of the MVC Web Application.
I don't know why. But the Data source is populated with all my dll's once that magic file is in place.

Resources