3 Replies - 690 Views - Last Post: 02 August 2011 - 12:06 PM Rate Topic: -----

#1 Psyguy  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 76
  • View blog
  • Posts: 326
  • Joined: 12-January 11

Application with Excel export capability - Not working properly

Posted 01 August 2011 - 04:39 PM

I have a rather dirty little issue I have been trying to work through for a couple days and, unlike most of my other posts, this one has no coding problems. Basically I have an application that can display data in a a report viewer and, if the user clicks the export button, can send the datagridview info to an excel spreadsheet.

Now, this application works on my computer fine, it works on some of the other employees computers fine, but on a few select computers it gives an "InvalidOperationException" when the program stops working (after the splash screen shows). I thought maybe it was an issue with the assemblies I included in the project, but at the time of form loading, no Excel methods are used and no Excel objects are created yet. That brings me back to the reportviewer object assembly. I am using VS2010, but I am developing the application for fw 3.5 compatibility as we have not upgraded the entire facility to 4.0 yet. I have listed the references below. I am completely stumped. I really hope someone can give me some leads to follow. Thanks.

References:
Name Type Version Copy Local
Microsoft Excel 11.0 Object Library COM 1.5.0.0 True
Microsoft.ReportViewer.WinForms .NET 10.0.0.0 True
Sysytem .NET (the rest are .NET) 2.0.0.0 False (all the rest are false)
System.Data
System.Data.DataSetExtensions
System.Drawing
System.Windows.Forms
System.XML
System.Xml.Linq

Is This A Good Question/Topic? 0
  • +

Replies To: Application with Excel export capability - Not working properly

#2 Ionut  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 385
  • View blog
  • Posts: 1,057
  • Joined: 17-July 10

Re: Application with Excel export capability - Not working properly

Posted 01 August 2011 - 11:04 PM

It is hard to guess what is going on, so I would tell some steps you should take to debug your application.
1. Go to Windows Event Viewer and post back the error that appears under Application events node. EventID is a very good piece of information and that might give you some ideas (after googling of course :D)
2. Use Debug class. Put checkpoint in your application and catch them using DebugViewer from Sysinternals.
public sub Something()
   Debug.WriteLine("Entered in Something method");
   //code
   Debug.WriteLine("Exits from Something method")



Make sure that your build configuration is on Debug.
3. Try playing with Application Unhandled Exception
4. Think about what are the differences between those computers where the application works and those where is not. Is .NET 3.5 installed? Maybe you work with SP1 and they don't...
Was This Post Helpful? 1
  • +
  • -

#3 Psyguy  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 76
  • View blog
  • Posts: 326
  • Joined: 12-January 11

Re: Application with Excel export capability - Not working properly

Posted 02 August 2011 - 08:01 AM

Thanks for the ideas. I'll check in once I get some results.
Was This Post Helpful? 0
  • +
  • -

#4 Psyguy  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 76
  • View blog
  • Posts: 326
  • Joined: 12-January 11

Re: Application with Excel export capability - Not working properly

Posted 02 August 2011 - 12:06 PM

Well, it seems it was an easier fix than I thought. Visual Studio had told me that I wasn't using certain assemblies related to the ReportViewer version 10 that needed to be included in the install package since the users were using .NET fw 3.5. Once I added those assemblies back to the references, the program started to work. Thanks for the tips, I appreciate it.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1