Can anyone help me in implementing telerik reporting in ASP.NET MVC project?
It is accessible through the Telerik Menu --> Reporting for Visual Studio versions up to 2017. For Visual Studio 2019 through the Extensions Menu --> Telerik --> Reporting.
Telerik Reporting is royalty-free with a license price starting at $599 annually per developer. This . NET reporting tool is available for purchase with flexible pricing options, based on developers' support needs.
We are happy to announce that Telerik UI for Universal Windows Platform by Progress is now free and open-source. Yes, you read that correctly! Telerik UI for UWP is now open sourced under the Apache Software License (ASLv2) and is available for download for FREE.
The way I have reporting implemented is without a viewer, instead a user is presented with a "pdf" report, that can be downloaded.
Here is a scenario, user purchases a product online and at the end of the check out process a receipt is presented via a Telerik report.
Controller would make a call to the repository, and serve the byte stream back to the browser.
public virtual ActionResult DownloadReceiptReport(Order model)
{
byte[] contents = ShoppingCartRepository.GetReceiptReport(model);
return File(contents, "application/pdf", "Receipt.pdf");
}
In your repository create a function to generate the report, in this case the report isn't directly linked to a sqldatasource, the data source is being supplied an objectdatasource component:
public byte[] GetReceiptReport(Order order)
{
Telerik.Reporting.ObjectDataSource objectDataSource = new Telerik.Reporting.ObjectDataSource();
objectDataSource.DataSource new PurchaseReceiptReportModel()
{
CustomerName = order.CustomerName,
Total= order.Total,
PurchaseDate= DateTime.Now
};
PurchaseReceiptReport report = new PurchaseReceiptReport();
report.DataSource = objectDataSource;
ReportProcessor reportProcessor = new ReportProcessor();
RenderingResult result = reportProcessor.RenderReport("PDF", report, null);
return result.DocumentBytes;
}
In the end, user will receive a download pop-up window with a pdf report.
Hope this helps.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With