Skip to Content
Author's profile photo Ludek Uher

My day (1) training on CR 2010 Beta

Over the last couple of days I’ve taken a bit of time to see what this new Beta is all about. My first recommendation would be to read the following two blogs written by Blair Wheadon:

Crystal Reports for Visual Studio 2010 Beta Now Available
Crystal Reports in Visual Studio 2010

CR 2010 Beta can be downloaded from the following links.

Downloads US:
http://www.surveymonkey.com/s/CRVS2010US

Downloads rest of world:
http://www.surveymonkey.com/s/CRVS2010World 

The downloads are fast. Mine took about 4 minutes. An actual install took less than 7 minutes. Looking at the directory structure first. If the install went smoothly, you should see

c:program files(x86)SAP BusinessObjectsCrystal reports 14.0

with a number of subdirectories (ChartSupport, crystalreportviewers, dotnet, HelpFiles. The HelpFiles directory contains the files crnet_dg_2020.zip and crnet_api_2010.zip files. Here is where I ran into my first issue; they don’t work. See the below forum thread for issue description and temporary solution:
CRVS2010 Beta – VS2010 CR4VS2010 Help Content

Ok. On to my first project.

Firmly believing in the “KISS” paradigm, I figured the easiest thing to do will be to upgrade an existing application. Something as simple as can be. No viewer, no database logon, etc. Something like the sample app vbnet_win_exporttopdf available from here:

https://wiki.sdn.sap.com/wiki/display/BOBJ/Crystal+Reports+for+.NET+SDK+Samples

Conversion went well with only two warnings re. CrystalDecision.Enterprise.Framework and CrystalDecision.Enterprise.Infostore assemblies. As these assemblies are not needed in the project I removed them. Checked that the CR viewer was on the form, run the app. Oops, an error:

 

 image

 

To make a long frustrating story short, here is what you need to do to avoid the above error. Once the app is upgraded to .NET 2010 and uses the CR 2010 assemblies, go to the app properties. Select the Compile tab and click on the “Advanced Compile Options…” button. Find “Target CPU” and set it to x86. Next find “Target Framework” and set it to .NET Framework 4. See the screen shot below.

 

image

 

And yes, the above is documented in the CR_Beta_Release_Notes_en.pdf, they just were not published when I started this training.

The app should run with no errors now.

Ok. So, let’s get real adventurous and create a new project with a CR viewer. No code, just a viewer on the form. Remembering the above steps, here is what you have to do:

Create a new empty project and save it. Go to the project properties and select the Compile tab. Click the “Advanced Compile Options…” button. Find “Target CPU” and set it to x86. Next find “Target Framework” and set it to .NET Framework 4. You can now go to the Toolbox and the CR viewer will be available. Note that without the above steps, you will not get the viewer in the Toolbox. Run the app and success, viewer on a form. Now, I added one line of code to run a saved data report;

CrystalReportViewer1.reportSource = “C:     estcr2010
eport1.rpt”

And, success. So, let’s try to upgrade an existing win app that uses the viewer. Following the above steps:

…project properties and select the Compile tab. Click the “Advanced Compile Options…” button. Find “Target CPU” and set it to x86. Next find “Target Framework” and set it to .NET Framework 4.

Running the project, results in the error:

“Could not load file or assembly ‘BusinessObjects.Licensing.KeycodeDecoder, Version=14.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304’ or one of its dependencies. The system cannot find the file specified.” (System.IO.FileNotFoundException) Exception Message = “Could not load file or assembly ‘BusinessObjects.Licensing.KeycodeDecoder, Version=14.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304’ or one of its dependencies. The system cannot find the file specified.”, Exception Type = “System.IO.FileNotFoundException”

And sure enough the assembly is nowhere to be found…

Rumour had it that this was not an issue with a C# app and indeed after ensuring the Trget Framework and Target CPU is set as per above, the C# sample win app cshart_win_dbviewer works fine. Ok. More testing with a VB app to see wht gives. But that’s for day 2.

Update re. the above issue (May 6, 2010). Looks like this was some sort of a conversion issue. Deleting the project and re-oppening the old one resolved the error.

If you have questions regarding CR 2010, please post these to the SAP Crystal Reports, version for Visual Studio forum, making sure you read the sticky post Crystal Reports for Visual Studio 2010 Beta – read before posting before posting.

Assigned Tags

      3 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Former Member
      Former Member

      I treid downloading the documentation for VS 2010 and one of the files is a .chm file. I can see the index and it looks like what I need should be there but I get the Navigation cancelled error and no information.

      Author's profile photo Bhushan Hyalij
      Bhushan Hyalij

      right click on the .chm file go to properties, click UNBLOCK button, OK, APPLY.

      FYI.. this solution has been posted many times on the forum.

      Author's profile photo Former Member
      Former Member