Page 1 of 1

Stimulsoft report viewer error

Posted: Sun Dec 23, 2018 4:12 pm
by haman
Hi;

I am trying to learn to use Stimulsoft with MVC 5. I have created one according to the sample but gives the following error:

The required anti-forgery form field "__RequestVerificationToken" is not present.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Web.Mvc.HttpAntiForgeryException: The required anti-forgery form field "__RequestVerificationToken" is not present.
[/b][/color]

My view is like following:
@using Stimulsoft.Report.Mvc;

@{
ViewBag.Title = "Sales Invoice";
}
<h2>This is a test page</h2>
<body>
@Html.Stimulsoft().StiMvcViewer(new StiMvcViewerOptions()
{
Actions =
{
GetReport = "GetReport",
ViewerEvent = "ViewerEvent"
}
})

</body>


and have the following controller

[RoutePrefix("PIS/OutsaleReport"), Route("{action=index}")]
//[PageAuthorize()]
public class MedOutOrderReportController : Controller
{
public ActionResult Index()
{
return View("~/Modules/PIS/MedOutOrder/GetReport.cshtml");
}
public ActionResult GetReport()
{
var p = new Alias("MedOutOrder", "p");
var c = new Alias("MedOutOrderDetails", "c");
var m = new Alias("lkpMedicine", "m");

var query = new SqlQuery()
.From(p)
.From(c)
.Select(p + "CustomerName")
.Select(p + "OrderDate")
.Select(c + "Quantity")
.Select(c + "DailyDose")
.Select(c + "Comment")
.Select(m + "(GenericName + ' (' + BrandName) +') '", "MedicineName")
.Select(c + "UnitPrice")
.Select(c + "Discount")
.Select(c + "TotalMount")
.Select(p + "MedOutOrderId")
.OrderBy(p + "MedOutOrderId")
.ToString();

var data = query.ToList();

StiReport report = new StiReport();
string Path = Server.MapPath("~/Modules/Reports/OutsalesInvoice.mrt");
report.Load(Path);
report.RegBusinessObject("MedOutOrders", data); // نام شیئی که در دیزانر ایجاد کردیم
report.Dictionary.SynchronizeBusinessObjects(1);
CheckReference(report);

return StiMvcViewer.GetReportResult(report);
}

public ActionResult ViewerEvent()
{
return StiMvcViewer.ViewerEventResult();
}

Am i missing anything?

Re: Stimulsoft report viewer error

Posted: Wed Dec 26, 2018 12:06 pm
by Lech Kulikowski
Hello,

Please send us a sample project which reproduces the issue for analysis.

Thank you.

Re: Stimulsoft report viewer error

Posted: Fri Feb 15, 2019 9:07 am
by aditya.nagare
Hello @haman,
I am also facing the same error.
Do you have any updates on this ?

Re: Stimulsoft report viewer error

Posted: Fri Feb 15, 2019 10:02 am
by Lech Kulikowski
Hello,

Please try to check the last release version.

Thank you.