I'am creating new project with standard Visual Studio 2015 template. I can't save report on server side. After doing some changes in desinger I click save. Action on controller is executed, but I can't access report object. StiMvcDesigner.GetReportObject(this.Request) gives me always empty result. When I save report throught Save As button I get correct file. What can I do to find an error.
My controller code:
Code: Select all
public ActionResult GetPrintTemplate(string id)
{
var report = new StiReport();
using (System.IO.StreamReader sr = new System.IO.StreamReader(_ReportPath))
{
var data = sr.ReadToEnd();
report.LoadFromString(data);
}
return StiMvcDesigner.GetReportTemplateResult(report);
}
public ActionResult GetPrintSnapshot(string id)
{
StiReport report = StiMvcDesigner.GetReportObject(this.Request);
return StiMvcDesigner.GetReportSnapshotResult(this.Request, report);// (this.Request, report);
}
public ActionResult SavePrintTemplate(string id)
{
StiReport report = StiMvcDesigner.GetReportObject(this.Request); //// HERE I GET ALWAYS EMPTY REPORT
using (System.IO.StreamWriter sw = new System.IO.StreamWriter(_ReportPath))
{
sw.Write(report.SaveDocumentToString());
}
return StiMvcDesigner.SaveReportResult(false);
}
Code: Select all
@Html.Stimulsoft().StiMvcDesigner(new StiMvcDesignerOptions()
{
ActionGetReportTemplate = "GetPrintTemplate",
ActionGetReportSnapshot = "GetPrintSnapshot",
ActionSaveReportTemplate = "SavePrintTemplate",
Height = Unit.Pixel(800),
Width = Unit.Percentage(100),
AllowModifyConnections = true,
AllowModifyDataSources = true,
AllowModifyDictionary = true,
//LocalizationDirectory = "~/App_Data/ReportsLocalization/",
//Localization = locationName,
// ActionGetLocalization = "GetLocalization",
Theme = StiMvcDesignerOptions.Themes.Blue,
ConnectionClientRequestTimeout = 1000000
})