public void CreateClickAreas(IBrickGraphics graph)            //Added this function at 2008-11-11 14:50:04@Simon
        {
            if (this._ClickAreas == null || this._ClickAreas.Count <= 0)
            {
                return;
            }

            int clickcount = this._ClickAreas.Count;

            if (clickcount > this.PrintingTable.GetColumns() - 1)
            {
                return;
            }

            for (int col = 0; col < clickcount; col++)
            {
                WebbTableCell m_cell = PrintingTable.GetCell(0, col + 1) as WebbTableCell;

                RectangleF rectF = (RectangleF)this._ClickAreas[col];

                if (rectF == RectangleF.Empty || rectF.Width * rectF.Height <= 0)
                {
                    continue;
                }

                TextBrick m_brick = m_cell.CreateTextBrick();

                if (m_cell.ClickEventArg != null)
                {
                    m_brick.MouseDown += new MouseEventHandler(Webb.Reports.DataProvider.VideoPlayBackManager.OnBrickDown);
                    m_brick.MouseUp   += new MouseEventHandler(Webb.Reports.DataProvider.VideoPlayBackManager.OnBrickUp);
                    m_brick.OnClick   += new EventHandler(m_cell.ClickHandler);
                    m_brick.Url        = "http://www.webbelectronics.com/";

                    rectF.Offset(PrintingTable.Offset.Width, PrintingTable.Offset.Height);
                    graph.DrawBrick(m_brick, rectF);
                }
            }
        }
Exemple #2
0
        private bool CreateMatrixPrintingTable()
        {
            if (MatrixInfo == null || !_HaveData || this.RootGroupInfo == null)
            {
                this.PrintingTable = null;
                return(false);
            }

            int m_Rows = MatrixInfo.GetMatrixGroupedRows(this);

            if (this.TableHeaders != null && this.TableHeaders.RowCount > 0 && this.TableHeaders.ColCount > 0) //2008-8-29 9:12:31@simon
            {
                m_Rows += this.TableHeaders.RowCount;                                                          //2008-8-29 9:12:37@simon
            }

            int m_Column = MatrixInfo.GetMatrixGroupedColumns(this.ShowRowIndicators);

            if (m_Rows <= 0 || m_Column <= 0)
            {
                this.PrintingTable = null;
                return(false);
            }

            System.Diagnostics.Debug.WriteLine(string.Format("Begin Create print table:{0}X{1}", m_Rows, m_Column));

            this.PrintingTable = new WebbTable(m_Rows, m_Column);

            MatrixInfo.SetMatrixColumnWidthAtFirst(this.PrintingTable, this.ShowRowIndicators);

            //Set value
            this.HeaderRows.Clear();
            this.SectionRows.Clear();
            this.TotalRows.Clear();
            this.BreakRows.Clear();
            this.ColumnStyleRows.Clear();

            this.SetTableValue();

            StyleBuilder.StyleRowsInfo m_StyleInfo = new Styles.StyleBuilder.StyleRowsInfo(this._HeaderRows, this._SectionRows, this._TotalRows, this.ShowRowIndicators, this.HaveHeader);
            Int32Collection            ignoreRows  = this.HeaderRows.Combine(this.HeaderRows, this.SectionRows, this.TotalRows);
            StyleBuilder styleBuilder = new StyleBuilder();


            #region Modify codes at 2008-11-4 15:45:04@Simon

            styleBuilder.BuildMatrixGroupStyle(this.PrintingTable, m_StyleInfo, this.MatrixInfo, this.Styles, ignoreRows);

            if (this.TableHeaders != null && this.TableHeaders.RowCount > 0 && this.TableHeaders.ColCount > 0)                    //Added this code at 2008-11-6 10:22:40@Simon
            {
                int minh         = 0;
                int i_Titleindex = 0;
                if (this.HeaderRows.Count > 0)
                {
                    foreach (int tl in this.HeaderRows)
                    {
                        if (i_Titleindex < tl)
                        {
                            i_Titleindex = tl;
                        }
                    }
                }
                if (i_Titleindex > minh)
                {
                    foreach (int col in this.TableHeaders.ColsToMerge)
                    {
                        IWebbTableCell Mergedcell = PrintingTable.GetCell(i_Titleindex, col);
                        this.PrintingTable.MergeCells(minh, i_Titleindex, col, col);
                        IWebbTableCell bordercell = PrintingTable.GetCell(minh, col);
                        if (this.HaveHeader)
                        {
                            bordercell.Text = Mergedcell.Text;
                            bordercell.CellStyle.StringFormat = Mergedcell.CellStyle.StringFormat;
                            if ((bordercell.CellStyle.StringFormat & StringFormatFlags.DirectionVertical) != 0)
                            {
                                bordercell.CellStyle.HorzAlignment = HorzAlignment.Far;
                                bordercell.CellStyle.VertAlignment = VertAlignment.Center;
                            }
                        }
                    }
                }
            }

            if (this.TableHeaders != null)
            {
                this.TableHeaders.SetHeadGridLine(this.PrintingTable, this.HeaderRows);
            }

            #endregion                                    //End Modify

            this.ApplyColumnWidthStyle(m_Column);
            this.ApplyRowHeightStyle(m_Rows);

            switch (this.CellSizeAutoAdapting)
            {
            case CellSizeAutoAdaptingTypes.NotUse:
                break;

            case CellSizeAutoAdaptingTypes.WordWrap:
                this.PrintingTable.AutoAdjustMatrixSize(this.ExControl.CreateGraphics(), true, false, this.MatrixInfo, this.ShowRowIndicators);
                break;

            case CellSizeAutoAdaptingTypes.OneLine:
                this.PrintingTable.AutoAdjustMatrixSize(this.ExControl.CreateGraphics(), false, false, this.MatrixInfo, this.ShowRowIndicators);
                break;
            }


            System.Diagnostics.Debug.WriteLine("Create print table completely");

            return(true);
        }
