public void Serialize(PCAxis.Paxiom.PXModel model, System.IO.Stream stream) { System.IO.MemoryStream s = new System.IO.MemoryStream(); PxWebChart chart; chart = ChartHelper.GetChart(Settings, model); chart.SaveImage(s, Format); s.WriteTo(stream); }
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 PCAxis.Serializers.JsonStat2.JsonStat2Serializer(); 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, HttpResponse httpResponse) { PCAxis.Excel.XlsxSerializer serializer = new PCAxis.Excel.XlsxSerializer(); serializer.InformationLevel = PCAxis.Paxiom.InformationLevelType.AllInformation; serializer.DoubleColumn = PCAxis.Paxiom.Settings.Files.DoubleColumnFile; httpResponse.AddHeader("Content-Type", "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet; charset=" + System.Text.Encoding.Default.WebName); using (MemoryStream ms = new MemoryStream()) { serializer.Serialize(model, ms); ms.Position = 0; ms.WriteTo(httpResponse.OutputStream); } }
public void Serialize(PCAxis.Paxiom.PXModel model, string path) { if (model == null) { throw new ArgumentNullException("model"); } // Let the StreamWriter verify the path argument using (System.IO.FileStream writer = new System.IO.FileStream(path, System.IO.FileMode.OpenOrCreate, System.IO.FileAccess.Write, System.IO.FileShare.None)) { Serialize(model, writer); } }
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 override void Render(string format, PCAxis.Query.SavedQuery query, PCAxis.Paxiom.PXModel model, bool safe) { ChartManager.Settings.UseSettingTitle = true; ChartManager.Settings.Title = CheckParameter(query, "chart_title") ? query.Output.Params["chart_title"] : ChartManager.Settings.Title; ChartManager.Settings.Width = CheckParameter(query, "chart_width") ? int.Parse(query.Output.Params["chart_width"]) : ChartManager.Settings.Width; ChartManager.Settings.Height = CheckParameter(query, "chart_height") ? int.Parse(query.Output.Params["chart_height"]) : ChartManager.Settings.Height; ChartManager.Settings.LineThickness = CheckParameter(query, "chart_linethickness") ? int.Parse(query.Output.Params["chart_linethickness"]) : ChartManager.Settings.LineThickness; ChartManager.Settings.TimeSortOrder = CheckParameter(query, "chart_timesortorder") ? (ChartSettings.SortType)Enum.Parse(typeof(ChartSettings.SortType), query.Output.Params["chart_timesortorder"], true) : ChartManager.Settings.TimeSortOrder; ChartManager.Settings.LabelOrientation = CheckParameter(query, "chart_labelorientation") ? (ChartSettings.OrientationType)Enum.Parse(typeof(ChartSettings.OrientationType), query.Output.Params["chart_labelorientation"], true) : ChartManager.Settings.LabelOrientation; ChartManager.Settings.Guidelines = CheckParameter(query, "chart_guidelines") ? (ChartSettings.GuidelinesType)Enum.Parse(typeof(ChartSettings.GuidelinesType), query.Output.Params["chart_guidelines"], true) : ChartManager.Settings.Guidelines; ChartManager.Settings.ShowLegend = CheckParameter(query, "chart_showlegend") ? bool.Parse(query.Output.Params["chart_showlegend"]) : ChartManager.Settings.ShowLegend; ChartManager.Settings.LegendHeight = CheckParameter(query, "chart_legendheight") ? int.Parse(query.Output.Params["chart_legendheight"]) : ChartManager.Settings.LegendHeight; RenderToScreen(query, model, "chartViewColumn", "Chart.aspx", safe); }
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(); } }
public override void Render(string format, PCAxis.Query.SavedQuery query, PCAxis.Paxiom.PXModel model, bool safe) { ChartManager.Settings.UseSettingTitle = true; //Custom chart title only works for the language that was selected when the saved query was created. if (query.Sources[0].Language.ToLower() == model.Meta.CurrentLanguage.ToLower()) { ChartManager.Settings.Title = CheckParameter(query, "chart_title") ? query.Output.Params["chart_title"] : ChartManager.Settings.Title; } else { ChartManager.Settings.Title = model.Meta.Title; } ChartManager.Settings.Width = CheckParameter(query, "chart_width") ? int.Parse(query.Output.Params["chart_width"]) : ChartManager.Settings.Width; ChartManager.Settings.Height = CheckParameter(query, "chart_height") ? int.Parse(query.Output.Params["chart_height"]) : ChartManager.Settings.Height; ChartManager.Settings.LineThickness = CheckParameter(query, "chart_linethickness") ? int.Parse(query.Output.Params["chart_linethickness"]) : ChartManager.Settings.LineThickness; ChartManager.Settings.TimeSortOrder = CheckParameter(query, "chart_timesortorder") ? (ChartSettings.SortType)Enum.Parse(typeof(ChartSettings.SortType), query.Output.Params["chart_timesortorder"], true) : ChartManager.Settings.TimeSortOrder; ChartManager.Settings.LabelOrientation = CheckParameter(query, "chart_labelorientation") ? (ChartSettings.OrientationType)Enum.Parse(typeof(ChartSettings.OrientationType), query.Output.Params["chart_labelorientation"], true) : ChartManager.Settings.LabelOrientation; ChartManager.Settings.Guidelines = CheckParameter(query, "chart_guidelines") ? (ChartSettings.GuidelinesType)Enum.Parse(typeof(ChartSettings.GuidelinesType), query.Output.Params["chart_guidelines"], true) : ChartManager.Settings.Guidelines; ChartManager.Settings.ShowLegend = CheckParameter(query, "chart_showlegend") ? bool.Parse(query.Output.Params["chart_showlegend"]) : ChartManager.Settings.ShowLegend; ChartManager.Settings.LegendHeight = CheckParameter(query, "chart_legendheight") ? int.Parse(query.Output.Params["chart_legendheight"]) : ChartManager.Settings.LegendHeight; RenderToScreen(query, model, "chartViewColumn", "Chart.aspx", safe); }
public override void Render(string format, PCAxis.Query.SavedQuery query, PCAxis.Paxiom.PXModel model, bool safe) { RenderToScreen(query, model, "informationView", "InformationPresentation.aspx", safe); }
public override void Render(string format, PCAxis.Query.SavedQuery query, PCAxis.Paxiom.PXModel model, bool safe) { RenderToScreen(query, model, "tableViewSorted", "DataSort.aspx", safe); }