Exemple #1
0
        internal ReportItem FindReportItemInBody(int uniqueName)
        {
            object obj = null;
            NonComputedUniqueNames nonCompNames = null;
            QuickFindHashtable     quickFind    = ReportSnapshot.GetQuickFind(ChunkManager);

            if (quickFind != null)
            {
                obj = quickFind[uniqueName];
            }
            if (obj == null)
            {
                Global.Tracer.Assert(ReportSnapshot.ReportInstance != null);
                obj = ((ISearchByUniqueName)ReportSnapshot.ReportInstance).Find(uniqueName, ref nonCompNames, ChunkManager);
                if (obj == null)
                {
                    return(null);
                }
            }
            if (obj is Microsoft.ReportingServices.ReportProcessing.ReportItem)
            {
                Microsoft.ReportingServices.ReportProcessing.ReportItem reportItemDef = (Microsoft.ReportingServices.ReportProcessing.ReportItem)obj;
                return(ReportItem.CreateItem(-1, reportItemDef, null, this, nonCompNames));
            }
            Microsoft.ReportingServices.ReportProcessing.ReportItemInstance reportItemInstance = (Microsoft.ReportingServices.ReportProcessing.ReportItemInstance)obj;
            return(ReportItem.CreateItem(-1, reportItemInstance.ReportItemDef, reportItemInstance, this, nonCompNames));
        }
Exemple #2
0
 private void AdjustBodyWhitespace()
 {
     if (m_reportDef.ReportItems != null && m_reportDef.ReportItems.Count != 0)
     {
         double num   = 0.0;
         double num2  = 0.0;
         int    count = m_reportDef.ReportItems.Count;
         for (int i = 0; i < count; i++)
         {
             Microsoft.ReportingServices.ReportProcessing.ReportItem reportItem = m_reportDef.ReportItems[i];
             num  = Math.Max(num, reportItem.LeftValue + reportItem.WidthValue);
             num2 = Math.Max(num2, reportItem.TopValue + reportItem.HeightValue);
         }
         m_reportDef.HeightValue = Math.Min(m_reportDef.HeightValue, num2);
         string format = "{0:0.#####}mm";
         m_reportDef.Height = string.Format(CultureInfo.InvariantCulture, format, m_reportDef.HeightValue);
         double num3 = Math.Max(1.0, m_reportDef.PageWidthValue - m_reportDef.LeftMarginValue - m_reportDef.RightMarginValue);
         if (m_reportDef.Columns > 1)
         {
             num3 -= (double)(m_reportDef.Columns - 1) * m_reportDef.ColumnSpacingValue;
             num3  = Math.Max(1.0, num3 / (double)m_reportDef.Columns);
         }
         num  = Math.Round(num, 1);
         num3 = Math.Round(num3, 1);
         m_reportDef.WidthValue = Math.Min(m_reportDef.WidthValue, num3 * Math.Ceiling(num / num3));
         m_reportDef.Width      = string.Format(CultureInfo.InvariantCulture, format, m_reportDef.WidthValue);
     }
 }
