We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

ReportViewer issue

Thread ID:

Created:

Updated:

Platform:

Replies:

144353 May 2,2019 08:32 AM UTC May 8,2019 07:38 AM UTC ASP.NET Core 9
loading
Tags: ReportViewer
Atiar Rahman
Asked On May 2, 2019 08:32 AM UTC

I'm beginner in here. I want to show my rdl report from wwwroot/reports repository using report viewer. Please help me how should I do now?

Mahendran Shanmugam [Syncfusion]
Replied On May 3, 2019 06:08 AM UTC

Hi Atiar, 
 
Thanks for your interest in our Syncfusion product. 
 
We can able to run the local RDL report from wwwroot folder in ASP.NET Core Report Viewer sample. Please find the below steps for how to create a ASP.NET Cor Report Viewer sample  
  
Index.cshtml:  
@page  
@model IndexModel  
@{  
    @ViewData["heading"];  
}  
  
<style>  
    bodyhtml#reportviewer {  
        overflowhidden !important;  
        height100%;  
        width100%;  
    }  
</style>  
  
<ej-report-viewer id="reportviewer1" report-service-url="../ReportApi" processing-mode="Remote" />  
<ej-script-manager></ej-script-manager>  
  
  
Index.cshtml.cs  
using Microsoft.AspNetCore.Mvc.RazorPages;  
  
namespace ReportViewerCore.Pages  
{  
    public class IndexModel : PageModel  
    {  
  
        public void OnGet()  
        {  
            ViewData["heading"] = "ReportViewer Sample";  
        }  
    }  
}  
  
  
ReportApiController.cs:  
ReportViewer needs WebApi controller for rendering the report as shown in below code snippet.  
  
using System;  
using System.Collections.Generic;  
using Microsoft.AspNetCore.Mvc;  
using Syncfusion.EJ.ReportViewer;  
using Microsoft.Extensions.Caching.Memory;  
using Microsoft.AspNetCore.Hosting;  
using System.IO;  
  
namespace ReportViewerCore.API  
{  
    public partial class ReportApiController : Controller, IReportController  
    {  
        private IMemoryCache _cache;  
        private IHostingEnvironment _hostingEnvironment;  
  
        public ReportApiController(IMemoryCache memoryCache, IHostingEnvironment hostingEnvironment)  
        {  
            _cache = memoryCache;  
            _hostingEnvironment = hostingEnvironment;  
        }  
  
        [HttpPost]  
        public object PostReportAction([FromBody] Dictionary<stringobject> jsonResult)  
        {  
            return ReportHelper.ProcessReport(jsonResult, thisthis._cache);  
        }  
  
        [ActionName("GetResource")]  
        [AcceptVerbs("GET")]  
        public object GetResource(ReportResource resource)  
        {  
            return ReportHelper.GetResource(resource, this, _cache);  
        }  
  
        [HttpPost]  
        public object PostFormReportAction()  
        {  
            return ReportHelper.ProcessReport(nullthisthis._cache);  
        }  
  
        public void OnInitReportOptions(ReportViewerOptions reportOption)  
        {  
            string basePath = _hostingEnvironment.WebRootPath;  
            FileStream reportStream = new FileStream(basePath + @"\ReportRDL\GroupingAgg.rdl", FileMode.Open, FileAccess.Read);  
            reportOption.ReportModel.Stream = reportStream;  
  
        }  
  
        public void OnReportLoaded(ReportViewerOptions reportOption)  
        {  
  
        }  
    }  
}  
  
  
We have prepared the sample with Razor page in ASP.NET Core and it can be downloaded from below location.  
  
Regards, 
Mahendran S. 


Atiar Rahman
Replied On May 3, 2019 09:04 AM UTC

Thanks a lot but, How can I bind data from services (in report)? I'm using controller.

Mahendran Shanmugam [Syncfusion]
Replied On May 3, 2019 10:55 AM UTC

Hi Atiar, 

We can able to pass the datasource values from code behind for RDL report when setting the processing mode as local. We have prepared the simple ASP.NET Core Report Viewer sample to load the report from passing the datasource in code behind and it can be downloaded from below location. 
 
Please find the below help documentation for passing the datasource value from code behind. 
 
Regards, 
Mahendran S. 


Atiar Rahman
Replied On May 4, 2019 05:45 AM UTC

Thanks a lot. But now i got stuck in creating RDLC file that you have created and run. When I tried to create RDLC file in syncfusion report designer and tried to save, it shows only RDL file type, no RDLC type. 
How can I design RDLC report in Syncfusion Report Designer?

Mahendran Shanmugam [Syncfusion]
Replied On May 6, 2019 08:42 AM UTC

Hi Atiar, 
 
We can able to create and edit the RDLC report in report designer. We have prepared the simple sample for your reference. 

Please find the below help documentation for your reference to create a RDLC report in report designer. 
 
Please find the below kb documentation for how to pass the Business object for RDLC report in report designer. 

Regards, 
Mahendran S. 


Atiar Rahman
Replied On May 6, 2019 09:20 AM UTC

Thank you. I need to bind data from json or another service (not from Database) in RDLC report. What should I do?

Mahendran Shanmugam [Syncfusion]
Replied On May 6, 2019 12:01 PM UTC

Hi Atiar, 

Please find the below kb documentation for how to pass the data for RDLC from code behind in report designer.  

Regards, 
Mahendran S. 


Atiar Rahman
Replied On May 8, 2019 07:24 AM UTC

I have downloaded Syncfusion Essential Studio (ASP.Net Core) for Reporting. It mentioned that Server side deployment licenses are included. When I make a report on run on browser it works fine (doesn't show any message of trial version) but, when I deploy into Linux server it show that the report is build with trial version of Syncfusion. What should I do?

Vinoth Srinivasan [Syncfusion]
Replied On May 8, 2019 07:38 AM UTC

Hi Atiar, 

If you are using the licensed build with development environment, then we will not show the licensing message. It looks like deployment environment uses the assembly from nuget.org. Please refer the below article to avoid the licensing messages in deployment. 

Regards, 
Vinoth S. 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon