Esempio n. 1
0
        public void CustomReportTest()
        {
            var store  = CreateStore();
            var entity = new CustomReportItem();

            entity.DocumentKindID = DocumentKindSet.OrderReportDocument.DocumentKindID;
            entity.Title          = "Title";
            entity.HtmlContent    = "HtmlContent";

            store.SaveCustomReportItem(entity);

            var savedItem = store.GetCustomReportItem(entity.CustomReportIDGuid);

            Assert.IsNotNull(savedItem);

            Assert.AreEqual(entity.DocumentKindID, savedItem.DocumentKindID);
            Assert.AreEqual(entity.HtmlContent, savedItem.HtmlContent);
            Assert.AreEqual(entity.Title, savedItem.Title);

            store.DeleteCustomReportItem(entity.CustomReportIDGuid);

            savedItem = store.GetCustomReportItem(entity.CustomReportIDGuid);

            Assert.IsNull(savedItem);
        }
Esempio n. 2
0
        //internal static OnCreateLogger lLog = new OnCreateLogger(@"d:\save\info.txt", "PolygonsCustomReportItem was initialized!");

        #region ICustomReportItem Members

        public void GenerateReportItemDefinition(CustomReportItem cri)
        {
            // Create the Image Definition object that will be
            // used to render the custom report item
            cri.CreateCriImageDefinition();
            Image polygonImage = (Image)cri.GeneratedReportItem;
        }
        public void RenderReportItem(RPLWriter rplWriter, string reportItemName)
        {
            AspNetCore.ReportingServices.OnDemandReportRendering.ReportSection reportSection = null;
            ReportItem reportItem = SelectiveRendering.FindReportItem(this.m_report, SelectiveRendering.SplitReportItemPath(reportItemName), out reportSection);

            if (reportItem == null)
            {
                throw new SelectiveRenderingCannotFindReportItemException(reportItemName);
            }
            CustomReportItem criOwner = reportItem.CriOwner;

            if (criOwner != null)
            {
                criOwner.DynamicWidth  = ReportSize.FromMillimeters(this.m_paginationSettings.PhysicalPageWidth);
                criOwner.DynamicHeight = ReportSize.FromMillimeters(this.m_paginationSettings.PhysicalPageHeight);
            }
            PageItem pageItem = PageItem.Create(reportItem, false, this.m_pageContext);

            pageItem.ItemPageSizes.Top    = 0.0;
            pageItem.ItemPageSizes.Left   = 0.0;
            pageItem.ItemPageSizes.Width  = this.m_paginationSettings.PhysicalPageWidth;
            pageItem.ItemPageSizes.Height = this.m_paginationSettings.PhysicalPageHeight;
            ItemContext itemContext = new ItemContext(rplWriter, this.m_pageContext, this.m_report, reportSection);

            if (rplWriter.BinaryWriter != null)
            {
                ReportToRplStreamWriter.Write(pageItem, itemContext);
            }
            else
            {
                ReportToRplOmWriter.Write(pageItem, itemContext);
            }
            this.Done = true;
        }
        public void GenerateReportItemDefinition(CustomReportItem cri)
        {
            // Create image definition that will be used to render the image
            cri.CreateCriImageDefinition();

            Image image = (Image)cri.GeneratedReportItem;
        }
 public void GenerateReportItemDefinition(CustomReportItem cri)
 {
     // Create the Image Definition object that will be
     // used to render the custom report item
     cri.CreateCriImageDefinition();
     Image polygonImage = (Image)cri.GeneratedReportItem;
 }
        internal void RenderReportItem(RPLWriter rplWriter, string reportItemName)
        {
            Microsoft.ReportingServices.OnDemandReportRendering.ReportSection reportSection = null;
            ReportItem       obj      = FindReportItem(m_report, SplitReportItemPath(reportItemName), out reportSection) ?? throw new SelectiveRenderingCannotFindReportItemException(reportItemName);
            CustomReportItem criOwner = obj.CriOwner;

            if (criOwner != null)
            {
                criOwner.DynamicWidth  = ReportSize.FromMillimeters(m_paginationSettings.PhysicalPageWidth);
                criOwner.DynamicHeight = ReportSize.FromMillimeters(m_paginationSettings.PhysicalPageHeight);
            }
            PageItem pageItem = PageItem.Create(obj, tablixCellParent: false, m_pageContext);

            pageItem.ItemPageSizes.Top    = 0.0;
            pageItem.ItemPageSizes.Left   = 0.0;
            pageItem.ItemPageSizes.Width  = m_paginationSettings.PhysicalPageWidth;
            pageItem.ItemPageSizes.Height = m_paginationSettings.PhysicalPageHeight;
            ItemContext itemContext = new ItemContext(rplWriter, m_pageContext, m_report, reportSection);

            if (rplWriter.BinaryWriter != null)
            {
                ReportToRplStreamWriter.Write(pageItem, itemContext);
            }
            else
            {
                ReportToRplOmWriter.Write(pageItem, itemContext);
            }
            Done = true;
        }
