views:

347

answers:

1

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.

+3  A: 

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);
       }
Jojo Sardez
Agree. Good deployment (such as via installer) is the ultimate way to conquer such issues.
Lex Li
okay but assuming i dont deploy the runtime, and i do prevent the users from accessing the reports, could i expect the application to run without error ?This is my question
Spooky2010