2
votes

Using vs2008 c#. Howdy, Ive got an application where im trying to decide if i should use the Crystal reports or the Report viewer that comes with the visual studio install.

My issue is that while it will run fine on my development machine, a lot of the machines the application will be deployed to in remote locations WON'T have the runtime for either crystal reports or the report viewer installed.

therefore if i build an application using either of these, and prevent user access to the reports only on the machines that do NOT have the runtimes, can the application run ok, or should i expect crazy errors on install and such

Any advice appreciated.

1

1 Answers

2
votes

You could actually include the Crystal Reports runtime on your deployment package wether its by Deployment Project or ClickOnce. During runtimeyou may encounter error which you could handle on your catch statement or on the application_threadexception event like this:

private static void Application_ThreadException(object sender, System.Threading.ThreadExceptionEventArgs e)
    {
        //For missing crystal reports assembly
        if ((e.Exception is System.IO.FileNotFoundException) && (e.Exception.Message.IndexOf("CrystalDecisions.CrystalReports.Engine") > -1))
            MessageBox.Show("Crystal Reports is required to use this feature", "Crystal Reports", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
       }