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!

Unable to connect: incorrect log on parameters..????

Status
Not open for further replies.

veronic

Programmer
Apr 6, 2004
73
0
0
US
I use Crystal 9.0 and Oracle DB. Report works OK in Crystal but when I add to application I get a message: Unable to connect: incorrect log on parameters.
I have a number of reports work perfectly with the same code and only this one give a problem.
My code:

Dim myParamValues As New ParameterValues
Dim mydiscreteVal1 As New ParameterDiscreteValue
Dim crExportOptions As ExportOptions
Dim crDiskFileDest As DiskFileDestinationOptions
Dim Fname As String

'Get the report parameters
myParamValues = oRpt.DataDefinition.ParameterFields("ProjNum").CurrentValues
'mydiscreteVal1.Value = Session("SelectedProjects")
mydiscreteVal1.Value = "04-F-1544"
myParamValues.Add(mydiscreteVal1)

oRpt.DataDefinition.ParameterFields("ProjNum").ApplyCurrentValues(myParamValues)


crExportOptions = New ExportOptions
crDiskFileDest = New DiskFileDestinationOptions

'Set the destination path and file name

Fname = "c:\CaseSummary.pdf"
crDiskFileDest.DiskFileName = Fname
'Set export options
crExportOptions = oRpt.ExportOptions


With crExportOptions
.DestinationOptions = crDiskFileDest
.ExportDestinationType = ExportDestinationType.DiskFile
.ExportFormatType = ExportFormatType.PortableDocFormat
End With

oRpt.Export()

'The following code writes the .pdf file to the Client's browser.

Response.ClearContent()
Response.ClearHeaders()
Response.ContentType = "application/pdf"
Response.WriteFile(Fname)
Response.Flush()
Response.Close()

'Delete the exported file from disk.
System.IO.File.Delete(Fname)


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top