MRT events not executing

Stimulsoft Reports.NET discussion
Post Reply
jhonalkaiser
Posts: 3
Joined: Tue May 12, 2020 3:47 pm

MRT events not executing

Post by jhonalkaiser »

I created a report server in ASP.NET MVC Core 3.1 but apparently the Before Print event is not executing.
Do I need to do anything special in .NET code to execute events declared in MRT files?

Here's the report server in ASP.NET MVC Core 3.1:

Code: Select all

public class ReportRequest
{
	public string MRTfile { get; set; } = "";
	public Dictionary<string, string> Json { get; set; } = new Dictionary<string, string>();
}

Code: Select all

[HttpPost]
public IActionResult GeneratePDF(ReportRequest request)
{
	var path = StiNetCoreHelper.MapPath(this, "reports/" + request.MRTfile);
	var str = System.IO.File.ReadAllText(path);
	var report = StiReport.CreateNewReport();
	report.LoadFromString(str);
	foreach (KeyValuePair<string, string> json in request.Json)
	{
		var data = StiJsonToDataSetConverter.GetDataSet(json.Value);
		report.RegData(json.Key, data);
	}
	return StiNetCoreReportResponse.ResponseAsPdf(report);
}
Here's a simple event I set in MRT file just to test if it's working:

Image

When I preview the MRT in Desktop Designer it executes the event but when I generate the PDF report in my .NET ASP.NET server it doesn't.

Do I need to do anything special in .NET code to execute events declared in MRT files?
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: MRT events not executing

Post by HighAley »

Hello,

Unfortunately, the compilation is not supported in our report engine for .NET Core.
The events are not working because of this.

Thank you.
yuandong
Posts: 1
Joined: Sat Dec 12, 2020 11:20 am

Re: MRT events not executing

Post by yuandong »

Hello HighAley,

We're using events in the MRT template and not executing too. Are you working on fixing this problem?

Our server is .NET CORE 3.1 and NUGET package is Stimulsoft.Reports.Engine.NetCore 2020.5.2.

Thanks in advance!
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: MRT events not executing

Post by HighAley »

Hello,

We are working on the Compilation mode right now.
The events will work there.

The compilation will be available in one of our next builds. Maybe the next one.

Thank you
Post Reply