Solved

open excel document in web form using vb.net

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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Suggested Solutions

Introduction When many people think of the WebBrowser (http://msdn.microsoft.com/en-us/library/2te2y1x6%28v=VS.85%29.aspx) control, they immediately think of a control which allows the viewing and navigation of web pages. While this is true, it's a…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

757 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

19 Experts available now in Live!

Get 1:1 Help Now