Cloud
Облачный сервис для быстрого и эффективного анализа и визуализации данных для вашего бизнеса без необходимости создания своих приложений и программирования.
StiNetCoreViewer component to the view page. Also you need to pass the StiNetCoreViewerOptions object to the constructor. In the options, you should set the next actions - GetReport, EmailReport and ViewerEvent. They are located in the Actions options group. To enable the the ability to send Email, you should set the ShowSendEmailButton option in the Toolbar group to true:
@using Stimulsoft.Report.Mvc;
...
@Html.StiNetCoreViewer(new StiNetCoreViewerOptions()
{
Actions =
{
GetReport = "GetReport",
EmailReport = "EmailReport",
ViewerEvent = "ViewerEvent"
},
Toolbar =
{
ShowSendEmailButton = true
}
})
GetReport action loads the report and returns the answer to the client part of the viewer using the GetReportResult() static method. In the parameters of this method, the report object should be passed:
public IActionResult GetReport()
{
// Create the report object
var report = new StiReport();
report.Load(StiNetCoreHelper.MapPath(this, "Reports/TwoSimpleLists.mrt"));
return StiNetCoreViewer.GetReportResult(this, report);
}
ViewerEvent action handles all the viewer events (switching pages, zooming, etc.) and returns the answer to the client using the ViewerEventResult() static method:
public IActionResult ViewerEvent()
{
return StiNetCoreViewer.ViewerEventResult(this);
}
EmailReport action will be invoked when you send a report by Email through menu of the viewer. In this action, you can get the email options object of the StiEmailOptions type. In these options will be passed all the data required for sending the Email. You need to fill the necessary options, such as server address, login, password and other. Also you can change the address of the recipient, email subject and body, if it is important (these options are requested in the viewer dialog).EmailReportResult() static method. In the parameters of this method, the email options object should be passed:
public IActionResult EmailReport()
{
var options = StiNetCoreViewer.GetEmailOptions(this);
options.AddressFrom = "admin@test.com";
//options.AddressTo = "manager@test.com";
//options.Subject = "Quarterly Report";
//options.Body = "Quarterly report on arrival of the goods.";
options.Host = "smtp.test.com";
//options.Port = 465;
options.UserName = "admin@test.com";
options.Password = "************";
return StiNetCoreViewer.EmailReportResult(this, options);
}