public OWCChartInstanceInfo(ReportProcessing.ProcessingContext pc, OWCChart reportItemDef, OWCChartInstance owner)
     : base(pc, reportItemDef, owner, false)
 {
     this.m_chartData = new VariantList[reportItemDef.ChartData.Count];
     for (int i = 0; i < reportItemDef.ChartData.Count; i++)
     {
         this.m_chartData[i] = new VariantList();
     }
     this.m_noRows = pc.ReportRuntime.EvaluateDataRegionNoRowsExpression(reportItemDef, reportItemDef.ObjectType, reportItemDef.Name, "NoRows");
 }
Ejemplo n.º 2
0
 public OWCChartColumnCollection(AspNetCore.ReportingServices.ReportProcessing.OWCChart chartDef, OWCChartInstance chartInstance, ReportItem owner)
 {
     this.m_owner         = owner;
     this.m_chartInstance = chartInstance;
     this.m_chartDef      = chartDef;
 }
Ejemplo n.º 3
0
        public static ReportItem CreateItem(string uniqueName, AspNetCore.ReportingServices.ReportProcessing.ReportItem reportItemDef, ReportItemInstance reportItemInstance, RenderingContext renderingContext, NonComputedUniqueNames nonComputedUniqueNames)
        {
            if (reportItemDef == null)
            {
                return(null);
            }
            Global.Tracer.Assert(null != renderingContext);
            ReportItem reportItem    = null;
            int        intUniqueName = 0;

            NonComputedUniqueNames[] childrenNonComputedUniqueNames = null;
            if (reportItemInstance != null)
            {
                intUniqueName = reportItemInstance.UniqueName;
            }
            else if (nonComputedUniqueNames != null)
            {
                intUniqueName = nonComputedUniqueNames.UniqueName;
                childrenNonComputedUniqueNames = nonComputedUniqueNames.ChildrenUniqueNames;
            }
            if (reportItemDef is AspNetCore.ReportingServices.ReportProcessing.Line)
            {
                AspNetCore.ReportingServices.ReportProcessing.Line reportItemDef2 = (AspNetCore.ReportingServices.ReportProcessing.Line)reportItemDef;
                LineInstance reportItemInstance2 = (LineInstance)reportItemInstance;
                reportItem = new Line(uniqueName, intUniqueName, reportItemDef2, reportItemInstance2, renderingContext);
            }
            else if (reportItemDef is AspNetCore.ReportingServices.ReportProcessing.CheckBox)
            {
                AspNetCore.ReportingServices.ReportProcessing.CheckBox reportItemDef3 = (AspNetCore.ReportingServices.ReportProcessing.CheckBox)reportItemDef;
                CheckBoxInstance reportItemInstance3 = (CheckBoxInstance)reportItemInstance;
                reportItem = new CheckBox(uniqueName, intUniqueName, reportItemDef3, reportItemInstance3, renderingContext);
            }
            else if (reportItemDef is AspNetCore.ReportingServices.ReportProcessing.Image)
            {
                AspNetCore.ReportingServices.ReportProcessing.Image reportItemDef4 = (AspNetCore.ReportingServices.ReportProcessing.Image)reportItemDef;
                ImageInstance reportItemInstance4 = (ImageInstance)reportItemInstance;
                reportItem = new Image(uniqueName, intUniqueName, reportItemDef4, reportItemInstance4, renderingContext);
            }
            else if (reportItemDef is AspNetCore.ReportingServices.ReportProcessing.TextBox)
            {
                AspNetCore.ReportingServices.ReportProcessing.TextBox reportItemDef5 = (AspNetCore.ReportingServices.ReportProcessing.TextBox)reportItemDef;
                TextBoxInstance reportItemInstance5 = (TextBoxInstance)reportItemInstance;
                reportItem = new TextBox(uniqueName, intUniqueName, reportItemDef5, reportItemInstance5, renderingContext);
            }
            else if (reportItemDef is AspNetCore.ReportingServices.ReportProcessing.Rectangle)
            {
                AspNetCore.ReportingServices.ReportProcessing.Rectangle reportItemDef6 = (AspNetCore.ReportingServices.ReportProcessing.Rectangle)reportItemDef;
                RectangleInstance reportItemInstance6 = (RectangleInstance)reportItemInstance;
                reportItem = new Rectangle(uniqueName, intUniqueName, reportItemDef6, reportItemInstance6, renderingContext, childrenNonComputedUniqueNames);
            }
            else if (reportItemDef is AspNetCore.ReportingServices.ReportProcessing.ActiveXControl)
            {
                AspNetCore.ReportingServices.ReportProcessing.ActiveXControl reportItemDef7 = (AspNetCore.ReportingServices.ReportProcessing.ActiveXControl)reportItemDef;
                ActiveXControlInstance reportItemInstance7 = (ActiveXControlInstance)reportItemInstance;
                reportItem = new ActiveXControl(uniqueName, intUniqueName, reportItemDef7, reportItemInstance7, renderingContext);
            }
            else if (reportItemDef is AspNetCore.ReportingServices.ReportProcessing.SubReport)
            {
                AspNetCore.ReportingServices.ReportProcessing.SubReport subReport = (AspNetCore.ReportingServices.ReportProcessing.SubReport)reportItemDef;
                SubReportInstance subReportInstance = (SubReportInstance)reportItemInstance;
                bool   processedWithError           = false;
                Report innerReport;
                if (AspNetCore.ReportingServices.ReportProcessing.SubReport.Status.Retrieved != subReport.RetrievalStatus)
                {
                    innerReport        = null;
                    processedWithError = true;
                }
                else
                {
                    if (subReport.ReportContext == null && renderingContext.CurrentReportContext != null)
                    {
                        subReport.ReportContext = renderingContext.CurrentReportContext.GetSubreportContext(subReport.ReportPath);
                    }
                    ICatalogItemContext reportContext     = subReport.ReportContext;
                    RenderingContext    renderingContext2 = new RenderingContext(renderingContext, subReport.Uri, subReport.Report.EmbeddedImages, subReport.Report.ImageStreamNames, reportContext);
                    if (subReportInstance == null)
                    {
                        innerReport = new Report(subReport.Report, null, renderingContext2, subReport.ReportName, subReport.Description, null);
                    }
                    else if (subReportInstance.ReportInstance == null)
                    {
                        processedWithError = true;
                        innerReport        = new Report(subReport.Report, null, renderingContext2, subReport.ReportName, subReport.Description, null);
                    }
                    else
                    {
                        innerReport = new Report(subReport.Report, subReportInstance.ReportInstance, renderingContext2, subReport.ReportName, subReport.Description, null);
                    }
                }
                reportItem = new SubReport(intUniqueName, subReport, subReportInstance, renderingContext, innerReport, processedWithError);
            }
            else if (reportItemDef is AspNetCore.ReportingServices.ReportProcessing.List)
            {
                AspNetCore.ReportingServices.ReportProcessing.List reportItemDef8 = (AspNetCore.ReportingServices.ReportProcessing.List)reportItemDef;
                ListInstance reportItemInstance8 = (ListInstance)reportItemInstance;
                reportItem = new List(intUniqueName, reportItemDef8, reportItemInstance8, renderingContext);
            }
            else if (reportItemDef is AspNetCore.ReportingServices.ReportProcessing.Matrix)
            {
                AspNetCore.ReportingServices.ReportProcessing.Matrix reportItemDef9 = (AspNetCore.ReportingServices.ReportProcessing.Matrix)reportItemDef;
                MatrixInstance reportItemInstance9 = (MatrixInstance)reportItemInstance;
                reportItem = new Matrix(intUniqueName, reportItemDef9, reportItemInstance9, renderingContext);
            }
            else if (reportItemDef is AspNetCore.ReportingServices.ReportProcessing.Table)
            {
                AspNetCore.ReportingServices.ReportProcessing.Table reportItemDef10 = (AspNetCore.ReportingServices.ReportProcessing.Table)reportItemDef;
                TableInstance reportItemInstance10 = (TableInstance)reportItemInstance;
                reportItem = new Table(intUniqueName, reportItemDef10, reportItemInstance10, renderingContext);
            }
            else if (reportItemDef is AspNetCore.ReportingServices.ReportProcessing.OWCChart)
            {
                AspNetCore.ReportingServices.ReportProcessing.OWCChart reportItemDef11 = (AspNetCore.ReportingServices.ReportProcessing.OWCChart)reportItemDef;
                OWCChartInstance reportItemInstance11 = (OWCChartInstance)reportItemInstance;
                reportItem = new OWCChart(intUniqueName, reportItemDef11, reportItemInstance11, renderingContext);
            }
            else if (reportItemDef is AspNetCore.ReportingServices.ReportProcessing.Chart)
            {
                AspNetCore.ReportingServices.ReportProcessing.Chart reportItemDef12 = (AspNetCore.ReportingServices.ReportProcessing.Chart)reportItemDef;
                ChartInstance reportItemInstance12 = (ChartInstance)reportItemInstance;
                reportItem = new Chart(intUniqueName, reportItemDef12, reportItemInstance12, renderingContext);
            }
            else if (reportItemDef is AspNetCore.ReportingServices.ReportProcessing.CustomReportItem)
            {
                AspNetCore.ReportingServices.ReportProcessing.CustomReportItem reportItemDef13 = (AspNetCore.ReportingServices.ReportProcessing.CustomReportItem)reportItemDef;
                CustomReportItemInstance reportItemInstance13 = (CustomReportItemInstance)reportItemInstance;
                reportItem = new CustomReportItem(uniqueName, intUniqueName, reportItemDef13, reportItemInstance13, renderingContext, childrenNonComputedUniqueNames);
                if (!renderingContext.NativeAllCRITypes && (renderingContext.NativeCRITypes == null || !renderingContext.NativeCRITypes.ContainsKey(((CustomReportItem)reportItem).Type)))
                {
                    reportItem = ((CustomReportItem)reportItem).AltReportItem;
                }
            }
            return(reportItem);
        }
