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. Image for the cookie policy date

.Net Core Report Drilldown and Drillthrough

Are there any examples of using drilldown and drillthrough in the .net core report viewer? I attempted to call a new report using the Action of a chart series by setting the URL in the action, but the viewer didn't respond at all to the click event.

3 Replies

VS Vinoth Srinivasan Syncfusion Team August 7, 2019 07:45 AM

Hi Paul, 

We have prepared a ASP.NET Core ReportViewer application for rendering the Drillthrough report and drilldown report. The sample can be downloaded from below location. 

Note: In ASP.NET Core platform when loading the local RDL report we need to pass the stream for ReportModel. But if we need to render drillthrough report or Subreport then we need to use the External server concept as shown in below code snippet. 

public partial class HomeController : Controller, IReportController 
    { 
        private IMemoryCache _cache; 
        private IHostingEnvironment _hostingEnvironment; 
 
        public HomeController(IMemoryCache memoryCache, IHostingEnvironment hostingEnvironment) 
        { 
            _cache = memoryCache; 
            _hostingEnvironment = hostingEnvironment; 
        } 
 
        [HttpPost] 
        public object PostReportAction([FromBody] Dictionary<string, object> jsonResult) 
        { 
            return ReportHelper.ProcessReport(jsonResult, this, this._cache); 
        } 
 
        [ActionName("GetResource")] 
        [AcceptVerbs("GET")] 
        public object GetResource(ReportResource resource) 
        { 
            return ReportHelper.GetResource(resource, this, _cache); 
        } 
 
        [HttpPost] 
        public object PostFormReportAction() 
        { 
            return ReportHelper.ProcessReport(null, this, this._cache); 
        } 
 
        public void OnInitReportOptions(ReportViewerOptions reportOption) 
        { 
            reportOption.ReportModel.ReportServerUrl = "http://<No server>"; 
            reportOption.ReportModel.ReportServerCredential = new System.Net.NetworkCredential("<no user>", "<no password>"); 
 
            Reportserver reportserver = new Reportserver(_hostingEnvironment); 
            reportOption.ReportModel.ReportingServer = reportserver; 
        } 
 
        public void OnReportLoaded(ReportViewerOptions reportOption) 
        { 
            
        } 
    } 
 
    public class Reportserver : ReportingServer 
    { 
        private IHostingEnvironment _hostingEnvironment; 
 
        public Reportserver(IHostingEnvironment hostingEnvironment) 
        { 
            _hostingEnvironment = hostingEnvironment; 
        } 
 
        public override Stream GetReport() 
        { 
            string basePath = _hostingEnvironment.WebRootPath + "/ReportData/"; 
            FileStream inputStream = new FileStream(basePath+this.ReportPath+".rdl", FileMode.Open, FileAccess.Read); 
            return inputStream; 
        } 
    } 

 
 
Regards, 
Vinoth S. 



PW Paul West September 3, 2019 09:31 AM

I have no problem creating a drillthrough on a tablix cell. The issue I'm having is with a drillthrough on a chart series. Clicking on the series does nothing. I used the same expression (with changed field name) that worked with tablix.

The Action is set to URL and the expression for the Action is set to:
="http://{HOSTPATH}Index/RunReport?rpt=CallHistory.rdl&gid=4d74597c-b03c-4742-9c82-d5b3b3056c21&param=TimeRange&data="&Fields!callTime.Value

This renders the drillthrough just as any other report call.


VS Vinoth Srinivasan Syncfusion Team September 4, 2019 07:05 AM

Hi Paul, 
 
We have recently fixed the drillthrough issue with chart series at our end and it will be included in our upcoming report platform release which is expected to be available on mid of September 2019. 
 
Regards, 
Vinoth S. 


Loader.
Live Chat Icon For mobile
Up arrow icon