Crystal Reports deployment issue/report works on my machine but no one elses

Hello,

Here's the situation...we have a windows app that's been up and running for a while. I just created a new CR report and tested it on my development machine and it works great.

In the past, whenever we make changes to the app we just recompile the app and distribute the new .exe via logon scripts to all of our staff. This seems to work well...but for some reason when we distributed the new exe with the new CR report the report wouldn't work.

Would this have something to do with just copying the .exe not having the new CR report compiled into it? When I look into the install directories of the app, none of the other, older CR reports are listed as separate .rpt files...shouldn't the new report be rolled into the .exe just like the older ones?

Do I need to create a new deployment project and roll the change out that way? Is that the only way a new CR report will successfully be distributed?

Points:
- app has pre-existing CR reports that work
- new CR report works great on development machine (regardless of logon credentials)
- CR report won't work on any other machine (even for my logon credentials)
- CR.net
- VS.2003

Any help would be appreciated. I really don't want to have to create a new deployment project since the setup is fairly complex...I just want to roll out a new CR report.

Thanks.
LVL 1
georgeb3Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

georgeb3Author Commented:
Oh yeah, btw, the error that occurs on everyone else's machine is that the Database logon window pops up...it shouldn't though because I'm using the PUSH method and connect to the database manually, fill my dataset and push the dataset out to the report. So CR shouldn't need to connect to a database.
0
Vaxman2Commented:
If the report is being loaded with a load statement and a path:

Dim cr as ReportDocument
cr.Load("test.rpt")

Then the .rpt file has to be distributed with the executable..

If you have added the report to the project itself:

Dim cr as New TestReport

Then it is embedded into the executable and the deployment shouldn't have to change..
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Vaxman2Commented:
Just saw your recent post of the error message. That can be caused by a firewall blocking access to the server in question, or the datasource used in the database expert on your PC is not setup on the client PCs, or the user information doesn't work to login to the datasource,

But you said you tried your login information, so it shouldn't be the latter issue.
0
JavaScript Best Practices

Save hours in development time and avoid common mistakes by learning the best practices to use for JavaScript.

georgeb3Author Commented:
Vaxman2....I think you may have stumbled onto something with your first post. I did reference it as Rpt.OpenSubReport("reportname.rpt") and I did NOT distribute the rpt file.

So would the rpt file go in teh same directory as the apps exe file?

0
georgeb3Author Commented:
Vaxman2, in response to your database suggestions...

I'm using the same connection string that is used throughout the app...so if there was a problem with the data connection or accessing the DB then an error would be thrown earlier (on the logon page).

The error only occurs when trying to open the report.

I'm attaching the vb code below...I made a main report and one sub report. Like I said, it works perfectly for me on my machine...so I know the CR reports are linked to properly.

The logon credentials are in the connection string, so I know it's not a DB permissions issue either.

I'm wondering if it has something t o do with the XSD files I used when setting up the reports...I'm not deploying them either...I wonder if they need to be copied too.
            Dim con As New SqlClient.SqlConnection(PConString)
            Dim qry As New System.Text.StringBuilder("MAIN REPORT QUERY GOES HERE")
            Dim qry2 As New System.Text.StringBuilder(SUBREPORT QUERY GOES HERE)
 
            Dim ADP As New SqlClient.SqlDataAdapter(qry.ToString, con)
            Dim DSx As New xsdStandardCageV2Schema2
            ADP.Fill(DSx, "ReportData")
 
            Dim ADP2 As New SqlClient.SqlDataAdapter(qry2.ToString, con)
            Dim DSy As New xsdLabelsV2
            ADP2.Fill(DSy, "xsdLabelsV2")
 
            Dim Rpt As New rptStandardCageV2
            Dim RptSub As New ReportDocument
 
            RptSub = Rpt.OpenSubreport("rptLabelsV2.rpt")
 
            Rpt.SetDataSource(DSx)
            RptSub.SetDataSource(DSy)
 
            CRViewer.ReportSource = Rpt
 
