Web Development

General discussion


Parameters to Crystal Report - VB/VB.Net

By saravanakumar77 ·
Dbase-access/oracle, frontend-vb6/vb.net
based on certain value in a textbox/maskedit, i am scruitnizing records using a query.
example: select salary from emp where salary value from txtbox].
i have to export these records to a crystal report.
suggest me, if possible with example

This conversation is currently closed to new comments.

Thread display: Collapse - | Expand +

All Comments

Collapse -

by akkmuthu In reply to Parameters to Crystal Rep ...

Dear saravanan,

In Vb.Net add Crystal Report
after that
From filed explorer choose database fields
1.Select Add/Remove database
2.Choose OlEDB and make Corresponing connection.
3.Choose table
4.choose Required Fieds and others details
5.Click Finsh.
6.Right Click Parameter Fields
add new parameter and with same dataType of salary
7.right click salary field in crystal report and choose select Expert and Select Greatethan from ComboBox and give {?intSalaray} like this here int salaray is param name.
Then write coding in Form like below

First create add database connection to crytal report and

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim CRYRpt As New CrystalReport2()
If TextBox1.Text <> "" Then
Dim ParameterFields As CrystalDecisions.Shared.ParameterFields
Dim ParameterField As CrystalDecisions.Shared.ParameterField
Dim ParameterRangeValue As CrystalDecisions.Shared.ParameterDiscreteValue 'ParameterRangeValue
ParameterFields = New CrystalDecisions.Shared.ParameterFields()
ParameterField = New CrystalDecisions.Shared.ParameterField()
ParameterField.ParameterFieldName = "intSalaray"
ParameterRangeValue = New CrystalDecisions.Shared.ParameterDiscreteValue() 'ParameterRangeValue()
ParameterRangeValue.Value = TextBox1.Text
CrystalReportViewer1.ParameterFieldInfo = ParameterFields
CrystalReportViewer1.ReportSource = CRYRpt 'AppPath & "CrystalReport1.rpt"
End If
End Sub

ok all the best
With regards

Related Discussions

Related Forums