Esempio n. 7
0
        /// <summary>
        ///     Implements the EvaluateReportItemInstance() method from interface <see cref="ICustomReportItem" />.
        /// </summary>
        public void EvaluateReportItemInstance(CustomReportItem customReportItem)
        {
            // initialization
            var onDemandReportRenderingImage =
                ((ReportingServices.OnDemandReportRendering.Image)customReportItem.GeneratedReportItem);

            // get the graphics output from R as image
            var rCode = (string)GetCustomPropertyValue(customReportItem.CustomProperties, "rGraphicsDevice:Code", "");
            var dpi   =
                Convert.ToInt32(GetCustomPropertyValue(customReportItem.CustomProperties, "rGraphicsDevice:Dpi", 150));
            var renderTextOutputInstead =
                Convert.ToBoolean(GetCustomPropertyValue(customReportItem.CustomProperties,
                                                         "rGraphicsDevice:RenderTextOutputInstead", false));
            var fontFamily = customReportItem.Style.FontFamily.Value;
            var fontSizeEm = (int)(customReportItem.Style.FontSize.Value.ToInches() * dpi);

            fontSizeEm = fontSizeEm != 0 ? fontSizeEm : 16;
            var textOutputFont  = new Font(fontFamily, fontSizeEm);
            var textOutputBrush = new SolidBrush(customReportItem.Style.Color.Value.ToColor());

            /* TODO: complete - renderTextOutputInstead setting. the font size does not work properly yet.
             *
             * var rGraphicsDevice = new RGraphicsDevice(onDemandReportRenderingImage.Width.ToMillimeters(),
             *  onDemandReportRenderingImage.Height.ToMillimeters(), dpi, renderTextOutputInstead, textOutputFont,
             *  textOutputBrush);
             * */
            var rGraphicsDevice = new RGraphicsDevice(onDemandReportRenderingImage.Width.ToMillimeters(),
                                                      onDemandReportRenderingImage.Height.ToMillimeters(), dpi, false, textOutputFont,
                                                      textOutputBrush);
            string rScriptConsoleOutput;
            var    rGraphicsOutput = rGraphicsDevice.GetDeviceOutputAsImage(rCode, out rScriptConsoleOutput);

            // update the customReportItem to use the device output image
            onDemandReportRenderingImage.ImageInstance.ImageData = ConvertImageToPngByteArray(rGraphicsOutput);
        }
        public void GenerateReportItemDefinition(CustomReportItem cri)
        {
            // Create image definition that will be used to render the image
            cri.CreateCriImageDefinition();

            Image image = (Image)cri.GeneratedReportItem;
        }
Esempio n. 9
0
        private static StringCollection GetFieldsForCustomReportItemDataSet(CustomReportItem customReportItem, IServiceProvider serviceProvider)
        {
            StringCollection fields = new StringCollection();
            Report           report = GetReportFromServiceProvider(serviceProvider);

            if (report == null)
            {
                Trace.TraceWarning("Unabled to get fields for custom report item. Unable to get a report from the service provider");
                return(fields);
            }
            Debug.Assert(customReportItem.CustomData != null, "CustomData can not be null.");
            string dataSetName = customReportItem.CustomData.DataSetName;

            foreach (DataSet dataSet in report.DataSets)
            {
                if (dataSet.Name == dataSetName)
                {
                    foreach (Field field in dataSet.Fields)
                    {
                        fields.Add(string.Format("={0}", GenerateFieldValueExpression(field.Name)));
                    }
                    break;
                }
            }
            return(fields);
        }
Esempio n. 10
0
        public void EvaluateReportItemInstance(CustomReportItem cri)
        {
            // Get the Image definition
            Image polygonImage = (Image)cri.GeneratedReportItem;

            // Render the image for the custom report item
            polygonImage.ImageInstance.ImageData = DrawImage(cri);
        }
        public void EvaluateReportItemInstance(CustomReportItem cri)
        {
            // Get the Image definition
            Image polygonImage = (Image)cri.GeneratedReportItem;

            // Render the image for the custom report item
            polygonImage.ImageInstance.ImageData = DrawImage(cri);
        }
        public void EvaluateReportItemInstance(CustomReportItem cri)
        {
            // Cache the CRI object
            _cri = cri;

            // Render the actual image now
            Image image = (Image)cri.GeneratedReportItem;
            image.ImageInstance.ImageData = DrawImage();
        }
        public void EvaluateReportItemInstance(CustomReportItem cri)
        {
            // Cache the CRI object
            _cri = cri;

            // Render the actual image now
            Image image = (Image)cri.GeneratedReportItem;

            image.ImageInstance.ImageData = DrawImage();
        }
        public CustomReportItemCellInstance(int rowIndex, int colIndex, CustomReportItem definition, ReportProcessing.ProcessingContext pc)
        {
            this.m_rowIndex    = rowIndex;
            this.m_columnIndex = colIndex;
            Global.Tracer.Assert(definition != null && definition.DataRowCells != null && rowIndex < definition.DataRowCells.Count && colIndex < definition.DataRowCells[rowIndex].Count && 0 < definition.DataRowCells[rowIndex][colIndex].Count);
            DataValueCRIList dataValueCRIList = definition.DataRowCells[rowIndex][colIndex];

            Global.Tracer.Assert(null != dataValueCRIList);
            this.m_dataValueInstances = dataValueCRIList.EvaluateExpressions(definition.ObjectType, definition.Name, null, dataValueCRIList.RDLRowIndex, dataValueCRIList.RDLColumnIndex, pc);
            Global.Tracer.Assert(null != this.m_dataValueInstances);
        }
 internal CustomReportItemInstance(ReportProcessing.ProcessingContext pc, CustomReportItem reportItemDef)
     : base(pc.CreateUniqueName(), reportItemDef)
 {
     m_instanceInfo = new CustomReportItemInstanceInfo(pc, reportItemDef, this);
     pc.Pagination.EnterIgnoreHeight(reportItemDef.StartHidden);
     if (reportItemDef.DataSetName != null)
     {
         m_columnInstances = new CustomReportItemHeadingInstanceList();
         m_rowInstances    = new CustomReportItemHeadingInstanceList();
         m_cells           = new CustomReportItemCellInstancesList();
     }
 }
