DEV Community

Cover image for Open Source Reporting Solution (FastReport) - Simple Demo with .NET Core
Zoltan Halasz
Zoltan Halasz

Posted on

Open Source Reporting Solution (FastReport) - Simple Demo with .NET Core

I have been looking for a solution for reporting, which is free/open source, and only the last week I found something worth mentioning. Being from the corporate accounting world, my tools are directed towards accountants and business users, which rely heavily on such reports, and I would like to see an open source/free reporting tool to serve this purpose.

I know, there are other solutions such as Telerik and Syncfusion, but they seem to be expensive for my level.

In fact, all I need is a tool for my web applications - to be able to integrate in asp.net core, then generate a report according to template, and then export in pdf/excel.

Alt Text

The solution I am dealing here with comes from FastReport, which just has published its OpenSource version:
https://fastreports.github.io/FastReport.Documentation/
https://github.com/FastReports/FastReport

I have prepared a small tutorial which takes a list of employees and publishes a report with them.

Prerequisites:
A. Basic .Net Core MVC
B. Nuget Package - FastReport.OpenSource.Web (take latest one for 2019)
C. There is an frx file, which is an XML document describing the report itself. I manually edited the sample report, to fit my sample data. It is saved in my wwwroot folder, simple list.frx.
D. Main difference to their tutorial is that I take data from my list, not the XML database of Northwind. Clone their git repo, and see how it runs for their
data: the Web.MVC folder contains the relevant .net core MVC example: https://github.com/FastReports/FastReport/tree/master/Demos/OpenSource
E. There is a report editor/designer, Fast Report Designer Demo for trial purposes. Download it.
Also, download the https://www.fast-report.com/en/product/fast-report-viewer/, it's a free tool.

Application is live under: https://fastreport.zoltanhalasz.net/

Steps to understand the tutorial:

  1. Clone my github repo https://github.com/zoltanhalasz/FastReport.Tutorial
  2. Check the logic in the controller and also the service I use to populate the report (it differs from their example - I take a list as an input, not an XML file as opposed to their example). The template of the report is an xml file, with frx extension, saved in wwwroot folder. I edited manually one of their simple examples to fit my requirements for the tutorial.
  3. Check the View (from Views/Home/Index), how it takes the report and publishes it via Razor.
  4. Run the application, result should be as below: Alt Text
  5. Save the report, in .fpx format. Then with the downloaded viewer (at point E above), you can open the populated report and then save in excel, pdf, word etc. The result should be: Alt Text

I hope I can study this further and apply in one of my future projects!

Let me know your thoughts about this topic, how you would apply open source reporting to .net core.

Top comments (15)

Collapse
 
immersivegamer profile image
Henry Nitz

What I have been exploring is Jasper Reports with their Report Server. It exposes REST JSON APIs that I can then call from other applications. The resulting report can then be streamed via the HTTP response. I have found it perfect for my needs and will probably be expanding on its use in my applications in the future. A bonus is that you can get a report's parameters from an API and so could generate dynamic inputs in whatever program is consuming it. I definitely suggest Jasper Reports to anyone looking for an alternative to something like Crystal Reports.

Collapse
 
zoltanhalasz profile image
Zoltan Halasz

Thanks. But can they be integrated in an asp web app? Or server is a must? Do you have a working example?

Collapse
 
taalkathiri profile image
Tarik Alkathiri

Dear Mr.Halasz
Thank you very much for this article, i was looking for a free/opensource reporting tools for Core 3,for along time until i came across your great article.
But when i try to print the report the Print From Browser icon dos not print.
Is there a way to print the report or it is disabled in the open source.
BTW. i am using Blazor Server with core 3.0.
Your help will be very much appreciated.

Collapse
 
zoltanhalasz profile image
Zoltan Halasz

Hi,

please check the sample app running, fastreport.zoltanhalasz.net/, print from browser. It seems to work fine here.
second option, try to use my code, and see if it works locally, it is using .net core 2.2 or below. github.com/zoltanhalasz/FastReport...
third option, save the prepared report in fpx format, and then install the Fastreport viewer fast-report.com/en/product/fast-re..., which can open it and save in pdf/xls, or print it.
Honestly I did not try with .net core 3.0 or above... no Idea why it doesn't work.

Collapse
 
taalkathiri profile image
Tarik Alkathiri

