|
-
Dec 9th, 2003, 06:07 AM
#1
Thread Starter
New Member
Can I unshow the window of "Enter Parameter Value" when run [urgent]
I'm newbie in VB.NET.
I create report using crystal report and passing value from VB.NET to parameter in crystal report.
When I run & view the report, the value is show in parameter crystal report, but for the second and so on ..
dialog window "Enter Parameter Values" is show and I have to always input the discrete value.
How can it happened?
Here is the part of my program in VB.NET to run the report :
Private Sub btnHal2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnHal2.Click
paramFields = New CrystalDecisions.Shared.ParameterFields()
crvD205.ParameterFieldInfo = paramFields
PassingValue2Parameter("Nomor Hak", "Rinoy Noer")
PassingValue2Parameter("NIB", "23434343")
' Set the parameter fields collection into the viewer control.
crvD205.ParameterFieldInfo = paramFields
crvD205.ReportSource = Application.StartupPath & "\..\report\D205Hal2.rpt"
crvD205.Zoom(1)
End Sub
Private Sub PassingValue2Parameter(ByVal sParam As String, ByVal sValue As String)
Dim paramField As New CrystalDecisions.Shared.ParameterField()
Dim discreteVal As New CrystalDecisions.Shared.ParameterDiscreteValue()
paramField = New CrystalDecisions.Shared.ParameterField()
discreteVal = New CrystalDecisions.Shared.ParameterDiscreteValue()
paramField.ParameterFieldName = sParam
discreteVal.Value = sValue
paramField.CurrentValues.Add(discreteVal)
paramFields.Add(paramField)
End Sub
Please tell me what is wrong with my program. I 'm very need the suggestion as soon as possible.
Thank you for your help.
__________________
Regards,
Riny
-
Dec 9th, 2003, 08:24 AM
#2
Fanatic Member
Make sure your prompting text in the report for the parameter is empty.
-
Dec 9th, 2003, 06:13 PM
#3
Frenzied Member
That's the way it is. If you use parameter field you have to reenter it anytime you do a refresh or something to your report. So you may apply the parameter again in those events. The better way is to go with Formula Fields instead.
'Heading for the automatic overload'
Marillion, Brave, The Great Escape, 1994
'How will WE stand the FIRE TOMORROW?'
Eloy, Silent Cries and Mighty Echoes, The Vision - Burning, 1979
-
Dec 9th, 2003, 09:21 PM
#4
Thread Starter
New Member
Could you expalin for detail? I still wondering what is the different of parameter & formula and the detail sample about using them.
I try to empty the prompting text in the report for the parameter by using :
paramFields = New CrystalDecisions.Shared.ParameterFields()
crvD205.ParameterFieldInfo = paramFields
Is it true for this case? Or i have to sign the empty value for each parameter?
I create this report because the report is very complex. Here the form of report :
--------------------------
Letter of persil owner
Number of parcel : xxx To : <owner1>
Number of owner : xxx <owner2>
GS/SU : xxx/xxxx etc .. this can be more depends on number of owner in database.
Parcel number : <xxx1>
<xxx2> ... etc depends on number of parcel
Booking date : xx/xx/xxxx
Sign Date : xx/xx/xxxx
etc ...
----------------------------
this report get the data from many table specially for the table owner, so it cannot be used standar report in CR, and then i try to create parameter for keep the data which send fro VB.NET.
I still wondering the best way to create this report.
Thank you for your help
-
Dec 9th, 2003, 10:13 PM
#5
Frenzied Member
A formula field as its name says is based on a formula that can be anywhere from a simple one to a very complexed based on several fields and calculations. Even it can have no formual and u just assign a value as the formula text at run time.
'Heading for the automatic overload'
Marillion, Brave, The Great Escape, 1994
'How will WE stand the FIRE TOMORROW?'
Eloy, Silent Cries and Mighty Echoes, The Vision - Burning, 1979
-
Dec 10th, 2003, 08:37 AM
#6
Fanatic Member
I use parameter fields and was able to get rid of the prompts!
-
Dec 10th, 2003, 08:37 AM
#7
Fanatic Member
I use parameter fields and was able to get rid of the prompts!
-
Dec 10th, 2003, 08:48 AM
#8
Fanatic Member
I create the report object, then set the parameters like:
VB Code:
RptObject.SetParameterValue(... , ...)
then I set the report source for the viewer and show the viewer:
VB Code:
CrystalReportViewer1.ReportSource = RptObject
CrystalReportViewer1.DisplayGroupTree = False
'Finally show the report
Me.ShowDialog()
No prompts.
-
Dec 10th, 2003, 01:47 PM
#9
Frenzied Member
Originally posted by VBCrazyCoder
I use parameter fields and was able to get rid of the prompts!
But if you refresh it, you get prompted again.
'Heading for the automatic overload'
Marillion, Brave, The Great Escape, 1994
'How will WE stand the FIRE TOMORROW?'
Eloy, Silent Cries and Mighty Echoes, The Vision - Burning, 1979
-
Dec 10th, 2003, 02:32 PM
#10
Fanatic Member
I don't do refreshes for that particular report so that may well be the case. Hey, how'd that duplicate post get in there!
-
Dec 10th, 2003, 02:52 PM
#11
Originally posted by VBCrazyCoder
I don't do refreshes for that particular report so that may well be the case. Hey, how'd that duplicate post get in there!
And I thought you were just rubbing it in.
-
Dec 11th, 2003, 05:20 AM
#12
Thread Starter
New Member
Thank you for all of you ...
I have solve the problem.
The problem is : in my VB.NET version 2002 i didn't found the 'SetParameterValue' property, and after i'd install 2003 version, i found it.
I'm very happy .
thank you again
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|