I have some strange results when trying to save the report generated using Reports.JS on server (C#). The PDF is indeed created, but the layout is (letter spacings, etc..) is dysfunctional.
This is the JS code to get the report data:
Code: Select all
var settings = new Stimulsoft.Report.Export.StiPdfExportSettings();
var service = new Stimulsoft.Report.Export.StiPdfExportService();
var stream = new Stimulsoft.System.IO.MemoryStream();
service.exportTo(that.report, stream, settings);
var data = stream.toArray();
var sendToServer = JSON.stringify(data);
Code: Select all
String[] _reportS = JsonConvert.DeserializeObject<String[]>(sendToServer);
byte[] _reportB = _reportS.Select(byte.Parse).ToArray();
File.WriteAllBytes(System.Web.HttpContext.Current.Server.MapPath("~/foo.pdf"), _reportB);
Thanks
PS I don't want to use the client side JS function to save the file, it has to be done server-side.