cancel
Showing results for 
Search instead for 
Did you mean: 

Displaying a user logo in a Crystal Report dynamically at run time

Former Member
0 Kudos

Using Visual Studio 2010, CR for VS 2010 on a Win 7 64 bit dev machine.  The software app that I'm creating is a full Windows application (not for the web).  Compiling my app for .NET 4.0.

Actually, in January, 2012, we purchased the CR 2011 full version and subsequently installed this version for use within the development environment (VS 2010).  References that I use show (for example) CrystalDecisions.CrystalReports.Engine version 13.0.2.

I have hundreds of hours of experience using Crystal Reports within VB, dating back to VB 6 and CR 8.5.  In a software app that I am currently writing, (where I am using VB in VS 2010 and CR 13.0.2), the Graphic Location formula within a picture "placeholder" is not working.  I am using a parameter called pUserLogo to set the path to the graphic location at runtime, but to no avail.  The picture that I'm using as a placeholder is not changing at runtime.

I have scoured the internet for solutions to this problem.  I have also attempted to upgrade both the CR for VS 2010 (a.k.a. CR developer version) as well as the CR runtimes (both the 32 bit and 64 bit versions), but this has not helped.  The picture is never replaced at runtime while working within the IDE (i.e. running the app from VS, nor after compiling and then running as a full-blown application).  I have also tested this on another development machine.

I eventually gave up trying to use the Graphic Location formula method, and instead went with a method that uses a DataSet within a DataTable to set the image (of an image column) as posted online.  This method actually works within the IDEHowever, if I then install my app to another PC (Win 7 64 bit as well), the CR crashes the app.  After extensive searching online, I found that referencing a DataSet in VS 2010 inside a CR, led to many other issues, such as having to use the 'useLegacyV2RuntimeActivationPolicy=true' statement in app.config.

Further, I read that using a DataSet within CR in VS 2010 meant that you had to compile for .NET 3.5, rather than 4.0.

Eventually, I created restore points on both PC's and then upgraded everything to 13.0.6.  But this did not help either method.

All I am trying to do is 1) let the user of my app select an image before the report is created, and then 2) display that image on the report.  This particular report doesn't even need to reference any database, as all of the numbers that I'm displaying in the report are simply parameters that I update during the report's creation.  It is a very simple, straight-forward report.

I would be happy to setup a GotoMeeting so that someone at support could see what is happening and could also review the code.  There are many more details, such as what errors I've encountered along the way, and what web sites I've been to in researching these issues, but I will leave that for continued discussion.

Regards,

Dominic

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

An older discussion on this issue can be found at:

http://stackoverflow.com/questions/2548723/unable-to-programically-set-graphic-location-in-crystal-r...

Since I couldn't get this method to work, I then tried the method as described here:

http://adf.ly/91637/banner/aspalliance.com/1097_Importing_Dynamic_Images_to_the_Crystal_Report_witho...

The second method, which uses a DataSet within a DataTable as described in the above link, does work, and it correctly displays the image, but only in the IDE.  When tested on a "client" machine, opening the report causes my app to crash, with no exception or error message except for the "...has caused the application to stop working".  Previously, before introducing said DataSet into the report, the report loads and displays fine on my client machine.

Further research led me to these two threads concerning the usage of the crdb_adoplus.dll which is necessary when using a DataSet in VS 2010 with CR.  It seems that the folder dotnet1 is not accessible, and thus there are workarounds for this issue.  See these two threads, below:

http://scn.sap.com/thread/1802638

http://scn.sap.com/thread/1665437

Again, I followed the recommendations that I needed to set the Startup flag 'useLegacyV2RuntimeActivationPolicy=true' in app.config.  However, the workaround where I should target .NET 3.5 instead of .NET 4.0 is not reallly an acceptable option to me (and I don't know if it will work, anyway).

So my question remains; Can anyone please tell me if A) They have any issues using the "picture placeholder/formula" method for loading a picture at runtime, and/or B) If there is a fix for the DataSet issues apparently inherent in using VS 2010 with a Crystal Report?

Thanks in advance, for your reply.

Regards,

Dominic

Answers (0)