Writing Code
 Crystal Reports Forum : Crystal Reports .NET 2003 : Writing Code
Message Icon Topic: Crystal Errors when running compiled application.. Post Reply Post New Topic
Author Message
cboshdave
Newbie
Newbie
Avatar

Joined: 05 Feb 2008
Location: United States
Online Status: Offline
Posts: 10
Quote cboshdave Replybullet Topic: Crystal Errors when running compiled application..
    Posted: 22 Sep 2009 at 10:17am
I have embedded several Crystal 11 reports into my application (first time obviously).  They run fine on my machine in a 2008 c# dev environment.  I am not using .net for this. 

I have published to a corporate server.  I used the "one-click" publish which may be causing me some grief??  Anyway, the application installs just fine and when the user selects the report, the app produces an error window that says: "Could not load file or assembly 'CrystalDecisions.Shared, Version=11.5...

I have tried to force include every possible file in the publish of the app.  I have seen the server Merge install stuff.  I don't know why I would need this though because I am trying to run these reports on the local machine.  Not sure what else I need to do??  Any suggestions would be appreciated. 

Dave


Edited by cboshdave - 22 Sep 2009 at 10:23am
CBOSH - Come Big or Stay Home!
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
Quote hilfy Replybullet Posted: 25 Sep 2009 at 6:11pm

Which version of Visual Studio are you running?  If it's 2005, there are a couple of things you need to do.

1.  Make sure that the Crystal Merge Module (crystalreports11_5_net.msm) is included in the Detected Dependencies of the setup.
 

2.  Click on the msm under Detected Dependencies and open the "(MergeModuleProperties)" section at the top of the Properties viewer.  Scroll down until you see "Keycode".  Enter your Crystal license key in the key code.  The easiest way to get this is to go to Help|About in Visual Studio - it will be listed in there.

I don't know a lot about the "one-click" install, but I know that this works with a "Setup Wizard" type of install.  However, installing the merge module will make sure that the assemblies you app needs to run reports are installed.
 
 
-Dell


Edited by hilfy - 25 Sep 2009 at 6:13pm
IP IP Logged
cboshdave
Newbie
Newbie
Avatar

Joined: 05 Feb 2008
Location: United States
Online Status: Offline
Posts: 10
Quote cboshdave Replybullet Posted: 28 Sep 2009 at 7:57am
As I mentioned, it is a Visual Studio 2008 C# environment.  I will see if your suggestions still apply. 

Thanks,
Dave
CBOSH - Come Big or Stay Home!
IP IP Logged
cboshdave
Newbie
Newbie
Avatar

Joined: 05 Feb 2008
Location: United States
Online Status: Offline
Posts: 10
Quote cboshdave Replybullet Posted: 28 Sep 2009 at 2:28pm
A couple more pieces of information now. 

I did not notice before, but I have several warnings that might be applicable.

1.  Unable to apply publish properties for item crystaldecisions.enterprise.framework".   

and about 10 more related to other CrystalDecisions.xxx things. 

I saw somewhere that I need to enter my crystal 11.5 key somewhere but it was not clear where and I cannot find a place to enter it and have it compile with the code. 

CBOSH - Come Big or Stay Home!
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
Quote hilfy Replybullet Posted: 29 Sep 2009 at 7:49am

Crystal XI does NOT integrate with VS 2008.  There are no plans to ever do that integration.  Crystal 10 comes with VS and it will integrate with Crystal 2008.

I know this from experience - I fought with VS 2008 for over a week to get it to do some stuff with XI so that I didn't have to upgrade our reports.

If you're not using .NET with C#, what are you using?  The error message you gave me says that your program is looking for a .NET assembly.

 

-Dell

IP IP Logged
cboshdave
Newbie
Newbie
Avatar

Joined: 05 Feb 2008
Location: United States
Online Status: Offline
Posts: 10
Quote cboshdave Replybullet Posted: 29 Sep 2009 at 8:27am
Well, that answers that I suppose.  I will recompile the reports in version 10 and see if it works there.  I am using Visual Studio C#, but it is a client app rather than a web app.  I don't know if it makes a difference. 
 
I will recompile the reports in v10 and see if it works!
 
Thanks again,
Dave
CBOSH - Come Big or Stay Home!
IP IP Logged
cboshdave
Newbie
Newbie
Avatar

Joined: 05 Feb 2008
Location: United States
Online Status: Offline
Posts: 10
Quote cboshdave Replybullet Posted: 29 Sep 2009 at 9:02am
One more thought.  When I add the reports, the component is showing a "Full Path" property that points to my local hard drive. 
 
When the users install and run, the error seems to be that the code is trying to pull up the report from the reference to my drive.  I thought I was compiling these reports into the code???  Do I need to change an option to make this work properly??  Even if I change the "Copy to Output Directort" option to Copy Always, the Full Path still has a reference to my hd??
 
Thanks again!
Dave
CBOSH - Come Big or Stay Home!
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
Quote hilfy Replybullet Posted: 29 Sep 2009 at 9:42am
What I do when I'm compiling a report into the app is create an object of the report class instead of loading the report from a file.  In the sample code below, I'm using an .NET DataSet as the data source for the report, so I don't set the table logins.  I've overridden the Creator for the viewer form so that I can pass into it the DataSet and information about which report to run (there are several in this particular application...)
public BOEAuditRptViewer(DataSet dsAuditInfo, bool isTax, string auditType)
{
  InitializeComponent();
 
if (isTax)
  {
    ConfigureTaxAuditReport(dsAuditInfo);
  }
 
else
 
{
    ConfigureAuditReport(dsAuditInfo, auditType);
  }
}
private void ConfigureAuditReport(DataSet dsAuditInfo, string auditType)
{
  //Create a typed-report object
 
BOEUserAuditRpt auditRpt = new BOEUserAuditRpt();
  auditRpt.SetDataSource(dsAuditInfo);
  //set the Profile Type parameter so that report data is filtered
 
string profileType = "ALL";
 
switch (auditType)
  {
   
case "Consumer Marketing":
      profileType =
"CMI";
     
break;
   
case "Corporate":
      profileType =
"COR";
     
break;
   
case "Hazard":
      profileType =
"HAZ";
     
break;
  }
  //Now that we know the param value, set the parameter
  auditRpt.ParameterFields[
"Profile Type"].AllowCustomValues = true;
  auditRpt.ParameterFields[
"Profile Type"].CurrentValues.Clear();
  auditRpt.ParameterFields[
"Profile Type"].CurrentValues.AddValue(profileType);
  auditRptViewer.ReportSource = auditRpt;
}
 
-Dell


Edited by hilfy - 29 Sep 2009 at 9:45am
IP IP Logged
cboshdave
Newbie
Newbie
Avatar

Joined: 05 Feb 2008
Location: United States
Online Status: Offline
Posts: 10
Quote cboshdave Replybullet Posted: 29 Sep 2009 at 1:12pm
CBOSH - Come Big or Stay Home!
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.031 seconds.