'IN DEBUG MODE, I GET ALL THE WAY TO THIS POINT WITH NO ERRORS
'BOTH DATASETS HAVE DATA - NO LOGON ISSUES

Open in new window

0
georgeb3Author Commented:
I tried to copy the rpt files over to the same directory as the exe and the app still asks for DB logon info. Neither does copying over the xsd files to the deployed exe folder.

The weird thing is that these reports don't connect to a DB...why would CR ask for DB credentials?
0
Vaxman2Commented:
You may need to set the login information for the sub-report even though it is not a database..

Look at the accepted solution at http://www.experts-exchange.com/Database/Reporting_/Crystal_Reports/Q_21059125.html
0
georgeb3Author Commented:
Man, I really hope not - that kind of negates the flexibility of using a single DB connection string. According to Bischoff's book, push type reports don't cache login info since you don't ever set the login info like you do for pull type reports.
I'll give it a try and see if it makes a difference...thanks for the idea.
0
georgeb3Author Commented:
OK, so I figured it out.

The issue was that the name of the table in the xsd file and the name of the table in the dataset needed to be the same. Also, I was only passing the dataset into the report's datasource...whereas I needed to specifically pass in the datatable into the report's data source. I've attached the revised code which works properly...
            Dim con As New SqlClient.SqlConnection(PConString)
            
            Dim qry As New System.Text.StringBuilder("")
            qry.Append("SELECT STATEMENT GOES HERE")
 
            Dim qry2 As New System.Text.StringBuilder("")
            qry2.Append("SUB REPORT SELECT STATEMENT GOES HERE")
 
            'FILL MAIN REPORT'S DATASET
            Dim ADP As New SqlClient.SqlDataAdapter(qry.ToString, con)
            Dim DSx As New DataSet
            ADP.Fill(DSx, "ReportData") 'THIS TABLE SHOULD HAVE SAME NAME               
                                        'AS THE TABLE IN THE XSD FILE USED
                                        'FOR THE MAIN REPORT
 
            'FILL SUBREPORT'S DATASET
            Dim ADP2 As New SqlClient.SqlDataAdapter(qry2.ToString, con)
            Dim DSy As New DataSet
            ADP2.Fill(DSy, "xsdLabelsV2")   'THIS TABLE SHOULD HAVE SAME
                                            'NAME AS THE TABLE IN THE XSD
                                            'FILE USED FOR THE SUB REPORT
 
            'INSTANTIATE THE MAIN REPORT AS THE REPORT ITSELF
            Dim Rpt As New rptStandardCageV2
 
            'INSTATNTIATE THE SUBREPORT AS A GENERIC REPORTDOCUMENT
            Dim RptSub As New ReportDocument
 
            'GET A HANDLE ON THE SUB REPORT VIA THE MAIN 
            'REPORT.OPENSUBREPORT METHOD
            RptSub = Rpt.OpenSubreport("rptLabelsV2")
 
            'SET THE DATASOURCES...MAKE SURE TO USE THE SAME
            'DS.TABLE NAMES AS USED DURING THE DS FILL ABOVE
            'OTHERWISE YOU'LL GET A DATABASE LOGIN ERROR
            Rpt.SetDataSource(DSx.Tables("ReportData"))
            RptSub.SetDataSource(DSy.Tables("xsdLabelsV2"))
 
            'BIND TO THE CR VIEWER OBJECT
            CRViewer.ReportSource = Rpt

Open in new window

0
georgeb3Author Commented:
I guess what was happening is that the report wasn't sure which table to use in the dataset so it was throwing its database login window up...even if i logged in it would just say that the login info was incorrect. Probably because it really wasn't trying to get to a database, it just didn't know where to get the data from.
0
georgeb3Author Commented:
This wasn't the solution, but I appreciate the time vaxman put into helping me out.
0
Vaxman2Commented:
I glad you got it working!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
.NET Programming

From novice to tech pro — start learning today.