Esempio n. 16
0
 /// <summary>
 /// Initializes a new <see cref="DataSetNameEditor"/>.
 /// </summary>
 public DataSetNameEditor(IServiceProvider serviceProvider, CustomReportItem reportItem)
 {
     if (serviceProvider == null)
     {
         throw new ArgumentNullException("serviceProvider");
     }
     if (reportItem == null)
     {
         throw new ArgumentNullException("reportItem");
     }
     _serviceProvider = serviceProvider;
     _reportItem      = reportItem;
     InitializeComponent();
     InitializeDataSetsCombo();
 }
        internal DataValueInstance DeepClone()
        {
            DataValueInstance dataValueInstance = new DataValueInstance();

            if (m_name != null)
            {
                dataValueInstance.Name = string.Copy(m_name);
            }
            if (m_value != null)
            {
                CustomReportItem.CloneObject(m_value, out object clone);
                dataValueInstance.Value = clone;
            }
            return(dataValueInstance);
        }
Esempio n. 18
0
        public DataValueInstance DeepClone()
        {
            DataValueInstance dataValueInstance = new DataValueInstance();

            if (this.m_name != null)
            {
                dataValueInstance.Name = string.Copy(this.m_name);
            }
            if (this.m_value != null)
            {
                object value = default(object);
                CustomReportItem.CloneObject(this.m_value, out value);
                dataValueInstance.Value = value;
            }
            return(dataValueInstance);
        }
Esempio n. 19
0
        /// <summary>
        /// Creates an image of the CustomReportItem's name
        /// </summary>
        private byte[] DrawImage(CustomReportItem customReportItem)
        {
            int width      = 1;     // pixels
            int height     = 1;     // pixels
            int resolution = 75;    // dpi

            System.Drawing.Bitmap bitmap = new System.Drawing.Bitmap(width, height);
            bitmap.SetResolution(resolution, resolution);

            System.Drawing.Graphics graphics = System.Drawing.Graphics.FromImage(bitmap);
            graphics.PageUnit = System.Drawing.GraphicsUnit.Pixel;

            // Get the Font for the Text
            System.Drawing.Font font = new System.Drawing.Font(System.Drawing.FontFamily.GenericMonospace,
                                                               12, System.Drawing.FontStyle.Regular);

            // Get the Brush for drawing the Text
            System.Drawing.Brush brush = new System.Drawing.SolidBrush(System.Drawing.Color.LightGreen);

            // Get the measurements for the image
            System.Drawing.SizeF maxStringSize = graphics.MeasureString(customReportItem.Name, font);
            width  = (int)(maxStringSize.Width + 2 * font.GetHeight(resolution));
            height = (int)(maxStringSize.Height + 2 * font.GetHeight(resolution));

            bitmap.Dispose();
            bitmap = new System.Drawing.Bitmap(width, height);
            bitmap.SetResolution(resolution, resolution);

            graphics.Dispose();
            graphics          = System.Drawing.Graphics.FromImage(bitmap);
            graphics.PageUnit = System.Drawing.GraphicsUnit.Pixel;

            // Draw the text
            graphics.DrawString(customReportItem.Name, font, brush, font.GetHeight(resolution),
                                font.GetHeight(resolution));

            // Create the byte array of the image data
            MemoryStream memoryStream = new MemoryStream();

            bitmap.Save(memoryStream, ImageFormat.Bmp);
            memoryStream.Position = 0;
            byte[] imageData = new byte[memoryStream.Length];
            memoryStream.Read(imageData, 0, imageData.Length);

            return(imageData);
        }
        public void NewOuterCells()
        {
            if (0 >= this.m_currentCellInnerIndex && this.m_cells.Count != 0)
            {
                return;
            }
            CustomReportItem customReportItem = (CustomReportItem)base.m_reportItemDef;

            if (customReportItem.ProcessingInnerGrouping == Pivot.ProcessingInnerGroupings.Column)
            {
                CustomReportItemCellInstanceList value = new CustomReportItemCellInstanceList();
                this.m_cells.Add(value);
            }
            if (0 < this.m_currentCellInnerIndex)
            {
                this.m_currentCellOuterIndex++;
                this.m_currentCellInnerIndex = 0;
            }
        }
