开发者

how to set grouping in crystal reports using vb.net programatically?

I want to grouping fields in crystal reports programatically using vb.net for dynamic reports generation.

I am using vb.net 2005. i am trying to set report groupings of a crystal report at runtime based on user defined options. MSDN says this:

Dim FieldDef As FieldDefinition FieldDef = Report.Database.Tables.Item(0).Fields.Item(comboBox1().Text) Report.D开发者_C百科ataDefinition.Groups.Item(0).ConditionField = FieldDef

but error shows invalid group number

how to solve this?


You can create a new formula field in the report (i.e "GroupSortField") and set the group field programmatically in your code:

rpt.DataDefinition.FormulaFields["GroupSortField"].Text = "{MyTable.MyField}";
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