dxSpreadSheet的报表demo-关于设计报表模板问题

学习 dxSpreadSheetReportDesigner过程中发现:

 dxSpreadSheet通过dxSpreadSheetReportDesigner点击右键出现弹出菜单,自动生成如图的菜单和actions,不用写一句代码。对于懒人来说酷毙了。

但是Master-Detail和GroupHead以及GroupFooter的section来说,它是从1生成的数据section。导致分组和主从表就会出现错误。看demo代码section都是从0开始的。数据呈现也没有问题,但是用自己的自动生成的action执行,就是乱表格数据。

处理方法:

1、找到单元:dxSpreadSheetReportDesignerActions

2、找到方法:TdxSpreadSheetReportDesignerAction.GetMaxSectionID

3、修改代码:Result := 0 改成 Resul := -1;

4、ok了

function TdxSpreadSheetReportDesignerAction.GetMaxSectionID(
  ASectionType: TdxSpreadSheetReportSectionType): Integer;
var
  I: Integer;
begin
  Result := -1;   //0
  for I := 0 to Designer.SectionList.Count - 1 do
    if Designer.SectionList[I].SectionType = ASectionType then
      Result := Max(Result, TdxSpreadSheetReportSectionAccess(Designer.SectionList[I]).Index);
end;

版本:18.1.6

goodluck

https://www.cnblogs.com/usegear/p/15505219.html

原文地址:https://www.cnblogs.com/usegear/p/15505219.html