当我键入此URL并打印所需文档时,我想运行打印命令。
这是调用此方法的网址:
http://localhost:9090/api/printPage
Api方法
[HttpGet]
[Route("PrintPage")]
public boolean PrintPage()
{
try
{
var p = new List<Person>()
{
new Person() {Id = 1, FirstName = "omid", LastName = "nasri", Gender = true}
, new Person() {Id = 2, FirstName = "hana", LastName = "akbari", Gender = false}
, new Person() {Id = 3, FirstName = "ali", LastName = "jahani", Gender = true }
, new Person() {Id = 4, FirstName = "sara", LastName = "sabori", Gender = false }
};
var mainReport = new StiReport();
mainReport.Load(@"D:\WebSite\Web\Print\Report.mrt");
mainReport.RegBusinessObject("persons" , p);
mainReport.Print(false);
return true;
}
catch (Exception ex)
{
return false;
}
}
我使用stimulsoft 2012.1。