And it worked really well.
But I have a .NET Core API and a SPA application in Angular that work separately, where the back end team works in the visual studio with the API and the front end team works in the visual code with the SPA.
So, we put this code below in our controller:
Code: Select all
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Stimulsoft.Report;
using Stimulsoft.Report.Angular;
using Stimulsoft.Report.Web;
using System;
namespace Digibyte.API.Controllers.Relatorio
{
[Route("v1/reports")]
[ApiController]
[Authorize]
public class RelatorioStimulsoftController : Controller
{
public RelatorioStimulsoftController()
{
Stimulsoft.Base.StiLicense.Key =
"stimulsoft key";
}
[HttpPost("open-report")]
public IActionResult OpenReport()
{
var requestParams = StiAngularViewer.GetRequestParams(this);
var options = new StiAngularViewerOptions();
options.Actions.GetReport = "GetReport";
options.Actions.ViewerEvent = "ViewerEvent";
options.Appearance.ScrollbarsMode = true;
options.Appearance.FullScreenMode = true;
options.Toolbar.DisplayMode = StiToolbarDisplayMode.Separated;
options.Localization = StiAngularHelper.MapPath(this, "Localization/pt-BR.xml");
return StiAngularViewer.ViewerDataResult(requestParams, options);
}
[HttpPost("GetReport")]
public IActionResult GetReport()
{
var report = StiReport.CreateNewReport();
var path = StiAngularHelper.MapPath(this, "Reports/Report.mrt");
report.Load(path);
report.Dictionary.Databases.Clear();
var obj = GetBusinessObject();
report.RegBusinessObject("data", obj);
return StiAngularViewer.GetReportResult(this, report);
}
[HttpPost("ViewerEvent")]
public IActionResult ViewerEvent()
{
return StiAngularViewer.ViewerEventResult(this);
}
}
}
But the page opens blank like this:
After the request to the GetReport () method, nothing else comes, and I needed to make a request in the ViewerEvent () method, but it is done after about 1 minute and a half to 2 minutes, and even then, the screen remains blank:
Can anyone tell me what may be happening?