有两种方法,方法一,可以参考帮助文档:http://www.sanmugrid.com/help/index.htm?page=00947%E4%BB%A3%E7%A0%81%E6%8E%A7%E5%88%B6%E4%BB%8B%E7%BB%8D.htm
方法二:自己写打开数据透视表的按钮,然后就可以自定义了。
- Dim tb As BaseGrid = Proj.CurrentGrid
-
- If tb Is Nothing OrElse tb.DataTableHelp Is Nothing Then
- Return
- End If
-
- Dim dtSource As DataTable = Nothing
- Dim dataRule As IDataRuleGrid = TryCast(tb, IDataRuleGrid)
-
- If dataRule IsNot Nothing Then
- Dim lst As List(Of String) = dataRule.GetCanVisibleColsList()
- dtSource = tb.DataTableHelp.DataTable.DefaultView.ToTable(False, lst.ToArray())
- dtSource.ExtendedProperties.Clear()
- Else
- dtSource = tb.DataTableHelp.DataTable.Copy()
- dtSource.ExtendedProperties.Clear()
- End If
-
- Dim frm As PivotSetting = New PivotSetting(tb.TableID, dtSource)
- frm.Owner = Proj.MainForm
- '关闭透视表设置信息
- frm.CloseSettingGrid()
- frm.PivotPage.CloseSettingPanel()
- frm.Show()
复制代码
|