Tuesday, November 07, 2006

Registering Crystal Reports

Are you getting an exception
"Internal Exception: Cannot find KeycodeV2.dll or invalid keycode."
when you try to open a report done by Crystal reports?

Errors relating to KeycodeV2.dll can occur in VS.Net because of one of the following issues.
1. KeycodeV2.dll file is not accessible,
2. Does not have access to the registry keys which relate to KeycodeV2.dll,
3. Does not recognize the product Keycode stored in the registry.

Here I will address the last one, because most of the people doesn't know how to correctly register Crystal.

  • As the first step you have to add the licensing merge module which is Crystal_regwiz2003.msm (if you are using VS.Net 2002 the file will be RegWiz.msm) to your setup project.
  • Then get to the properties window of the Merge Module.
  • Expand the Merge Module Properties section in the Properties window and you will see a property called License Key.
  • Enter the License key of your Crystal reports there.

If any one is wondering what the License key is, read on,

To get a license key you have to register Crystal with Business Objects. After registering you will get an email containing a registration number and unique key code (If your copy is already registered you can get to the Product Code by going to menu Help -> About Microsoft Development Environment, in Visual Studio .NET. If it is registered the Product Code is the code besides Crystal Reports for Visual Studio .NET.) Copy the Product Code (Product Code consists of 19 characters and looks something like xxxxx-xxxxxxx-xxxxxxx.) into the License Key property of the above merge module.

Next time you build and install the project the error will vanish.

If you still get the error or if you are interested in reading more into this following URL might be useful to you.

http://support.businessobjects.com/communitycs/technicalpapers/crnet_keycodev2.pdf

Tuesday, October 31, 2006

Tech Ed 2006

Attended Tech Ed hear in Sri Lanka, met many old friends, it was a good time but I think Microsoft should have emphasized more on technical side.

Friday, October 20, 2006

Free Computer Education

We are planning to start a free Computer Training Centre based in my temple (Maithree Dharamayathanaya, Jayawadanagama Battaramulla) to educate the less previledged. On this matter the Rotary Club is helping us. So if you are interested in helping us please contact me.

Wednesday, October 11, 2006

Getting a Crystal Report Parameter value in VB.NET

After setting a parameter value of a crystal report there is no easy way of getting the value. So I found this to get the parameter value.


CType(CType (CType (CType (CType (CType (rpt.Parameter_paraArea, CrystalDecisions.Shared.IParameterField), CrystalDecisions.CrystalReports.Engine.ParameterFieldDefinition).CurrentValues, CrystalDecisions.Shared.ParameterValues).Item(0), CrystalDecisions.Shared.ParameterValue), CrystalDecisions.Shared.ParameterDiscreteValue).Value, Object)

rpt is the Crystal Report, paraArea is my parameter name which I needed to get the value of.

Hope this helps.

Monday, October 02, 2006

Playing Media Files in .Net Compact Framework 2.0

I have seen many people asking how to play media files in device applications. Here I am playing media files using Windows Media Player.



This is the ProcessHandler class which imports Coredll Dll and uses it's CreateProcess to create a seperate process with the required application.


This is the main form which has a button to start the Player, then it will ask the user to browse for a media file to play.


The ProcessHandler.CreateProcess function can be used to start any application which is installed in the device by simply replacing the 'WMPlayer' by the required application qualified name (IExplorer).

Friday, September 29, 2006

Interop Forms Toolkit 1.0

Are you in Visual Basic 6 (VB 6) and would like to join the .net 2.0 fun? But is your application size stopping you?

Now with the Interop Forms Toolkit 1.0 you can run forms that you have created with .net hand in hand with vb 6 forms in a VB 6 process.
Big Picture? You don't have to convert your entire application to .net but you can partially convert your application to .net or the new forms that you plan to create can be done in .net and used in your VB6 application.

http://msdn2.microsoft.com/en-us/vbasic/aa701259.aspx

Enjoy.
.Net Micro Framework

Microsoft has released a beta developer kit of .net Micro Framework which can be used to develop applications for the smallest of devices which are constrained in cost, memory, processor and/or power consumption.

Would like to know more?
http://www.microsoft.com/presspass/press/2006/sep06/09-26MicroFrameworkDKPR.mspx
http://www.aboutnetmf.com/entry.asp