Solved

open excel document in web form using vb.net

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

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…
Internet Business Fax to Email Made Easy - With  eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, f…
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

920 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

15 Experts available now in Live!

Get 1:1 Help Now