Ejemplo n.º 4
0
 public OWCChartInstance(ReportProcessing.ProcessingContext pc, OWCChart reportItemDef, VariantList[] chartData)
     : base(pc.CreateUniqueName(), reportItemDef)
 {
     base.m_instanceInfo = new OWCChartInstanceInfo(pc, reportItemDef, this, chartData);
     pc.QuickFind.Add(base.UniqueName, this);
 }
        public void ChartDataXML(IChartStream chartStream)
        {
            OWCChart      oWCChart      = (OWCChart)base.m_reportItemDef;
            int           count         = this.m_chartData[0].Count;
            int           i             = 0;
            int           num           = 0;
            string        value         = string.Empty;
            StringWriter  stringWriter  = new StringWriter(CultureInfo.InvariantCulture);
            XmlTextWriter xmlTextWriter = new XmlTextWriter(stringWriter);

            xmlTextWriter.WriteStartElement("xml");
            xmlTextWriter.WriteAttributeString("xmlns", "s", null, "uuid:BDC6E3F0-6DA3-11d1-A2A3-00AA00C14882");
            xmlTextWriter.WriteAttributeString("xmlns", "dt", null, "uuid:C2F41010-65B3-11d1-A29F-00AA00C14882");
            xmlTextWriter.WriteAttributeString("xmlns", "rs", null, "urn:schemas-microsoft-com:rowset");
            xmlTextWriter.WriteAttributeString("xmlns", "z", null, "#RowsetSchema");
            xmlTextWriter.WriteStartElement("s", "Schema", null);
            xmlTextWriter.WriteAttributeString("id", "RowsetSchema");
            xmlTextWriter.WriteStartElement("s", "ElementType", null);
            xmlTextWriter.WriteAttributeString("name", "row");
            xmlTextWriter.WriteAttributeString("content", "eltOnly");
            for (i = 0; i < oWCChart.ChartData.Count; i++)
            {
                xmlTextWriter.WriteStartElement("s", "AttributeType", null);
                xmlTextWriter.WriteAttributeString("name", "c" + i.ToString(CultureInfo.InvariantCulture));
                xmlTextWriter.WriteAttributeString("rs", "name", null, oWCChart.ChartData[i].Name);
                xmlTextWriter.WriteAttributeString("rs", "nullable", null, "true");
                xmlTextWriter.WriteAttributeString("rs", "writeunknown", null, "true");
                xmlTextWriter.WriteStartElement("s", "datatype", null);
                for (num = 0; num < this.m_chartData[i].Count && ((ArrayList)this.m_chartData[i])[num] == null; num++)
                {
                }
                if (num < this.m_chartData[i].Count)
                {
                    Type type = ((ArrayList)this.m_chartData[i])[num].GetType();
                    switch (Type.GetTypeCode(type))
                    {
                    case TypeCode.Boolean:
                        value = "boolean";
                        break;

                    case TypeCode.Byte:
                        value = "ui1";
                        break;

                    case TypeCode.Char:
                        value = "char";
                        break;

                    case TypeCode.DateTime:
                        value = "dateTime";
                        break;

                    case TypeCode.Single:
                        value = "r4";
                        break;

                    case TypeCode.Double:
                        value = "float";
                        break;

                    case TypeCode.Decimal:
                        value = "r8";
                        break;

                    case TypeCode.Int16:
                        value = "i2";
                        break;

                    case TypeCode.Int32:
                        value = "i4";
                        break;

                    case TypeCode.Int64:
                        value = "i8";
                        break;

                    case TypeCode.Object:
                        if (((ArrayList)this.m_chartData[i])[num] is TimeSpan)
                        {
                            value = "time";
                        }
                        else if (((ArrayList)this.m_chartData[i])[num] is byte[])
                        {
                            value = "bin.hex";
                        }
                        break;

                    case TypeCode.SByte:
                        value = "i1";
                        break;

                    case TypeCode.UInt16:
                        value = "ui2";
                        break;

                    case TypeCode.UInt32:
                        value = "ui4";
                        break;

                    case TypeCode.UInt64:
                        value = "ui8";
                        break;

                    default:
                        value = "string";
                        break;
                    }
                }
                else
                {
                    value = "string";
                }
                xmlTextWriter.WriteAttributeString("dt", "type", null, value);
                xmlTextWriter.WriteAttributeString("rs", "fixedlength", null, "true");
                xmlTextWriter.WriteEndElement();
                xmlTextWriter.WriteEndElement();
            }
            xmlTextWriter.WriteStartElement("s", "extends", null);
            xmlTextWriter.WriteAttributeString("type", "rs:rowbase");
            xmlTextWriter.WriteEndElement();
            xmlTextWriter.WriteEndElement();
            xmlTextWriter.WriteEndElement();
            xmlTextWriter.WriteStartElement("rs", "data", null);
            bool   flag = true;
            object obj  = null;

            for (int j = 0; j < count; j++)
            {
                i = 0;
                while (i < oWCChart.ChartData.Count)
                {
                    if (((ArrayList)this.m_chartData[i])[j] == null)
                    {
                        i++;
                        continue;
                    }
                    flag = false;
                    break;
                }
                if (!flag)
                {
                    xmlTextWriter.WriteStartElement("z", "row", null);
                    for (i = 0; i < oWCChart.ChartData.Count; i++)
                    {
                        obj = ((ArrayList)this.m_chartData[i])[j];
                        if (obj != null)
                        {
                            string value2 = (obj is IFormattable) ? ((IFormattable)obj).ToString(null, CultureInfo.InvariantCulture) : obj.ToString();
                            xmlTextWriter.WriteAttributeString("c" + i.ToString(CultureInfo.InvariantCulture), value2);
                        }
                    }
                    xmlTextWriter.WriteEndElement();
                    xmlTextWriter.WriteWhitespace("\r\n");
                    flag = true;
                }
            }
            xmlTextWriter.WriteEndElement();
            xmlTextWriter.WriteEndElement();
            chartStream.Write(stringWriter.ToString());
        }
 public OWCChartInstanceInfo(OWCChart reportItemDef)
     : base(reportItemDef)
 {
 }
 public OWCChartInstanceInfo(ReportProcessing.ProcessingContext pc, OWCChart reportItemDef, OWCChartInstance owner, VariantList[] chartData)
     : base(pc, reportItemDef, owner, false)
 {
     this.m_chartData = chartData;
     this.m_noRows    = pc.ReportRuntime.EvaluateDataRegionNoRowsExpression(reportItemDef, reportItemDef.ObjectType, reportItemDef.Name, "NoRows");
 }
Ejemplo n.º 8
0
 public OWCChart(int intUniqueName, AspNetCore.ReportingServices.ReportProcessing.OWCChart reportItemDef, OWCChartInstance reportItemInstance, RenderingContext renderingContext)
     : base(intUniqueName, reportItemDef, reportItemInstance, renderingContext)
 {
 }