PDA

View Full Version : مشکل در پرینت مستقیم در stimulsoft mvc



amir3321
شنبه 03 مهر 1395, 15:59 عصر
با سلام خدمت اساتید من میخواستم از گزارشم پرینت مستقیم بگیرم از کد زیر استفاده کردم توی لوکال جواب میده ولی در سرور خطای زیر رو میده ؟؟؟؟
Showing a modal dialog box or form when the application is not running in UserInteractive mode is not a valid operation. Specify the ServiceNotification or DefaultDesktopOnly style to display a notification from a service application.

public ActionResult GetReportSnapshot() {
List<int?> factid = new List<int?> ();
if (TempData["factid"]!=null)
factid = (List<int?>)TempData["factid"];


StiReport report = new StiReport();
StiOptions p = new StiOptions();


var factorview = db.factitems.ToList();


string Path = Server.MapPath("~/Content/Reports/factorreport.mrt");
report.Load(Path);
report.RegBusinessObject("factorview", factorview);


report.Render(false);
// report.InvokePrinted();
// report.InvokePrinting();
report.Print(false);





return StiMvcViewer.GetReportSnapshotResult(this.HttpCont ext,report);
}
@Html.Stimulsoft().StiMvcViewer(



"MvcViewer1", new StiMvcViewerOptions()
{


Appearance = { ScrollbarsMode = true },
Localization = "~/Content/Reports/Localization/fa.xml",
Width = Unit.Percentage(100),



Toolbar = { Zoom = 75, PrintDestination = StiPrintDestination.Direct },
Actions =


{

GetReportSnapshot = "GetReportSnapshot",
ViewerEvent = "ViewerEvent",
PrintReport = "PrintReport",




}


} )