Esempio n. 21
0
        /// <summary>
        /// Initializes new instance of CalendarDesignerCulture.
        /// </summary>
        /// <param name="cri">Calendar report item that CalendarDesignerCulture is initialized for.</param>
        public CalendarDesignerCulture(CustomReportItem cri)
        {
            _cri = cri;
            IDesignerHost host = _cri.Site.GetService(typeof(IDesignerHost)) as IDesignerHost;

            if (host == null)
            {
                Debug.Fail("Can get IDesignerHost for calendar report item");
                return;
            }
            PageReport def = host.RootComponent as PageReport;

            if (def == null)
            {
                Debug.Fail("Can get report definition from the host's root component");
                return;
            }
            _parentReport = def.Report;
        }
Esempio n. 22
0
        public static PageReport BuildContentLayout(ReportWizardState state)
        {
            PageReport def = null;

            //check if Table can be created
            if (state.DisplayFields.Count > 0 || state.GroupingFields.Count > 0)
            {
                FileInfo masterFile = new FileInfo("../../" + state.SelectedMasterReport.MasterReportFile);
                def = PageReport.CreateFromMaster(new Uri(masterFile.FullName));
                CustomReportItem placeHolder   = (CustomReportItem)def.Report.Body.ReportItems[CRIName];
                Length           contentHeight = placeHolder.Height;
                Table            table         = BuildTable(state, contentHeight);
                placeHolder.ReportItems.Add(table);
            }
            if (def == null)
            {
                def = new PageReport();
                def.Report.Body.Height = "15cm";
                def.Report.Width       = "20cm";
            }
            return(def);
        }
Esempio n. 23
0
        /// <summary>
        ///     Implements the GenerateReportItemDefinition() method from interface <see cref="ICustomReportItem" />.
        /// </summary>
        public void GenerateReportItemDefinition(CustomReportItem customReportItem)
        {
            // generate the image definition object being used later to render the output image
            customReportItem.CreateCriImageDefinition();

            // get the generated report item and the related ReportingServices.OnDemandReportRendering.Image
            var generatedReportItem          = customReportItem.GeneratedReportItem;
            var onDemandReportRenderingImage = (ReportingServices.OnDemandReportRendering.Image)generatedReportItem;

            // adopt the border settings
            onDemandReportRenderingImage.Style.Border.Instance.Color = customReportItem.Style.Border.Instance.Color;
            onDemandReportRenderingImage.Style.Border.Instance.Style = customReportItem.Style.Border.Instance.Style;
            onDemandReportRenderingImage.Style.Border.Instance.Width = customReportItem.Style.Border.Instance.Width;

            // set the SSRS image object's sizing to FitProportional to ensure that the image size is always right
            // note: due to resolution mismatch of the output device and our generated image, we could get wrong image sizes
            //       in the final output. the FitProportional setting will avoid this and ensure that our image has always
            //       the desired size, independent of its resolution.
            onDemandReportRenderingImage.ImageInstance.MIMEType = "image/png";
            onDemandReportRenderingImage.Sizing =
                ReportingServices.OnDemandReportRendering.Image.Sizings.FitProportional;
        }
        public CustomReportItemCellInstance AddCell(ReportProcessing.ProcessingContext pc)
        {
            CustomReportItem customReportItem = (CustomReportItem)base.m_reportItemDef;
            bool             flag             = customReportItem.ProcessingInnerGrouping == Pivot.ProcessingInnerGroupings.Column;
            int rowIndex;
            int colIndex;

            if (flag)
            {
                rowIndex = this.m_currentOuterStaticIndex;
                colIndex = this.m_currentInnerStaticIndex;
            }
            else
            {
                colIndex = this.m_currentOuterStaticIndex;
                rowIndex = this.m_currentInnerStaticIndex;
            }
            CustomReportItemCellInstance customReportItemCellInstance = new CustomReportItemCellInstance(rowIndex, colIndex, customReportItem, pc);

            if (flag)
            {
                this.m_cells[this.m_currentCellOuterIndex].Add(customReportItemCellInstance);
            }
            else
            {
                if (this.m_currentCellOuterIndex == 0)
                {
                    Global.Tracer.Assert(this.m_cells.Count == this.m_currentCellInnerIndex);
                    CustomReportItemCellInstanceList value = new CustomReportItemCellInstanceList();
                    this.m_cells.Add(value);
                }
                this.m_cells[this.m_currentCellInnerIndex].Add(customReportItemCellInstance);
            }
            this.m_currentCellInnerIndex++;
            return(customReportItemCellInstance);
        }
        internal CustomReportItemCellInstance AddCell(ReportProcessing.ProcessingContext pc)
        {
            CustomReportItem customReportItem = (CustomReportItem)m_reportItemDef;
            bool             num = customReportItem.ProcessingInnerGrouping == Pivot.ProcessingInnerGroupings.Column;
            int rowIndex;
            int colIndex;

            if (num)
            {
                rowIndex = m_currentOuterStaticIndex;
                colIndex = m_currentInnerStaticIndex;
            }
            else
            {
                colIndex = m_currentOuterStaticIndex;
                rowIndex = m_currentInnerStaticIndex;
            }
            CustomReportItemCellInstance customReportItemCellInstance = new CustomReportItemCellInstance(rowIndex, colIndex, customReportItem, pc);

            if (num)
            {
                m_cells[m_currentCellOuterIndex].Add(customReportItemCellInstance);
            }
            else
            {
                if (m_currentCellOuterIndex == 0)
                {
                    Global.Tracer.Assert(m_cells.Count == m_currentCellInnerIndex);
                    CustomReportItemCellInstanceList value = new CustomReportItemCellInstanceList();
                    m_cells.Add(value);
                }
                m_cells[m_currentCellInnerIndex].Add(customReportItemCellInstance);
            }
            m_currentCellInnerIndex++;
            return(customReportItemCellInstance);
        }
