StiReport1.Load("mrt/frmOReport.mrt")
Dim checked_rb As String = ""
If rbCargo.Checked = True Then
checked_rb = "Cargo"
ElseIf rbCompany.Checked = True Then
checked_rb = "Company"
ElseIf rbMojavez_Date.Checked = True Then
checked_rb = "Mojavez_Date"
ElseIf rbDriverName.Checked = True Then
checked_rb = "DriverName"
End If
Dim ghb1 As StiGroupHeaderBand = CType(StiReport1.Pages(0).Components.Item("GroupHe aderBand1"), StiGroupHeaderBand)
Dim cond As New StiCondition
Dim expr As New StiExpression
expr.Value = "{OxinReport." & checked_rb & "}"
cond.Expression = expr
ghb1.Condition.Value = expr.Value
Dim txt_Group As StiText = CType(ghb1.Components.Item("txt_Group"), StiText)
txt_Group.Text = expr.Value
Dim lbl_Group As StiText = CType(ghb1.Components.Item("lbl_Group"), StiText)
lbl_Group.Text = DirectCast(FindControl("rb" + checked_rb, Me), RadioButton).Text
StiReport1.RegData("OxinReport", tbl)
StiReport1.ScriptUpdate()
StiReport1.Compile()
StiReport1.Show()
روی فرم تعدادی دکمه رادیویی هست که با انتخاب اونها گزارش بسته به مورد انتخابی گروه بندی میشه . البته راه بهتری هم هست که کدنویسی کمی کمتر بشه .