Deploy Crystal Report rpt files together with the Exe as a standalone

To deploy crystal report rpt files together with the Exe as a standalone, you need to embed rpt files into the exe.

This is particularly useful for ClickOnce deployment.

Guides

1.) To embed the rpt file into the exe. The first step is to associate an rpt file with CRViewer by setting it as 'reportSource'.

Objects will be created on the form.

Refer to 'vs-issues-feb-2011-9.jpg',vs-issues-feb-2011-10.jpg'



2.) After you have done that, you need to unreference it as 'reportSource'. The 'reportSource' will be dynamically set during runtime.

Refer to 'vs-issues-feb-2011-11.jpg','vs-issues-feb-2011-12.jpg'



Download the sample code (VB.NET Visual Studio 2008 SP1).

Tips:

1.) If you embed a rpt file into the exe, the exe file size will be bigger.

Refer to 'Form2'

2.) If you do not embed a rpt file into the exe, you have to make use of installer to copy the rpt file to the desired location for the exe to be able to find it.

Refer to 'Form1'

Comments