Results 1 to 12 of 12

Thread: Can I unshow the window of "Enter Parameter Value" when run [urgent]

  1. #1

    Thread Starter
    New Member
    Join Date
    Dec 2003
    Posts
    4

    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

  2. #2
    Fanatic Member VBCrazyCoder's Avatar
    Join Date
    Apr 2003
    Posts
    681
    Make sure your prompting text in the report for the parameter is empty.

  3. #3
    Frenzied Member
    Join Date
    Oct 2002
    Location
    Gammapolis
    Posts
    1,474
    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

  4. #4

    Thread Starter
    New Member
    Join Date
    Dec 2003
    Posts
    4
    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

  5. #5
    Frenzied Member
    Join Date
    Oct 2002
    Location
    Gammapolis
    Posts
    1,474
    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

  6. #6
    Fanatic Member VBCrazyCoder's Avatar
    Join Date
    Apr 2003
    Posts
    681
    I use parameter fields and was able to get rid of the prompts!

  7. #7
    Fanatic Member VBCrazyCoder's Avatar
    Join Date
    Apr 2003
    Posts
    681
    I use parameter fields and was able to get rid of the prompts!

  8. #8
    Fanatic Member VBCrazyCoder's Avatar
    Join Date
    Apr 2003
    Posts
    681
    I create the report object, then set the parameters like:
    VB Code:
    1. RptObject.SetParameterValue(... , ...)
    then I set the report source for the viewer and show the viewer:
    VB Code:
    1. CrystalReportViewer1.ReportSource = RptObject
    2. CrystalReportViewer1.DisplayGroupTree = False
    3.  
    4. 'Finally show the report
    5. Me.ShowDialog()

    No prompts.

  9. #9
    Frenzied Member
    Join Date
    Oct 2002
    Location
    Gammapolis
    Posts
    1,474
    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

  10. #10
    Fanatic Member VBCrazyCoder's Avatar
    Join Date
    Apr 2003
    Posts
    681
    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!

  11. #11
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339
    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.

  12. #12

    Thread Starter
    New Member
    Join Date
    Dec 2003
    Posts
    4
    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
  •  



Click Here to Expand Forum to Full Width