用公式字段.
recordNumber
groupNumber
定义一个变量一直加一,
判断组号是否相同组号不同时就置零.
跟求当前页合计的公式差不多.
在公式中用:
例子:
numbervar pg
currencyvar sl
if pg<>pagenumber then sl:=0
pg:=pagenumber
sl:=sl+字段名

解决方案 »

  1.   

    经典水晶报表设计三则之“单击表头排序表格”
      
      1. 新建一个字符串类型的参数字段,名称为 URL,用于传递 ASP.NET 程序的网址和网址的部分参数。比如:"http://www.nt.cn/cr.aspx?sort_field="。
      
      2. 右击作为表头的文本字段,选择"设置文本格式",进入"格式化编辑器"对话框。
      
      3. 选择"超级链接"选项卡,并设置超级链接类型为"Internet 上的网址"。
      
      4. 单击超级链接信息的网站地址后面的公式的钮,输入公式 {?URL} + "name"。
      
      5. 这样表头就变成了超级链接,而且指向 http://www.nt.cn/cr.aspx?sort_field=name。
      
      6. ASP.NET 程序在 Page_Load 事件里读取要排序的字段 sort_field,然后对水晶报表进行排序。
      

  2.   

    水晶报表排序编程实例  Dim crReportDocument As ReportDocument  Public Sub changeSortField(mySortFld As String, mySortDir As String)  Dim crSortField As SortField  Dim crSortDirection As SortDirection  Dim crDatabaseFieldDefinition As DatabaseFieldDefinition  For Each crSortField In crReportDocument.DataDefinition.SortFields  If crSortField.Field.Name.ToString = mySortFld Then  crDatabaseFieldDefinition = crReportDocument.Database.Tables(0).Fields(mySortFld.ToString)  crSortField = crReportDocument.DataDefinition.SortFields(0)  crSortField.Field = crDatabaseFieldDefinition  If mySortDir = "Ascending" Then  crSortField.SortDirection = SortDirection.AscendingOrder  Else  crSortField.SortDirection = SortDirection.DescendingOrder  End If  End If  Next  CrystalReportViewer1.ReportSource = crReportDocument  End Sub 
      

  3.   

    有没有直接能在水晶报表上实现的呢。因为我现在用的水晶是要放到已开发了的asp页面里。recordNumber与记录号一样,没有办法实现,分组后每组从0开始。请高手们帮帮忙!