Exemple #3
0
        public ReportItem Find(string uniqueName)
        {
            if (uniqueName == null || uniqueName.Length <= 0)
            {
                return(null);
            }
            if (uniqueName.Equals(base.UniqueName))
            {
                return(this);
            }
            char[] separator = new char[1]
            {
                'a'
            };
            string[] array = uniqueName.Split(separator);
            if (array == null || array.Length < 2)
            {
                return(null);
            }
            object obj = (m_pageSectionInstance != null) ? ((ISearchByUniqueName)m_pageSectionInstance) : ((ISearchByUniqueName)m_pageSectionDef);
            NonComputedUniqueNames nonComputedUniqueNames = null;
            int num = -1;

            for (int i = 1; i < array.Length; i++)
            {
                IIndexInto indexInto = obj as IIndexInto;
                if (indexInto == null)
                {
                    obj = null;
                    break;
                }
                num = ReportItem.StringToInt(array[i]);
                NonComputedUniqueNames nonCompNames = null;
                obj = indexInto.GetChildAt(num, out nonCompNames);
                if (nonComputedUniqueNames == null)
                {
                    nonComputedUniqueNames = nonCompNames;
                    continue;
                }
                if (nonComputedUniqueNames.ChildrenUniqueNames == null || num < 0 || num >= nonComputedUniqueNames.ChildrenUniqueNames.Length)
                {
                    return(null);
                }
                nonComputedUniqueNames = nonComputedUniqueNames.ChildrenUniqueNames[num];
            }
            if (obj == null)
            {
                return(null);
            }
            if (obj is Microsoft.ReportingServices.ReportProcessing.ReportItem)
            {
                Microsoft.ReportingServices.ReportProcessing.ReportItem reportItemDef = (Microsoft.ReportingServices.ReportProcessing.ReportItem)obj;
                return(ReportItem.CreateItem(uniqueName, reportItemDef, null, base.RenderingContext, nonComputedUniqueNames));
            }
            ReportItemInstance reportItemInstance = (ReportItemInstance)obj;

            return(ReportItem.CreateItem(uniqueName, reportItemInstance.ReportItemDef, reportItemInstance, base.RenderingContext, nonComputedUniqueNames));
        }
        internal static ReportItem CreateItem(int indexIntoParentCollection, Microsoft.ReportingServices.ReportProcessing.ReportItem reportItemDef, ReportItemInstance reportItemInstance, RenderingContext renderingContext, NonComputedUniqueNames nonComputedUniqueNames)
        {
            string uniqueName = null;

            if (renderingContext.InPageSection)
            {
                uniqueName = renderingContext.UniqueNamePrefix + "a" + indexIntoParentCollection.ToString(CultureInfo.InvariantCulture);
            }
            return(CreateItem(uniqueName, reportItemDef, reportItemInstance, renderingContext, nonComputedUniqueNames));
        }
 internal ReportItem(string uniqueName, int intUniqueName, Microsoft.ReportingServices.ReportProcessing.ReportItem reportItemDef, ReportItemInstance reportItemInstance, RenderingContext renderingContext)
 {
     m_members       = new ReportItemRendering();
     m_uniqueName    = uniqueName;
     m_intUniqueName = intUniqueName;
     Rendering.m_renderingContext   = renderingContext;
     Rendering.m_reportItemDef      = reportItemDef;
     Rendering.m_reportItemInstance = reportItemInstance;
     Rendering.m_headingInstance    = renderingContext.HeadingInstance;
 }
 internal Style(ReportItem reportItem, Microsoft.ReportingServices.ReportProcessing.ReportItem reportItemDef, RenderingContext context)
     : base(context)
 {
     Global.Tracer.Assert(!base.IsCustomControl);
     m_reportItem    = reportItem;
     m_reportItemDef = reportItemDef;
     if (reportItem is Line)
     {
         m_styleDefaults = LineStyleDefaults;
     }
     else
     {
         m_styleDefaults = NormalStyleDefaults;
     }
 }
Exemple #7
0
 public ReportItem this[int index]
 {
     get
     {
         if (0 > index || index >= Count)
         {
             throw new RenderingObjectModelException(ProcessingErrorCode.rsInvalidParameterRange, index, 0, Count);
         }
         ReportItem reportItem = null;
         if (m_reportItems == null || m_reportItems[index] == null)
         {
             int  internalIndex = 0;
             bool computed      = false;
             Microsoft.ReportingServices.ReportProcessing.ReportItem reportItem2 = null;
             m_reportItemColDef.GetReportItem(index, out computed, out internalIndex, out reportItem2);
             NonComputedUniqueNames nonComputedUniqueNames = null;
             ReportItemInstance     reportItemInstance     = null;
             if (!computed)
             {
                 if (m_childrenNonComputedUniqueNames != null)
                 {
                     nonComputedUniqueNames = m_childrenNonComputedUniqueNames[internalIndex];
                 }
             }
             else if (m_reportItemColInstance != null)
             {
                 reportItemInstance = m_reportItemColInstance[internalIndex];
             }
             reportItem = ReportItem.CreateItem(index, reportItem2, reportItemInstance, m_renderingContext, nonComputedUniqueNames);
             if (m_renderingContext.CacheState)
             {
                 if (m_reportItems == null)
                 {
                     m_reportItems = new ReportItem[Count];
                 }
                 m_reportItems[index] = reportItem;
             }
         }
         else
         {
             reportItem = m_reportItems[index];
         }
         return(reportItem);
     }
 }
