Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How could I load parameter values for a CR from VB.NET?

Status
Not open for further replies.

Tazyoglu

Programmer
Oct 30, 2002
8
0
0
CA
I have a parameterize report and I want to use this report in a .NET project but I've got an error. My report has only one parameter, pmUUID, integer type.

This is the VB.NET code:

Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init

Dim paramFields As New CrystalDecisions.Shared.ParameterFields()
Dim paramField As New CrystalDecisions.Shared.ParameterField()
Dim discreteVal As New CrystalDecisions.Shared.ParameterDiscreteValue()
Dim rangeVal As New CrystalDecisions.Shared.ParameterRangeValue()
Dim x As Integer

InitializeComponent()

paramField.ParameterFieldName = "pmUUID"

discreteVal.Value = 1

paramField.CurrentValues.Add(discreteVal)

paramFields.Add(paramField)

CrystalReportViewer1.ParameterFieldInfo = paramFields

CrystalReportViewer1.ParameterFieldInfo = paramFields

CrystalReportViewer1.ReportSource = "C:\\Work\\ASPXTest\\rptTest.rpt"

CrystalReportViewer1.DataBind()

End Sub

and this is the error:

Server Error in '/ASPXTest' Application.
--------------------------------------------------------------------------------

Logon failed.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: CrystalDecisions.CrystalReports.Engine.LogOnException: Logon failed.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:


[LogOnException: Logon failed.]
.K(String 
, EngineExceptionErrorID  ) +546
.F(Int16 , Int32 ) +491
CrystalDecisions.CrystalReports.Engine.FormatEngine.GetPage(PageRequestContext reqContext) +459
CrystalDecisions.ReportSource.LocalReportSourceBase.GetPage(PageRequestContext pageReqContext) +189
CrystalDecisions.Web.ReportAgent.v(Boolean `) +150
CrystalDecisions.Web.CrystalReportViewer.OnPreRender(EventArgs e) +108
System.Web.UI.Control.PreRenderRecursiveInternal() +62
System.Web.UI.Control.PreRenderRecursiveInternal() +125
System.Web.UI.Control.PreRenderRecursiveInternal() +125
System.Web.UI.Page.ProcessRequestMain() +1470


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top