Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/237.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# ActiveReports 7-如何使用子报表格式化多个列上的数据_C#_Format_Multiple Columns_Subreport_Activereports - Fatal编程技术网

C# ActiveReports 7-如何使用子报表格式化多个列上的数据

C# ActiveReports 7-如何使用子报表格式化多个列上的数据,c#,format,multiple-columns,subreport,activereports,C#,Format,Multiple Columns,Subreport,Activereports,我的问题与此类似 不同之处在于我使用的是ActiveReports 7而不是Crystal Report,并且我在同一页面上使用了多个子报表 [编辑]:我找到了 在我的子报表的事件“detail_Format”中,我使用下面的代码来计算每列有多少行 private int count = 0; public void Detail_Format() { int maxElement = (result.Count() / this.detail.ColumnCount); if (c

我的问题与此类似

不同之处在于我使用的是ActiveReports 7而不是Crystal Report,并且我在同一页面上使用了多个子报表

[编辑]:我找到了

在我的子报表的事件“detail_Format”中,我使用下面的代码来计算每列有多少行

private int count = 0;
public void Detail_Format()
{
int maxElement = (result.Count() / this.detail.ColumnCount);

    if (count == maxElement)
    {
      this.detail.NewColumn = NewColumn.After;
      count = 0;
    }
    else
    {
      this.detail.NewColumn = NewColumn.None;
      count++;
    }    
}

您可以使用“脚本”选项卡中的以下代码段在每十条记录后添加分页符:

int i = 0;
public void Detail_Format()
{
    i = i + 1;
    if(i > 9)
      {
         this.Detail.NewPage = GrapeCity.ActiveReports.SectionReportModel.NewPage.After;
         i = 0;
          }
    else
      {
         this.Detail.NewPage = GrapeCity.ActiveReports.SectionReportModel.NewPage.None;
          }
}
问候,,
Mohita

将数据拆分为列时出现问题。在每个新页面上,第一行数据不会拆分为列。。。我不明白为什么?

每次记录的数量都会根据我输入的数据而变化。所以在我的例子中,我需要切换列,而不是硬编码记录。不管怎么说,你的答案是我昨天找到它之前一直在寻找的一部分。无论如何谢谢你!