MRT events not executing

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

MRT events not executing

Post by jhonalkaiser » Tue May 12, 2020 4:58 pm

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: 8272
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: MRT events not executing

Post by HighAley » Tue May 12, 2020 9:25 pm

Hello,

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

Thank you.
Post Reply