Solved

open excel document in web form using vb.net

Posted on 2013-01-08
4
622 Views
Last Modified: 2013-01-08
Having issues trying to open an excel document on a web form. The excel document is loading via a datatable. This works perfect on my dev pc running the vs2008 web application, but when I try to publish to the web, it gives me an error trying to save the document because it is in use by another program. I've tried using ClosedXML to do this along with the excel interop. Both are having issues because I'm trying to save the document to the server before opening the document. Is there any way to just open a excel document and fill it from a dataset or datatable with out having to save the document first before opening it in vb.net web form?
0
Comment
Question by:jeremyzit
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 83

Accepted Solution

by:
CodeCruiser earned 500 total points
ID: 38755042
>before opening it in vb.net web form?

Are you sending this document to client?

http://www.aspsnippets.com/Articles/Export-DataSet-or-DataTable-to-Word-Excel-PDF-and-CSV-Formats.aspx
0
 

Author Comment

by:jeremyzit
ID: 38755390
Tried above link. Looks like it will work, but when it runs this code "GridView1.RenderControl(hw)", it gives an exception of "Control 'gridview1' of type 'GridView' must be placed inside a form tag with runat=server." I've tried to disable sorting and paging and that doesn't work. I've also tried pasting
Public Overridable Sub VerifyRenderingInServerForm ( _
      control As Control _
)
and it will not let me use this because it's not inside of the method. Where should I put that in code or is there another fix?
0
 
LVL 83

Expert Comment

by:CodeCruiser
ID: 38755474
Put this within the same code behind class

Public Overrides Sub VerifyRenderingInServerForm ( control As Control )

End Sub
0
 

Author Closing Comment

by:jeremyzit
ID: 38755990
Worked Great, thanks for your help.
0

Featured Post

Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: jpaulino
XML Literals are a great way to handle XML files and the community doesn’t use it as much as it should.  An XML Literal is like a String (http://msdn.microsoft.com/en-us/library/system.string.aspx) Literal, only instead of starting and ending with w…
Microsoft Reports are based on a report definition, which is an XML file that describes data and layout for the report, with a different extension. You can create a client-side report definition language (*.rdlc) file with Visual Studio, and build g…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question