Solved

open excel document in web form using vb.net

Posted on 2013-01-08
4
614 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
  • 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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

Suggested Solutions

A while ago, I was working on a Windows Forms application and I needed a special label control with reflection (glass) effect to show some titles in a stylish way. I've always enjoyed working with graphics, but it's never too clever to re-invent …
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…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, just open a new email message. In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …

816 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

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now