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,然后对水晶报表进行排序。7. 水晶报表排序编程实例 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 或者看看这个: http://www.csdn.net/develop/MY_article.asp?author=haibodotnet
请问楼主是什么版本的?
应该没有问题啊
在交叉表专家里(偶的是交叉表),行选择order(也就是id),然后在组选项中选择“自定义组名称字段”选择name就行了我用的是vs.net2003自带的水晶,应该是9.1
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
或者看看这个:
http://www.csdn.net/develop/MY_article.asp?author=haibodotnet
在字段点右键选择格式化,在公用标签下把可以扩大选上就可以了
我的“可以扩大”选项怎么是虚的,不能点
这个方法,所以纵行的字段定义时是数字型,但执行显示时是字符型的,横行是字符行的
“按原始顺序”----大概是这么写的
可是偶的:“可以扩大”选项怎么是虚的,不能选中