Wrox Programmer Forums
|
BOOK: Professional Crystal Reports for VS.NET
This is the forum to discuss the Wrox book Professional Crystal Reports for Visual Studio .NET by David McAmis; ISBN: 9780764544033
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Professional Crystal Reports for VS.NET section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 17th, 2004, 10:58 AM
Registered User
 
Join Date: Nov 2004
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default ParameterFields

Can you please help me? I bought Crystal reports for visual studio.Net isbn 1-861100-774-4 I am trying to pass a parameter to my report and it get [ParameterFieldCurrentValueException: Missing parameter field current value.]
   [1].[1]F(String  , EngineExceptionErrorID 
)
   [1].[1]B(String 

--------------------------------------------------------------------------------

, Int32 

--------------------------------------------------------------------------------

)
   CrystalDecisions.CrystalReports.Engine.FormatEngin e.internalSetReportInfo(RequestContext reqContext)
   CrystalDecisions.CrystalReports.Engine.FormatEngin e.internalGetViewContext(ReportPageRequestContext reqContext, * viewContext)
   CrystalDecisions.CrystalReports.Engine.FormatEngin e.GetPage(PageRequestContext reqContext)
   CrystalDecisions.ReportSource.LocalReportSourceBas e.GetPage(PageRequestContext pageReqContext)
   CrystalDecisions.Web.ReportAgent.u(Boolean

--------------------------------------------------------------------------------

N)
   CrystalDecisions.Web.CrystalReportViewer.OnPreRend er(EventArgs e)
   System.Web.UI.Control.PreRenderRecursiveInternal()
   System.Web.UI.Control.PreRenderRecursiveInternal()
   System.Web.UI.Control.PreRenderRecursiveInternal()
   System.Web.UI.Page.ProcessRequestMain()






Here is my code.

{Command.IDOwner} = {?@Idowner} in .rpt file



Dim myReport As New RptMotorVehicleRegisterReport

        CrystalReportViewer1.ReportSource = myReport



        ' Declare variables needed to pass the parameters

        ' to the viewer control.

        Dim paramFields As New ParameterFields

        Dim paramField As New ParameterField

        Dim discreteVal As New ParameterDiscreteValue



        ' Set the name of the parameter field, this must match a

        ' parameter in the report.

        ' Set the discreet value to the parameter.





        ' Set the first discrete value and pass it to the parameter

        discreteVal.Value = "4"

        paramField.CurrentValues.Add(discreteVal)





        paramFields = CrystalReportViewer1.ParameterFieldInfo

        paramField.ParameterFieldName = "@Idowner"





        myReport.Load()





thank you

Stanley J mroczek

917-968-7093


stan
 
Old November 25th, 2004, 01:16 AM
Registered User
 
Join Date: Nov 2004
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to softrajesh
Default

The easy of passing paramter with out any probs is..

MyReport.SetParameterValue(Index of parameter, valueof parameter)

eg: MyReport.SetParameterValue(1,"hello")











Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.