Esempio n. 26
0
 /// <summary>
 /// Defines is fixed size applicable for provided report item.
 /// </summary>
 /// <param name="reportItem"></param>
 /// <returns>True if fixed size is apllicable for provided report item.</returns>
 public static bool IsFixedSizeApplicable(CustomReportItem reportItem)
 {
     return(reportItem != null && reportItem.Parent != null && string.Equals(reportItem.Type, "Calendar") &&
            GetParentDataRegion(reportItem.Parent) is FixedPage);
 }
Esempio n. 27
0
 /// <summary>
 /// Defines is need to paint fixed size.
 /// </summary>
 public static bool NeedsFixedSizePainted(CustomReportItem item, DesignSize fixedSize, Rectangle bounds, ConversionService conversionService)
 {
     return(IsFixedSizeApplicable(item) && (conversionService.ToDisplayWidth(fixedSize.Width) > bounds.Width || conversionService.ToDisplayHeight(fixedSize.Height) > bounds.Height));
 }
        // Accesses the data saved with the custom report item in the design environment and
        // creates the custom report items image that will be rendered on the report.
        private byte[] DrawImage(CustomReportItem customReportItem)
        {
            int dpi = 96;
            int imageWidth = (int)(customReportItem.Width.ToInches() * dpi);
            int imageHeight = (int)(customReportItem.Height.ToInches() * dpi);

            System.Drawing.Bitmap image = new System.Drawing.Bitmap(imageWidth, imageHeight);
            System.Drawing.Graphics graphics = System.Drawing.Graphics.FromImage(image);
            System.Drawing.Color backgroundColor = customReportItem.Style.BackgroundColor.Value.ToColor();
            if (backgroundColor == System.Drawing.Color.Transparent)
            {
                backgroundColor = System.Drawing.Color.White;
            }

            graphics.Clear(backgroundColor);

            int maxX = (int)LookupCustomProperty(customReportItem.CustomProperties, "poly:MaxX", 100);
            int maxY = (int)LookupCustomProperty(customReportItem.CustomProperties, "poly:MaxY", 100);
            int minX = (int)LookupCustomProperty(customReportItem.CustomProperties, "poly:MinX", 0);
            int minY = (int)LookupCustomProperty(customReportItem.CustomProperties, "poly:MinY", 0);

            float scaleX = imageWidth / (float)(maxX - minX);
            float scaleY = imageHeight / (float)(maxY - minY);

            string proportional = (string)LookupCustomProperty(customReportItem.CustomProperties, "poly:Proportional", bool.FalseString);

            if ((string)proportional == bool.TrueString)
            {
                if (scaleX > scaleY)
                    scaleX = scaleY;
                else
                    scaleY = scaleX;
            }

            string transString = (string)LookupCustomProperty(customReportItem.CustomProperties, "poly:Translucency", "Opaque");
            int translucency = 255;

            switch (transString)
            {
                case "Opaque":
                    translucency = 255;
                    break;

                case "Translucent":
                    translucency = 128;
                    break;

                case "Transparent":
                    translucency = 32;
                    break;
            }

            CustomData customData = customReportItem.CustomData;

            // Iterate over the Shapes
            foreach (DataMember shape in customData.DataRowHierarchy.MemberCollection)
            {
                // Get the Points for drawing the shapes
                List<System.Drawing.Point> points = new List<System.Drawing.Point>();
                System.Drawing.Brush brush = new System.Drawing.SolidBrush(System.Drawing.Color.Black);

                DataDynamicMemberInstance shapeInstance = (DataDynamicMemberInstance)shape.Instance;

                while (shapeInstance.MoveNext())
                {
                    points.Clear();

                    // Get the Color for the Shape
                    string colorname = (string)LookupCustomProperty(shape.CustomProperties, "poly:Color", "Black");
                    ReportColor rptColor = new ReportColor(colorname);
                    System.Drawing.Color color = System.Drawing.Color.FromArgb(translucency, rptColor.ToColor());
                    brush = new System.Drawing.SolidBrush(color);

                    // Get the Hyperlink value if one has been assigned
                    string hyperlink = (string)LookupCustomProperty(shape.CustomProperties, "poly:Hyperlink", "");

                    // Iterate over the Points
                    foreach (DataMember point in shape.Children)
                    {
                        DataDynamicMemberInstance pointInstance = (DataDynamicMemberInstance)point.Instance;

                        while (pointInstance.MoveNext())
                        {
                            for (int i = 0; i < customData.RowCollection.Count; i++)
                            {
                                DataRow row = customData.RowCollection[i];

                                int x = (int)LookupDataValue(row, "X", 0);
                                int y = (int)LookupDataValue(row, "Y", 0);

                                x = (int)((x - minX) * scaleX);
                                y = (int)((y - minY) * scaleY);

                                points.Add(new System.Drawing.Point(x, y));
                            }
                        }
                    }

                    // Create the Hyperlink Actions
                    if (!string.IsNullOrEmpty(hyperlink))
                    {
                        // Build the coordinates for the Hyperlink Actions
                        float[] coordinates = new float[points.Count * 2];
                        for (int i = 0; i < points.Count; i++)
                        {
                            System.Drawing.Point point = points[i];

                            coordinates[i * 2] = (100 * point.X) / imageWidth;
                            coordinates[i * 2 + 1] = (100 * point.Y) / imageHeight;
                        }

                        Image polygonImage = (Image)customReportItem.GeneratedReportItem;
                        ActionInfoWithDynamicImageMap imageMap = polygonImage.ImageInstance.CreateActionInfoWithDynamicImageMap();
                        Action action = imageMap.CreateHyperlinkAction();
                        action.Instance.HyperlinkText = hyperlink;
                        imageMap.CreateImageMapAreaInstance(ImageMapArea.ImageMapAreaShape.Polygon, coordinates);
                    }

                    // Draw the image
                    graphics.FillPolygon(brush, points.ToArray());
                }
            }

            MemoryStream stream = new MemoryStream();
            image.Save(stream, ImageFormat.Bmp);

            byte[] imageData = new byte[(int)stream.Length];
            stream.Seek(0, SeekOrigin.Begin);
            stream.Read(imageData, 0, (int)stream.Length);

            return imageData;
        }
