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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

mapping problem in windows 2003 web server

Status
Not open for further replies.

adonet

MIS
May 4, 2004
312
US
I use code as bellow to map crystal report to crystalreportviewer. It works fine at workstation but not in web server which is windows 2003. I think that it may be mapping problem. How to map this line?

me.crvOrder.ReportSource = REPORT_ PATH

REPORT_PATH = "C:\inetpub\ or
REPORT_PATH = "\\localhost\myapp\myreport.rpt"


Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim rpt As New MyReport 'The report you created.
Dim myConnection As SqlConnection
Dim MyCommand As New SqlCommand
Dim myDA As New SqlDataAdapter
Dim myDS As New dstRpt 'The DataSet you created.
Dim MyConnectionString As String

MyConnectionString = ConfigurationSettings.AppSettings(WEBSERVER)
myConnection = New SqlConnection(MyConnectionString) 'from web.config
MyCommand.Connection = myConnection
MyCommand.CommandText = MYSQL
MyCommand.CommandType = CommandType.Text
myDA.SelectCommand = MyCommand
myDA.Fill(myDS, "tblOrder")
rpt.SetDataSource(myDS)
Me.crvOrder.ReportSource = rpt 'CR viewer
End Sub
 
you have a function called MapPath.

Server.MapPath('\myapp\myreport.rpt'); should do what you need

--------------------------
"two wrongs don't make a right, but three lefts do" - the unknown sage
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top