Deploying with Crystal Reports

SteveInBeloit

Well-known member
Joined
May 22, 2006
Messages
132
Programming Experience
10+
Hi,
I am having some trouble deploying my 2005 VB .NET project that has crytal reports. From the Publish tab, we have added the pre-req for Crystal Reports. When I push publish for UNC or Shared, I get the folder with the setup in it. If I put this on the server, browse to it from a PC on the server, and run it, it appears to install. Then when I try to run it from that PC, I get a file not found when it tries to load the report. Do I need to deploy the actual report (.rpt) separately? The program looks for it two levels up from the app. start. Do I build a folder two levels up on the server?

If I copy my whole project folder over, and run the .exe out of the bin, it is OK

When I publish to CD, and run the setup from the CD on the client PC, I get a report load error, file not found.

Or, is there anyway to just install it on the server and have each user have a shortcut to point to it and run it from there? I seem to be OK with this, except I get the file not found when it tries to load the report.

I realize this is all different than the ACCESS world. What is the perferred method of installing and running in a network environment, with SQL Server on the server, and using CRs??

Thanks,
Steve
 
Last edited:
What do you mean by:
VB.NET:
I get a file not found when it tries to load the report.

What is the report? A file, a Reference?

If it's a file, then it can be deployed along with your project. If it's a Reference to a
component then it's needs to be added as a reference. Note that when a project
is installed through a setup that it usually isn't installed to a bin folder.
 
HI,
I get an error that the report won't load. So I took it out of the Try Catch so I could see the stack trace. It is saying the path not found. Looks like when trying to find the report. In the IDE, I had manually put a Reports folder in the project, and moved the .rpt to that, then in code said:
Application.StartupPath + /Reports/myrpt.rpt --Works

But it can't find that.

A file, a reference? Hm. I created it by creating a project, then Add windows form, then selecting Crystal report. It created a myRpt.rpt in the project folder. So does that mean it is a file?

I deployed to the server with the Publish command, then ran the startup it put there from the client PC. So I know Application.startup path no longer points to the project folder. I don't know where it points, so I guess I understand why it can't find the /Reports/

I can however, get it to work by going into my project on the dev server, and giving an absolute path to the production server to a reports folder, then moving my reports to that folder on the server. (//prodserver/myProject/reports/myRpt.rpt) Then deploying again to the server, so now it has a valid path on the server where the report can be found. But I don't really want to do that long term, cause I never know where the next customer I will sell it to will be, and don't know the name of their server. I guess I could put a value in a syscontrol table and have it look for the "reports path" there. Don't know if this is an excepted way or not.

Thanks,
Steve
 
Oh I see, forget what I said about the Reference's file or other.

I use the Application.Info.DirectoryPath as show below but I'm not
sure what you'd want to use in your case.

VB.NET:
PrivateSub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
  Dim mypath As String = My.Application.Info.DirectoryPath
  MsgBox(mypath)
EndSub
 
Back
Top