First Of all thank you very much for your quick response.
sorry it was my mistake because im trying to press the icon it self i should click on the word says Print From Browser.
Please if you came across any thing that help with using fast report with Blazor.
Please kindly notify me on the following email: T.Alkathiri@Gmail.com.
I will much appreciate your help

Collapse
 
jaygeek profile image
jaygeek ☕

UPDATE: Just learned they are on on holiday until January 11th!
That explains why I cannot get replies to my tickets or phone calls at all. I've build a .NET Core 3.1 solution. (Your example, though good, generates an embedded PDF (iframe) which prints with a dialog.) We can find no way in Core to print (without the print dialog, directly... as within my .NET Core console app which we will run as a Windows Service.)

Also, these objects seem to be completely undefined in Core, even though we've purchased their Enterprise product:
myReport.Report.PrintPrepared(settings);
myReport.Report.Print();

Please help any way you can!

Thread Thread
 
zoltanhalasz profile image
Zoltan Halasz

I really don't know the answer to your question. Try exporting the fpx file, and print it with the report viewer application, maybe this solves your question. But I didn't study this deeper to be able to help you.

Collapse
 
itzryan profile image
Ryan

Hello. Nice article. I have a couple of questions though...

1.)Im not sure if this is free? I think the demo can only print 5 pages and there's a watermark indicating that its a demo version.
2.)How did you design the report? Do they have a designer? I went to their website and saw they have an online designer. Is there an offline designer that is integrated with Visual studio?

Thanks

Collapse
 
zoltanhalasz profile image
Zoltan Halasz

I designed the fpx file starting from one of their demo files and then editing the xml file in VS Code.
The viewer is free, so you can export any report from your app in fpx format and print it from the viewer, or export to excel, pdf, word fast-report.com/en/product/fast-re...

Collapse
 
itzryan profile image
Ryan

I see. So you edited the xml from visual studio. So if you wanted to use the designer to create a report, then you need to buy? Or you can use the designer for free?
I'm quite sure that the demo trial can only print 5 pages max though it was mentioned on their website.

Thread Thread
 
zoltanhalasz profile image
Zoltan Halasz

Try their demo for designer.
fast-report.com/en/product/fast-re...

as for printing, I tried to print to pdf from the app, and it printed all pages, except that sometimes it inserts empty pages.

using the report viewer (free), opening the fpx file will print only 5 pages.

Please do also your own research and contact them.

Collapse
 
sachinmakhre profile image
sachin

How To Run Fast Report on Asp.net MVC5 Full Framework 4.5.2
unable to install package FastReport.OpenSource.Web 2020.3.14 in vs2017

please help , can fastreport run on Asp.net MVC5 Full Framework 4.5.2
you may reply me on sachinmakhre@gmail.com

Collapse
 
nikitiwari profile image
nikhilesh

Hello Noltan,

I would request you to please review have a look at Open Source BI product Helical Insight.

It comes with an absolutely free version as well as a paid version.

It comes with a drag drop interface to create reports, dashboards and data visualization.

There is also a module allowing for pixel perfects multi pager document kind of reporting as well with options like grouping, alignment, report header, page header, report footer, page footer, summary, repeat by, page setup and many more allowing you to create reports like invoice salary slips bank statements tickets etc.

There are many other options which includes embedding, exporting in various formats, email scheduling, user role management, support of SSO (like CAS, LDAP, active directory, Oauth etc). Entire application can be white labelled. There are more than 30+ charting options and it is also possible to extend and integrate any sort of javascript charts like D3, C3, chartsjs etc. By default there are also a lot of advanced statistical and scientific charting options allowing users to fulfill their analytical data viz need as well as visualize huge amount of data.

For performance enhancement there is support of pagination, caching, as well as load balancing. Options to use inmemory mode as well.

There is support for mapping also with integration of openmaps and extendable to Google Maps also.

There is a workflow module which can allow you to create your own custom workflow and automation as well.

There is a support of various kind of databases, flat files, big data db, graph databases. Every functionality of Helical Insight is supported by API. Please do give it a try.

Collapse
 
cyberance profile image
Cyberance

Is it possible to create report with image in the background? This is needed for complicated forms.

Collapse
 
zoltanhalasz profile image
Zoltan Halasz

I am not sure. Please check their showcase fast-report.com:2018/6