473,322 Members | 1,522 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

Help with this eror.. (Dataset as excel..)

yyt
I am programmatically adding a web user control to a webform. This User
Control displays the employee listing from a database into a datagrid. But
the calling webform should render the data as a excel spreadsheet.
I had the same logic working when the app had a simple web form with a
datagrid embedded in it. But it gives error when I separate the logic into a
pagelet. Below are the details:

=========
Code:
webform1.aspx
<%@ Page ....%>
<%@ Reference Control ="~/emplist.ascx"%>
<!DOCType....>
<html>
<head>
<link href="../styles.css" rel="stylesheet" type="text/css">
</head>
<body>
<form id="Test" method="post" runat="server"></form>
</body>
</html>

webform1.aspx.vb
private sub Page_Load(Byval sender as System.object, ...)
response.contenttype = "application/ms-excel"
response.AddHeader("Content-Disposition","inline;filename=emplist.xls")

dim sPath as string = "~/modules/emplist.ascx"
dim c1 as Control = LoadControl(sPath)
dim objForm as Control = Page.FindControl('Test") ' pass the name
of the form
objForm.Controls.Add(c1)
end sub

emplist.ascx: has a datagrid and the binds a dataset in the page_load event.

Error:
"Microsoft Excel" error prompt: Unable to read file.
"HTML Import Errors" prompt:
Problems came us in the following areas during load:
Missing fle: ...\Local Settings\Temporary Internet
Files\Content.IE5\styles.css
=========

Is there a better ( and easier ) approach to the above?

Thanks
yyt

Nov 17 '05 #1
0 1150

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Luther Miller | last post by:
I am using an XSLT file to convert data in a DataSet to XMLSS format for opening in Excel. Excel doesn't like the way Dates in the DataSet are being ouput. It appears that a timezone offset is...
7
by: kscdavefl | last post by:
I am running the following code to retrieve a DataSet: public DataView CreateGroupSource() { string groupConnect = Session.ToString(); string groupSelect = "Select grpname from Maxusergroups...
1
by: ad | last post by:
I used the code below to export a table in a dataset to Excel. It can export only on table at a time. Can export more than on table in a dataset to Excel public static void...
12
by: Ed | last post by:
Hi All, I'm looking for an efficient way of dumping a table in a Dataset into an Excel sheet. I'm currently copying data cell by cell and this is rather inefficient for large Datasets. My...
3
by: Sachin Salgarkar | last post by:
I have a DataSet that I need to export to Excel. The dataset has multiple tables. I need a way to export the complete dataset to a single Excel Workbook with sheets for each table in the dataset....
1
by: Coleen | last post by:
To export data from a datagrid to an excel file. I am using VB.net/ASP.net v 2003, and not connecting to an SQL database. I have an existing datagrid that I want to get the data from and download...
2
by: mesutalturk | last post by:
i need your help some eror when i convert is VBS code to Delphi. thats eror code is = For Each objItem in colItems objItem.AddExtensionFile _ "C:\dene.exe", True, _ "BITSEXT", True, "BITS...
5
by: AAJ | last post by:
Hi all FIRST THE BORING BITS....... I normally use a Database layer, a Business layer and a GUI layer. The GUI uses an Object data source to bind to the Business layer which in turn binds...
1
by: ISATownsME | last post by:
HELLO world, this is my first post and heres my problem. I have an excel spreadsheet with 22 columns, and undefined amount of rows. I need vb.net to read the data from excel. Then use that data to...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.