Current filter:
                                You should refresh the page.
                                  • Hi.
                                    How can I print KPI graphic ?
                                    See the attached kpi.png, I ́m using [Preço Venda] - [Valor Venda NF] "expression editor" and I cannot change this expression or it will not match the result (see my code below). But when I print it the graphic doesn ́t appear, I think that I will need change the column value to (1, -1 or 0) in printing preview runtime, but how can I do it ?
                                    Attached is a small sample too, but in this case it ́s not working any graphic.
                                            private void pivotGridControl_CustomDrawCell(object sender, PivotCustomDrawCellEventArgs e)
                                            {
                                                if (e.DataField.UnboundType == UnboundColumnType.Object)
                                                {
                                                    Bitmap bitmap = null;
                                                    int valorIndicador = 0;
                                                    // Seta valor indicador
                                                    if (Convert.ToInt32(e.Value) < 0)
                                                        valorIndicador = -1;
                                                    if (Convert.ToInt32(e.Value) > 0)
                                                        valorIndicador = 1;
                                                    bitmap = pivotGridControl.GetKPIBitmap(e.DataField.KPIGraphic, valorIndicador);
                                                    e.Graphics.FillRectangle(new SolidBrush(e.Appearance.BackColor), e.Bounds);
                                                    e.Graphics.DrawImage(bitmap,
                                                                         e.Bounds.Left + (e.Bounds.Width - bitmap.Width) / 2,
                                                                         e.Bounds.Top + (e.Bounds.Height - bitmap.Height) / 2);
                                                    e.Handled = true;
                                                }
                                            }
                                    Thanks.
                                    Wilton

                                • Stan (DevExpress Support) 05.26.2010

                                  Hi Wilton,
                                  Thank you for the question. I'm afraid that there is no easy way to achieve this goal because the content drawn using the CustomDraw~ events cannot be processed by the printing system. However, I should say that the XtraPivotGrid supports OLAP KPI natively and it is not necessary to manually draw icons. Please review the OLAPKPI module included into the PivotGridMainDemo that demonstrated this functionality. With this approach the XtraPivotGrid can be printed including KPI graphics.
                                  Please try this solution and inform us of your results.
                                  Thanks,
                                  Stan.

                                • Constant (DevExpress Support) 05.28.2010

                                  Hello Wilton,
                                  Sorry, we have not been able to find an immediate answer or resolution. Please bear with us. We will inform you as soon as an answer has been found.
                                  Thanks,
                                  Constant

                                1 Solution

                                Creation Date Importance Sort by

                                Hello Wilton,
                                You can achieve your goal via the PivotGridControl.CustomExportCell event. This event provides a CustomPrintEventArgs.Brick property, that allows you to customize the content of the exported cell. Please note that you should specify a PictureEdit control as an Inplace Editor to export image within the cell.
                                I've modified the sample project to illustrate this approach. You can find it in the attachment.
                                BTW: I've found a bug in the PivotGridControl.CustomDrawCell event. Here is a corresponding issue in our Support Center.
                                The PivotGridControl.CustomDrawCell event works incorrectly after showing a preview
                                Thanks,
                                Constant

                                • Constant (DevExpress Support) 06.01.2010

                                  Hello Wilton,
                                  Thank you for sending the code snippets to me. I've reviewed them and determined that most probably the cause of your problem is that the PivotGridFieldBase.FieldName property of the "Indicator" field isn't specified.
                                  I've modified the sample project to illustrate that the code snippet you provided works correctly. You can find it in the attachment.
                                  Thanks,
                                  Constant