Exemple #8
0
 internal CustomReportItem(string uniqueName, int intUniqueName, Microsoft.ReportingServices.ReportProcessing.ReportItem reportItemDef, ReportItemInstance reportItemInstance, RenderingContext renderingContext, NonComputedUniqueNames[] childrenNonComputedUniqueNames)
     : base(uniqueName, intUniqueName, reportItemDef, reportItemInstance, renderingContext)
 {
     m_isProcessing = false;
     m_childrenNonComputedUniqueNames = childrenNonComputedUniqueNames;
 }
 internal SimpleTextBoxInstanceInfo(TextBox reportItemDef, TextBoxInstanceInfo instanceInfo)
 {
     m_reportItemDef  = reportItemDef;
     m_originalValue  = instanceInfo.OriginalValue;
     m_formattedValue = instanceInfo.FormattedValue;
 }
 internal SimpleTextBoxInstanceInfo(TextBox reportItemDef)
 {
     m_reportItemDef = reportItemDef;
 }
Exemple #11
0
 internal DataRegion(int intUniqueName, Microsoft.ReportingServices.ReportProcessing.ReportItem reportItemDef, ReportItemInstance reportItemInstance, RenderingContext renderingContext)
     : base(null, intUniqueName, reportItemDef, reportItemInstance, renderingContext)
 {
 }
        internal static ReportItem CreateItem(string uniqueName, Microsoft.ReportingServices.ReportProcessing.ReportItem reportItemDef, ReportItemInstance reportItemInstance, RenderingContext renderingContext, NonComputedUniqueNames nonComputedUniqueNames)
        {
            if (reportItemDef == null)
            {
                return(null);
            }
            Global.Tracer.Assert(renderingContext != null);
            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 Microsoft.ReportingServices.ReportProcessing.Line)
            {
                Microsoft.ReportingServices.ReportProcessing.Line reportItemDef2 = (Microsoft.ReportingServices.ReportProcessing.Line)reportItemDef;
                LineInstance reportItemInstance2 = (LineInstance)reportItemInstance;
                reportItem = new Line(uniqueName, intUniqueName, reportItemDef2, reportItemInstance2, renderingContext);
            }
            else if (reportItemDef is Microsoft.ReportingServices.ReportProcessing.CheckBox)
            {
                Microsoft.ReportingServices.ReportProcessing.CheckBox reportItemDef3 = (Microsoft.ReportingServices.ReportProcessing.CheckBox)reportItemDef;
                CheckBoxInstance reportItemInstance3 = (CheckBoxInstance)reportItemInstance;
                reportItem = new CheckBox(uniqueName, intUniqueName, reportItemDef3, reportItemInstance3, renderingContext);
            }
            else if (reportItemDef is Microsoft.ReportingServices.ReportProcessing.Image)
            {
                Microsoft.ReportingServices.ReportProcessing.Image reportItemDef4 = (Microsoft.ReportingServices.ReportProcessing.Image)reportItemDef;
                ImageInstance reportItemInstance4 = (ImageInstance)reportItemInstance;
                reportItem = new Image(uniqueName, intUniqueName, reportItemDef4, reportItemInstance4, renderingContext);
            }
            else if (reportItemDef is Microsoft.ReportingServices.ReportProcessing.TextBox)
            {
                Microsoft.ReportingServices.ReportProcessing.TextBox reportItemDef5 = (Microsoft.ReportingServices.ReportProcessing.TextBox)reportItemDef;
                TextBoxInstance reportItemInstance5 = (TextBoxInstance)reportItemInstance;
                reportItem = new TextBox(uniqueName, intUniqueName, reportItemDef5, reportItemInstance5, renderingContext);
            }
            else if (reportItemDef is Microsoft.ReportingServices.ReportProcessing.Rectangle)
            {
                Microsoft.ReportingServices.ReportProcessing.Rectangle reportItemDef6 = (Microsoft.ReportingServices.ReportProcessing.Rectangle)reportItemDef;
                RectangleInstance reportItemInstance6 = (RectangleInstance)reportItemInstance;
                reportItem = new Rectangle(uniqueName, intUniqueName, reportItemDef6, reportItemInstance6, renderingContext, childrenNonComputedUniqueNames);
            }
            else if (reportItemDef is Microsoft.ReportingServices.ReportProcessing.ActiveXControl)
            {
                Microsoft.ReportingServices.ReportProcessing.ActiveXControl reportItemDef7 = (Microsoft.ReportingServices.ReportProcessing.ActiveXControl)reportItemDef;
                ActiveXControlInstance reportItemInstance7 = (ActiveXControlInstance)reportItemInstance;
                reportItem = new ActiveXControl(uniqueName, intUniqueName, reportItemDef7, reportItemInstance7, renderingContext);
            }
            else if (reportItemDef is Microsoft.ReportingServices.ReportProcessing.SubReport)
            {
                Microsoft.ReportingServices.ReportProcessing.SubReport subReport = (Microsoft.ReportingServices.ReportProcessing.SubReport)reportItemDef;
                SubReportInstance subReportInstance = (SubReportInstance)reportItemInstance;
                bool   processedWithError           = false;
                Report innerReport;
                if (Microsoft.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 Microsoft.ReportingServices.ReportProcessing.List)
            {
                Microsoft.ReportingServices.ReportProcessing.List reportItemDef8 = (Microsoft.ReportingServices.ReportProcessing.List)reportItemDef;
                ListInstance reportItemInstance8 = (ListInstance)reportItemInstance;
                reportItem = new List(intUniqueName, reportItemDef8, reportItemInstance8, renderingContext);
            }
            else if (reportItemDef is Microsoft.ReportingServices.ReportProcessing.Matrix)
            {
                Microsoft.ReportingServices.ReportProcessing.Matrix reportItemDef9 = (Microsoft.ReportingServices.ReportProcessing.Matrix)reportItemDef;
                MatrixInstance reportItemInstance9 = (MatrixInstance)reportItemInstance;
                reportItem = new Matrix(intUniqueName, reportItemDef9, reportItemInstance9, renderingContext);
            }
            else if (reportItemDef is Microsoft.ReportingServices.ReportProcessing.Table)
            {
                Microsoft.ReportingServices.ReportProcessing.Table reportItemDef10 = (Microsoft.ReportingServices.ReportProcessing.Table)reportItemDef;
                TableInstance reportItemInstance10 = (TableInstance)reportItemInstance;
                reportItem = new Table(intUniqueName, reportItemDef10, reportItemInstance10, renderingContext);
            }
            else if (reportItemDef is Microsoft.ReportingServices.ReportProcessing.OWCChart)
            {
                Microsoft.ReportingServices.ReportProcessing.OWCChart reportItemDef11 = (Microsoft.ReportingServices.ReportProcessing.OWCChart)reportItemDef;
                OWCChartInstance reportItemInstance11 = (OWCChartInstance)reportItemInstance;
                reportItem = new OWCChart(intUniqueName, reportItemDef11, reportItemInstance11, renderingContext);
            }
            else if (reportItemDef is Microsoft.ReportingServices.ReportProcessing.Chart)
            {
                Microsoft.ReportingServices.ReportProcessing.Chart reportItemDef12 = (Microsoft.ReportingServices.ReportProcessing.Chart)reportItemDef;
                ChartInstance reportItemInstance12 = (ChartInstance)reportItemInstance;
                reportItem = new Chart(intUniqueName, reportItemDef12, reportItemInstance12, renderingContext);
            }
            else if (reportItemDef is Microsoft.ReportingServices.ReportProcessing.CustomReportItem)
            {
                Microsoft.ReportingServices.ReportProcessing.CustomReportItem reportItemDef13 = (Microsoft.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);
        }
Exemple #13
0
 internal ReportItemInstance(int uniqueName, ReportItem reportItemDef)
 {
     m_uniqueName    = uniqueName;
     m_reportItemDef = reportItemDef;
 }
Exemple #14
0
 internal PageSection(bool isHeader, ReportItem parent)
     : base(parent)
 {
     m_isHeader = isHeader;
 }
Exemple #15
0
 internal TextBox(int id, ReportItem parent)
     : base(id, parent)
 {
 }
Exemple #16
0
 internal TextBox(ReportItem parent)
     : base(parent)
 {
 }