Esempio n. 29
0
 public CustomData(CustomReportItem owner)
 {
     this.m_owner = owner;
 }
 public DataRowCollection(CustomReportItem owner)
 {
     this.m_owner = owner;
 }
Esempio n. 31
0
 internal CustomReportItemHeading(int id, CustomReportItem crItem)
     : base(id, crItem)
 {
     m_runningValues = new RunningValueInfoList();
 }
        private static DeclarationList CreateCurrentDeclarations()
        {
            DeclarationList declarationList = new DeclarationList();
            int             num             = 1;

            declarationList[num++] = IDOwner.GetDeclaration();
            declarationList[num++] = ReportItem.GetDeclaration();
            num++;
            declarationList[num++] = Report.GetDeclaration();
            declarationList[num++] = PageSection.GetDeclaration();
            declarationList[num++] = Line.GetDeclaration();
            declarationList[num++] = Rectangle.GetDeclaration();
            declarationList[num++] = Image.GetDeclaration();
            num++;
            declarationList[num++] = CheckBox.GetDeclaration();
            declarationList[num++] = TextBox.GetDeclaration();
            declarationList[num++] = SubReport.GetDeclaration();
            declarationList[num++] = ActiveXControl.GetDeclaration();
            declarationList[num++] = DataRegion.GetDeclaration();
            num++;
            declarationList[num++] = ReportHierarchyNode.GetDeclaration();
            declarationList[num++] = Grouping.GetDeclaration();
            declarationList[num++] = Sorting.GetDeclaration();
            declarationList[num++] = List.GetDeclaration();
            declarationList[num++] = Pivot.GetDeclaration();
            declarationList[num++] = Matrix.GetDeclaration();
            declarationList[num++] = PivotHeading.GetDeclaration();
            declarationList[num++] = MatrixHeading.GetDeclaration();
            declarationList[num++] = MatrixColumn.GetDeclaration();
            num++;
            declarationList[num++] = MatrixRow.GetDeclaration();
            num++;
            declarationList[num++] = Subtotal.GetDeclaration();
            declarationList[num++] = Table.GetDeclaration();
            declarationList[num++] = TableColumn.GetDeclaration();
            num++;
            declarationList[num++] = TableGroup.GetDeclaration();
            declarationList[num++] = TableRow.GetDeclaration();
            num++;
            declarationList[num++] = OWCChart.GetDeclaration();
            declarationList[num++] = ChartColumn.GetDeclaration();
            num++;
            declarationList[num++] = ReportItemCollection.GetDeclaration();
            declarationList[num++] = ReportItemIndexer.GetDeclaration();
            num++;
            declarationList[num++] = Style.GetDeclaration();
            num++;
            declarationList[num++] = AttributeInfo.GetDeclaration();
            declarationList[num++] = Visibility.GetDeclaration();
            declarationList[num++] = ExpressionInfo.GetDeclaration();
            num++;
            declarationList[num++] = DataAggregateInfo.GetDeclaration();
            num++;
            declarationList[num++] = RunningValueInfo.GetDeclaration();
            num++;
            num++;
            declarationList[num++] = Filter.GetDeclaration();
            num++;
            declarationList[num++] = DataSource.GetDeclaration();
            num++;
            declarationList[num++] = DataSet.GetDeclaration();
            num++;
            declarationList[num++] = ReportQuery.GetDeclaration();
            declarationList[num++] = Field.GetDeclaration();
            num++;
            declarationList[num++] = ParameterValue.GetDeclaration();
            num++;
            num++;
            num++;
            num++;
            declarationList[num++] = ReportSnapshot.GetDeclaration();
            declarationList[num++] = SenderInformation.GetDeclaration();
            declarationList[num++] = InstanceInfo.GetDeclaration();
            declarationList[num++] = ReceiverInformation.GetDeclaration();
            declarationList[num++] = InstanceInfo.GetDeclaration();
            declarationList[num++] = DocumentMapNode.GetDeclaration();
            declarationList[num++] = InfoBase.GetDeclaration();
            declarationList[num++] = OffsetInfo.GetDeclaration();
            declarationList[num++] = InstanceInfo.GetDeclaration();
            declarationList[num++] = ReportItemInstanceInfo.GetDeclaration();
            declarationList[num++] = ReportInstanceInfo.GetDeclaration();
            declarationList[num++] = ReportItemColInstanceInfo.GetDeclaration();
            declarationList[num++] = LineInstanceInfo.GetDeclaration();
            declarationList[num++] = TextBoxInstanceInfo.GetDeclaration();
            declarationList[num++] = RectangleInstanceInfo.GetDeclaration();
            declarationList[num++] = CheckBoxInstanceInfo.GetDeclaration();
            declarationList[num++] = ImageInstanceInfo.GetDeclaration();
            declarationList[num++] = SubReportInstanceInfo.GetDeclaration();
            declarationList[num++] = ActiveXControlInstanceInfo.GetDeclaration();
            declarationList[num++] = ListInstanceInfo.GetDeclaration();
            declarationList[num++] = ListContentInstanceInfo.GetDeclaration();
            declarationList[num++] = MatrixInstanceInfo.GetDeclaration();
            declarationList[num++] = MatrixHeadingInstanceInfo.GetDeclaration();
            declarationList[num++] = MatrixCellInstanceInfo.GetDeclaration();
            declarationList[num++] = TableInstanceInfo.GetDeclaration();
            declarationList[num++] = TableGroupInstanceInfo.GetDeclaration();
            declarationList[num++] = TableRowInstanceInfo.GetDeclaration();
            declarationList[num++] = OWCChartInstanceInfo.GetDeclaration();
            declarationList[num++] = ChartInstanceInfo.GetDeclaration();
            declarationList[num++] = NonComputedUniqueNames.GetDeclaration();
            declarationList[num++] = InstanceInfoOwner.GetDeclaration();
            declarationList[num++] = ReportItemInstance.GetDeclaration();
            num++;
            declarationList[num++] = ReportInstance.GetDeclaration();
            declarationList[num++] = ReportItemColInstance.GetDeclaration();
            declarationList[num++] = LineInstance.GetDeclaration();
            declarationList[num++] = TextBoxInstance.GetDeclaration();
            declarationList[num++] = RectangleInstance.GetDeclaration();
            declarationList[num++] = CheckBoxInstance.GetDeclaration();
            declarationList[num++] = ImageInstance.GetDeclaration();
            declarationList[num++] = SubReportInstance.GetDeclaration();
            declarationList[num++] = ActiveXControlInstance.GetDeclaration();
            declarationList[num++] = ListInstance.GetDeclaration();
            declarationList[num++] = ListContentInstance.GetDeclaration();
            num++;
            declarationList[num++] = MatrixInstance.GetDeclaration();
            declarationList[num++] = MatrixHeadingInstance.GetDeclaration();
            num++;
            declarationList[num++] = MatrixCellInstance.GetDeclaration();
            num++;
            num++;
            declarationList[num++] = TableInstance.GetDeclaration();
            declarationList[num++] = TableRowInstance.GetDeclaration();
            declarationList[num++] = TableColumnInstance.GetDeclaration();
            declarationList[num++] = TableGroupInstance.GetDeclaration();
            num++;
            declarationList[num++] = OWCChartInstance.GetDeclaration();
            declarationList[num++] = ParameterInfo.GetDeclaration();
            num++;
            num++;
            num++;
            declarationList[num++] = InstanceInfo.GetDeclaration();
            num++;
            declarationList[num++] = RecordSetInfo.GetDeclaration();
            declarationList[num++] = RecordRow.GetDeclaration();
            declarationList[num++] = RecordField.GetDeclaration();
            declarationList[num++] = ValidValue.GetDeclaration();
            num++;
            declarationList[num++] = ParameterDataSource.GetDeclaration();
            declarationList[num++] = ParameterDef.GetDeclaration();
            num++;
            declarationList[num++] = ParameterBase.GetDeclaration();
            num++;
            declarationList[num++] = ProcessingMessage.GetDeclaration();
            declarationList[num++] = MatrixSubtotalHeadingInstanceInfo.GetDeclaration();
            declarationList[num++] = MatrixSubtotalCellInstance.GetDeclaration();
            declarationList[num++] = CodeClass.GetDeclaration();
            num++;
            declarationList[num++] = TableDetail.GetDeclaration();
            declarationList[num++] = TableDetailInstance.GetDeclaration();
            num++;
            declarationList[num++] = TableDetailInstanceInfo.GetDeclaration();
            num++;
            declarationList[num++] = Action.GetDeclaration();
            declarationList[num++] = ActionInstance.GetDeclaration();
            declarationList[num++] = Chart.GetDeclaration();
            declarationList[num++] = ChartHeading.GetDeclaration();
            declarationList[num++] = ChartDataPoint.GetDeclaration();
            num++;
            declarationList[num++] = MultiChart.GetDeclaration();
            declarationList[num++] = MultiChartInstance.GetDeclaration();
            num++;
            declarationList[num++] = Axis.GetDeclaration();
            declarationList[num++] = AxisInstance.GetDeclaration();
            declarationList[num++] = ChartTitle.GetDeclaration();
            declarationList[num++] = ChartTitleInstance.GetDeclaration();
            declarationList[num++] = ThreeDProperties.GetDeclaration();
            declarationList[num++] = PlotArea.GetDeclaration();
            declarationList[num++] = Legend.GetDeclaration();
            declarationList[num++] = GridLines.GetDeclaration();
            declarationList[num++] = ChartDataLabel.GetDeclaration();
            declarationList[num++] = ChartInstance.GetDeclaration();
            declarationList[num++] = ChartHeadingInstance.GetDeclaration();
            declarationList[num++] = ChartHeadingInstanceInfo.GetDeclaration();
            num++;
            declarationList[num++] = ChartDataPointInstance.GetDeclaration();
            declarationList[num++] = ChartDataPointInstanceInfo.GetDeclaration();
            num++;
            num++;
            declarationList[num++] = RenderingPagesRanges.GetDeclaration();
            num++;
            declarationList[num++] = IntermediateFormatVersion.GetDeclaration();
            declarationList[num++] = ImageInfo.GetDeclaration();
            declarationList[num++] = ActionItem.GetDeclaration();
            declarationList[num++] = ActionItemInstance.GetDeclaration();
            num++;
            num++;
            declarationList[num++] = DataValue.GetDeclaration();
            declarationList[num++] = DataValueInstance.GetDeclaration();
            num++;
            num++;
            declarationList[num++] = Tablix.GetDeclaration();
            declarationList[num++] = TablixHeading.GetDeclaration();
            declarationList[num++] = CustomReportItem.GetDeclaration();
            declarationList[num++] = CustomReportItemInstance.GetDeclaration();
            declarationList[num++] = CustomReportItemHeading.GetDeclaration();
            declarationList[num++] = CustomReportItemHeadingInstance.GetDeclaration();
            num++;
            num++;
            num++;
            num++;
            declarationList[num++] = CustomReportItemCellInstance.GetDeclaration();
            num++;
            num++;
            declarationList[num++] = DataValueCRIList.GetDeclaration();
            declarationList[num++] = BookmarkInformation.GetDeclaration();
            declarationList[num++] = InstanceInfo.GetDeclaration();
            declarationList[num++] = DrillthroughInformation.GetDeclaration();
            declarationList[num++] = InstanceInfo.GetDeclaration();
            num++;
            declarationList[num++] = CustomReportItemInstanceInfo.GetDeclaration();
            declarationList[num++] = ImageMapAreaInstanceList.GetDeclaration();
            declarationList[num++] = ImageMapAreaInstance.GetDeclaration();
            num++;
            declarationList[num++] = InstanceInfo.GetDeclaration();
            declarationList[num++] = SortFilterEventInfo.GetDeclaration();
            declarationList[num++] = EndUserSort.GetDeclaration();
            num++;
            num++;
            declarationList[num++] = RecordSetPropertyNames.GetDeclaration();
            num++;
            num++;
            num++;
            declarationList[num++] = PageSectionInstance.GetDeclaration();
            num++;
            declarationList[num++] = PageSectionInstanceInfo.GetDeclaration();
            declarationList[num++] = SimpleTextBoxInstanceInfo.GetDeclaration();
            declarationList[num++] = ScopeLookupTable.GetDeclaration();
            num++;
            declarationList[num++] = ReportDrillthroughInfo.GetDeclaration();
            declarationList[num++] = InstanceInfo.GetDeclaration();
            Global.Tracer.Assert(declarationList.Count == num, "(current.Count == index)");
            return(declarationList);
        }
Esempio n. 33
0
 internal DataMemberCollection(IDefinitionPath parentDefinitionPath, CustomReportItem owner)
     : base(parentDefinitionPath, (ReportItem)owner)
 {
 }
 public CustomReportItemInstanceInfo(ReportProcessing.ProcessingContext pc, CustomReportItem reportItemDef, CustomReportItemInstance owner)
     : base(pc, reportItemDef, owner, true)
 {
 }
 public CustomReportItemInstanceInfo(CustomReportItem reportItemDef)
     : base(reportItemDef)
 {
 }