C# 如何在Stimulsoft中以编程方式创建表?

C# 如何在Stimulsoft中以编程方式创建表?,c#,.net,reporting,stimulsoft,C#,.net,Reporting,Stimulsoft,我试图在将图像添加到报告页面后添加一个表。我尝试了下面的代码,但它引发了一个异常:无效令牌“;”在类、结构或接口成员声明中 应至少创建一个可缝合单元格。可缝合部件是一个非常复杂的部件。若要了解如何在代码中创建报表,请尝试在Designer中使用Table Band创建报表,并查看“代码”选项卡 stiReport1.Pages[0].Components.Clear(); StiImage image = new StiImage(); image

我试图在将图像添加到报告页面后添加一个表。我尝试了下面的代码,但它引发了一个异常:无效令牌“;”在类、结构或接口成员声明中


应至少创建一个可缝合单元格。可缝合部件是一个非常复杂的部件。若要了解如何在代码中创建报表,请尝试在Designer中使用Table Band创建报表,并查看“代码”选项卡

        stiReport1.Pages[0].Components.Clear();
        StiImage image = new StiImage();
        image.Left = 0;
        image.Top = 0;
        image.Width = 7;
        image.Height = 4;
        image.Stretch = true;
        //An image name should be unique in your report
        image.Name = "MyUniqueName";

        //Assign an image
        image.Image = bmp;

        //Add a component with an image with a report
        stiReport1.Pages[0].Components.Add(image);

        //Create Table
        StiTable table = new StiTable();
        table.Name = "MyUniqueName2";
        table.AutoWidth = StiTableAutoWidth.Table;
        table.AutoWidthType = StiTableAutoWidthType.FullTable;
        table.ColumnCount = 2;
        table.RowCount = 3;
        table.HeaderRowsCount = 1;
        table.FooterRowsCount = 0;
        table.Width = stiReport1.Pages[0].Width;
        table.Height = stiReport1.Pages[0].GridSize;
        //Set text on header
        StiTableCell headerCell = new StiTableCell();
        headerCell.Text.Value = "ddd";
        headerCell.ID = 0;
      //  headerCell.Border = new StiBorder(StiBorderSides.All, Color.FromArgb(0, 0, 0), 0, StiPenStyle.Solid);
        headerCell.HorAlignment = StiTextHorAlignment.Center;
        headerCell.VertAlignment = StiVertAlignment.Center;
        headerCell.WordWrap = true;
        headerCell.Font = new System.Drawing.Font("B Nazanin", 7F, System.Drawing.FontStyle.Bold);
        headerCell.Height = 3;
        table.TableStyle = StiTableStyle.Style32;

        table.Components.Clear();
        table.Components.Add(headerCell);
         stiReport1.Pages[0].Components.Add(table);
        //
        stiReport1.Compile();
        stiReport1.Render();
        stiReport1.Show();