Exemple #3
0
        private void AdjustHeaderStyle()
        {
            if (this.HeaderRows.Count <= 0 || this.HeadersData == null)
            {
                return;
            }

            HeaderRows.Sort();

            this.HeadersData.SetHeadGridLine(this.PrintingTable, this.HeaderRows);

            int MinHeaderRow = HeaderRows[0];

            int MaxHeaderRow = HeaderRows[HeaderRows.Count - 1];

            #region UpdateHeadeStyle

            for (int row = MinHeaderRow; row <= MaxHeaderRow; row++)
            {
                int TableHeaderRow = row - MinHeaderRow;

                if (TableHeaderRow >= this.HeadersData.RowCount)
                {
                    break;
                }

                for (int col = 0; col < this.HeadersData.ColCount; col++)
                {
                    HeaderCell headerCell = this.HeadersData.GetCell(TableHeaderRow, col);

                    IWebbTableCell cell = PrintingTable.GetCell(row, col);

                    if (headerCell == null || cell == null)
                    {
                        continue;
                    }

                    if (headerCell.NeedChangeStyle)
                    {
                        cell.CellStyle = headerCell.CellStyle.Copy();
                    }
                }
            }

            #endregion

            #region Cols In Merge

            foreach (int col in this.HeadersData.ColsToMerge)
            {
                IWebbTableCell Mergedcell = PrintingTable.GetCell(MaxHeaderRow, col);

                this.PrintingTable.MergeCells(MinHeaderRow, MaxHeaderRow, col, col);

                IWebbTableCell bordercell = PrintingTable.GetCell(MinHeaderRow, col);

                if (this.HaveHeader)
                {
                    bordercell.Text = Mergedcell.Text;

                    bordercell.CellStyle.StringFormat = Mergedcell.CellStyle.StringFormat;
                }

                if ((bordercell.CellStyle.StringFormat & StringFormatFlags.DirectionVertical) != 0)
                {
                    bordercell.CellStyle.HorzAlignment = HorzAlignment.Far;
                    bordercell.CellStyle.VertAlignment = VertAlignment.Center;
                }
                else
                {
                    bordercell.CellStyle.HorzAlignment = HorzAlignment.Center;
                    bordercell.CellStyle.VertAlignment = VertAlignment.Center;
                }
            }
            #endregion
        }