alternative for app.path & crystal report

ez416

Member
Joined
Apr 17, 2007
Messages
9
Programming Experience
1-3
1. what is the alternative code for App.path(VB6) in VB.NET?

2. How can I open a crystal report in VB.NET. in asp.net it goes like this. I first creat an XMLSchema File then bind it to my crystal report

Dim strCmd As String = ""
strCmd = "Select * FROM TEST "
Dim OraCON As New OracleConnection(ConfigurationManager.ConnectionStrings("Oraconn").ConnectionString)
OraCON.Open()
Dim ds As DataSet = New DataSet
Dim da As OracleDataAdapter = New OracleDataAdapter(strCmd, OraCON)
da.Fill(ds, "TEST_SCHEMA")
OraCON.Close()
Dim myReportDocument As ReportDocument
myReportDocument = New ReportDocument
myReportDocument.Load(Server.MapPath("~\Reports\Test.rpt"))
myReportDocument.SetDataSource(ds)
CrystalReportViewer1.ReportSource = myReportDocument
CrystalReportViewer1.DataBind()
CrystalReportViewer1.Width = System.Web.UI.WebControls.Unit.Pixel(1024)

If you have any alternative solution please let me know. Thanks!
 
1. what is the alternative code for App.path(VB6) in VB.NET?
Application.ExecutablePath

2. How can I open a crystal report in VB.NET. in asp.net it goes like this. I first creat an XMLSchema File then bind it to my crystal report
Create a new crystal reports project, add a report to it and look at the code the designer generated. I seem to recall its nearly the same as what you put here:


Dim myReportDocument As ReportDocument
myReportDocument = New ReportDocument
myReportDocument.Load(Server.MapPath("~\Reports\Test.rpt"))
myReportDocument.SetDataSource(ds)
CrystalReportViewer1.ReportSource = myReportDocument
'not sure this call is actually needed
CrystalReportViewer1.DataBind()
 
I have created a new crystal report. the problem is the deployment, where Im I going to put the reports when deploying it. It seems it is not located. I used clicked once deployment. Am I going to put it on the server? please help
 
You load the report from wherever you like.. That's variable
And when you create the install/publish routine, you choose where the Crystal Report is to go.. Where is the problem?
 
my report doesnt come with my click once deployment. I manually copy the report file to the client computer.

you mean to say on report.load, i dont have to use the
Application.StartupPath & "\testreport.rpt"

how can I choose where the crystal report go?

please help
 
my report doesnt come with my click once deployment. I manually copy the report file to the client computer.

THen copy it somewhere relative to the app, and load it

you mean to say on report.load, i dont have to use the
Application.StartupPath & "\testreport.rpt"

Erm.. i wouldnt expect you to load a report from within the Load Event of that report.. THat's kinda chicken and egg, is it not?

how can I choose where the crystal report go?

You said "I manually copy the report file to the client computer" and then you ask me how you can choose where the file goes? Is Windows Explorer and the concept of copying files new to you?

please help
I'm having some difficulty ascertaining where the problem is?
 
Back
Top