public void Serialize(PCAxis.Paxiom.PXModel model, ResponseBucket cacheResponse) { cacheResponse.ContentType = "text/csv; charset=" + System.Text.Encoding.Default.WebName; PCAxis.Paxiom.IPXModelStreamSerializer serializer = new PCAxis.Paxiom.CsvFileSerializer(); using (System.IO.MemoryStream stream = new System.IO.MemoryStream()) { serializer.Serialize(model, stream); stream.Flush(); cacheResponse.ResponseData = stream.ToArray(); } }
public void Serialize(PCAxis.Paxiom.PXModel model, ResponseBucket cacheResponse) { cacheResponse.ContentType = "application/json; charset=" + System.Text.Encoding.UTF8.WebName; PCAxis.Paxiom.IPXModelStreamSerializer serializer = new PX.Serializers.Json.JsonSerializer(); using (System.IO.MemoryStream stream = new System.IO.MemoryStream()) { serializer.Serialize(model, stream); cacheResponse.ResponseData = stream.ToArray(); } }
public void Serialize(PCAxis.Paxiom.PXModel model, ResponseBucket cacheResponse) { cacheResponse.ContentType = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet; charset=" + System.Text.Encoding.Default.WebName; PCAxis.Excel.XlsxSerializer serializer = new PCAxis.Excel.XlsxSerializer(); serializer.InformationLevel = PCAxis.Paxiom.InformationLevelType.AllInformation; serializer.DoubleColumn = PCAxis.Paxiom.Settings.Files.DoubleColumnFile; using (System.IO.MemoryStream stream = new System.IO.MemoryStream()) { serializer.Serialize(model, stream); stream.Flush(); cacheResponse.ResponseData = stream.ToArray(); } }
public void Serialize(PCAxis.Paxiom.PXModel model, ResponseBucket cacheResponse) { if (_encoding == "base64") { cacheResponse.ContentType = "text/plain; charset=" + System.Text.Encoding.Default.WebName; } else { cacheResponse.ContentType = "image/png; charset=" + System.Text.Encoding.Default.WebName; } using (System.IO.MemoryStream stream = new System.IO.MemoryStream()) { Serialize(model, stream); stream.Flush(); cacheResponse.ResponseData = stream.ToArray(); } }
public void Serialize(PCAxis.Paxiom.PXModel model, ResponseBucket cacheResponse) { cacheResponse.ContentType = "application/json; charset=" + System.Text.Encoding.UTF8.WebName; var jsonStatSerializer = new PCAxis.Serializers.JsonStat.JsonStatSerializer(); var geoVariablesStr = ConfigurationManager.AppSettings["geoVariables"]; if (!string.IsNullOrEmpty(geoVariablesStr)) { jsonStatSerializer.GeoVariableCodes = geoVariablesStr.Split(",".ToCharArray()); } PCAxis.Paxiom.IPXModelStreamSerializer serializer = jsonStatSerializer; using (System.IO.MemoryStream stream = new System.IO.MemoryStream()) { serializer.Serialize(model, stream); stream.Flush(); cacheResponse.ResponseData = stream.ToArray(); } }