Yazı

Devexpress XtraReports XRTable Veri Doldurma Kodu

 09. Oca 2021  Devexpress  (0)

 private XRTable CreateXRTableDetail(DataTable dtAra)
        {
            XRTable table = new XRTable();
            table.BeginInit();

            table.LocationFloat = new DevExpress.Utils.PointFloat(0, 5F);
            table.Borders = BorderSide.All;

            int tableHeight = 0;
            int tableWidth = 0;

            for (int i = -1; i < 4; i++)
            {
                XRTableRow row = new XRTableRow();
                for (int j = 0; j < dtAra.Columns.Count; j++)
                {
                    XRTableCell cell = new XRTableCell();
                    cell.Padding = 1;

                    int width = 40;
                    cell.SizeF = new SizeF(cell.SizeF.Width + width, cell.SizeF.Height);
                    cell.Width = (int)width;
                    cell.Weight = 1;
                    cell.TextAlignment = TextAlignment.MiddleCenter;
                    tableWidth += cell.Width;

                    if (i == -1)//Header
                    {
                        row.Height = 15;
                        cell.Text = dtAra.Columns[j].ColumnName ;
                        cell.BackColor = Color.Gainsboro;
                        cell.Font = new Font("tahoma", 6);
                    }
                    else
                    {
                        row.Height = 40;
                        cell.Text = dtAra.Rows[i][j].ToString();
                        cell.Font = new Font("tahoma", 5);
                    }
                    row.Cells.Add(cell);
                }

                tableHeight += row.Height;
                table.Rows.Add(row);
            }

            tableWidth = tableWidth / table.Rows.Count;
            table.Size = new Size(tableWidth, tableHeight);
            table.EndInit();

            return table;
        }

 

 Etiketler:
 Bu içeriği değerlendirin
 Paylaş:

 İlişkili yazılar


Devexpress XtraReport XRBinding Kullanımı
Devexpress XtraReport XRBinding Kullanımı hakkında bilgi


Devexpress XtraGrid Entity Framework Master Detail Data
Devexpress XtraGrid Entity Framework Master Detail verileri listelemek.

Devexpress Gridview AllowOnlyOneMasterRowExpanded ne işe yarar.
Devexpress Gridview AllowOnlyOneMasterRowExpanded ne işe yarar.

Yorumlar (0)