Core Report 1.0 Preview

CoreReport a new .NET Core 2 report generator.
Report designer and viewer for the WEB with .Net Core, EF and Razor Engine.
Design model online and preview to embedded pdf.
Export to Excel.
Barcodes CODE128, CODE128A, CODE128B, CODE128C, CODE39, CODE39Extended, EAN13, EAN8, ISBN, PHARMACODE, UPCA, UPCE.

See it in action!
Find it on NuGet
Download sample solution
Download MSSQL Northwind DB
northwind-pg (PGSQL Northwind DB)
License
Contact me

How to use it ?
In startup.cs:

 
        public void ConfigureServices(IServiceCollection services)
        {
            services.AddMvc();
            var connectionString = "Server=localhost\\SQLEXPRESS;database=Northwind;Trusted_Connection=true";
            services.AddEntityFrameworkSqlServer().AddDbContext<Data.NorthwindContext>(opt => opt.UseSqlServer(connectionString));
            var reportsPath = Directory.GetCurrentDirectory() + "/reports";
            services.AddCoreReport(reportsPath);//add this
        }
        public void Configure(IApplicationBuilder app, IHostingEnvironment env)
        {
            if (env.IsDevelopment())
            {
                app.UseBrowserLink();
                app.UseDeveloperExceptionPage();
            }
            else
            {
                app.UseExceptionHandler("/Error");
            }

            app.UseStaticFiles();
            app.UseCoreReport();//add this

            app.UseMvc();
        }

In yourpage.cshtml:

@page "{mode?}"
@model MasterDetailModel
@{
    ViewData["Title"] = "Master Detail page";
    Layout = null;
}
@using CoreReport.Report

@Html.CoreReport(Model.ReportBuilder, Model.ReportMode)

In yourpage.cs:


 public class MasterDetailModel : PageModel
    {
        NorthwindContext _db;
        CoreReportSpooler _reportSpooler;
        public MasterDetailModel(NorthwindContext db, CoreReportSpooler spooler)
        {
            _db = db;
            _reportSpooler = spooler;
        }
        [BindProperty]
        public ReportBuilder ReportBuilder { get; set; }
        [BindProperty]
        public CoreReportMode ReportMode { get; set; }

        public void OnGet(string mode)
        {
            ReportMode = CoreReportMode.viewer;
            if (mode.ToLower() == "designer")
               ReportMode = CoreReportMode.designer;

            CoreReportExport exportExcel = null;

            if (mode.ToLower() == "excel")
                exportExcel = new ReportExportExcel();

            ReportBuilder = new ReportBuilder(_reportSpooler, _db)
            {
                FileName = "MasterDetailReport",
                CoreReportExport = exportExcel
            };

            var customers = from cust in _db.Customers
                            .Include("Orders")
                            .Include("Orders.OrderDetails")
                            .Include("Orders.OrderDetails.Product")
                         orderby cust.Country
                         where cust.Country == "Italy" && cust.Companyname == "Reggiani Caseifici"
                         select cust;
            ReportBuilder.DataSources.AddQuery(customers.ToList());
            Page();
        }
    }