I am trying to using Angular report with ApiController OWIN server.
below is my ApiController code, the only difference between sample code and mine is the controller inherits from ApiController, not Controller
Code: Select all
public class BalanceSheetViewerController : ApiController
{
private readonly IBalanceSheetLogic logic;
private readonly ICompInfoLogic compInfoLogic;
public BalanceSheetViewerController(
IBalanceSheetLogic logic,
ICompInfoLogic compInfoLogic
)
{
this.logic = logic;
this.compInfoLogic = compInfoLogic;
}
[System.Web.Http.HttpPost]
[AllowCrossSiteJson]
public ActionResult InitViewer()
{
var requestParams = StiAngularViewer.GetRequestParams();
var options = new StiAngularViewerOptions();
options.Actions.GetReport = "GetReport";
options.Actions.ViewerEvent = "ViewerEvent";
options.Appearance.ScrollbarsMode = true;
return StiAngularViewer.ViewerDataResult(requestParams, options);
}
......
everything looks good until running it. when the client angular runs receive the error from
the error isreturn StiAngularViewer.ViewerDataResult(requestParams, options)
and below is the call stacksObject reference not set to an instance of an object.
Code: Select all
at Stimulsoft.Report.Web.StiCacheHelper.GetObject(String guid)
at Stimulsoft.Report.Web.StiCacheHelper.GetResource(String guid)
at Stimulsoft.Report.Web.StiViewerResourcesHelper.GetStyles(StiRequestParams requestParams)
at Stimulsoft.Report.Angular.StiAngularViewer.ViewerDataResult(StiRequestParams requestParams, StiAngularViewerOptions options)
at Beyond.API.Controllers.BalanceSheetViewerController.InitViewer() in BalanceSheetViewerController.cs:line 42
at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.<>c__DisplayClass6_2.<GetExecutor>b__2(Object instance, Object[] methodParameters)
at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ExecuteAsync(HttpControllerContext controllerContext, IDictionary`2 arguments, CancellationToken cancellationToken)
Thanks!