473,811 Members | 3,521 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Export To Excel

Is there a way to export data from a control into excel if the control
is not server side? Do I have to do it with java script or can I do
it inside my VB.NET code?

Feb 9 '07 #1
16 2246
"Doogie" <dn******@dtgne t.comwrote in message
news:11******** **************@ q2g2000cwa.goog legroups.com...
Is there a way to export data from a control into excel if the control
is not server side?
Difficult to say without knowing what control it is... You say it's not a
server-side control, so is it an ActiveX control or a Java applet...?
Do I have to do it with java script or can I do it inside my VB.NET code?
See above.
Feb 9 '07 #2
Difficult to say without knowing what control it is... You say it's not a
server-side control, so is it an ActiveX control or a Java applet...?
It's a control built inside the HTML of the page but it does not have
the runat="server" tag in it. So I don't have a way to access it in
VB.NET.

I'm relatively new to ASP.NET (some training) so am not real sure the
best approach at grabbing this control and it's data.

Here is a sample of what the first part of the control's code looks
like in the HTML. I don't have any way that I can see to grab this
"DataTable" control (and it's data) inside VB.NET:

<table id="DataTable" dataSrc="#Repor tResult" cellSpacing="0"
cellPadding="1" border="1">
<THEAD>
<TR>
<td class="COLHDR2" onclick="SortFi elds('@SomeDBPa rameter')"
width="65">Some DBValue</td>
<td class="COLHDR2" width="70"
onclick="SortFi elds('@AnotherD BParameter')">A notherDBValue</td>

Feb 9 '07 #3
"Doogie" <dn******@dtgne t.comwrote in message
news:11******** **************@ j27g2000cwj.goo glegroups.com.. .
>Difficult to say without knowing what control it is... You say it's not a
server-side control, so is it an ActiveX control or a Java applet...?

It's a control built inside the HTML of the page but it does not have
the runat="server" tag in it.
So what is it, then...???? Where does it come from? What builds it? Where
does it get its data from...?
<table id="DataTable" dataSrc="#Repor tResult" cellSpacing="0"
cellPadding="1" border="1">
<THEAD>
<TR>
<td class="COLHDR2" onclick="SortFi elds('@SomeDBPa rameter')"
width="65">Some DBValue</td>
<td class="COLHDR2" width="70"
onclick="SortFi elds('@AnotherD BParameter')">A notherDBValue</td>
Wow! It's been a while since I've seen anything like that! Is this even
ASP.NET...?
http://msdn.microsoft.com/library/de...es/datasrc.asp

OK, so what is populating the table's dataSrc property...?
Feb 9 '07 #4
You'll have to bear with me. I'm new to ASP.NET and new to this app.
So what is it, then...????
It is a control that is built inside HTML. I'm not sure what else to
say to answer that question.
Where does it come from?
The control? It comes from the HTML side of this page (am I still not
getting the question)?
What builds it?
Again, isn't the HTML inside the page building this control?
Where does it get its data from...?
The data is grabbed from the database and dumped into a dataset. Then
the xml from that dataset is put into a HtmlGenericCont rol object.
However, once I have left the method that does this and do anything
else, that HtmlGenericCont rol object is empty. So I can't figure out
how to get my hands on the data.
Is this even ASP.NET
Yep
OK, so what is populating the table's dataSrc property...?
Same answer as the data question above (I believe anyways)

Feb 9 '07 #5
"Doogie" <dn******@dtgne t.comwrote in message
news:11******** **************@ v33g2000cwv.goo glegroups.com.. .
>Where does it get its data from...?
The data is grabbed from the database and dumped into a dataset. Then
the xml from that dataset is put into a HtmlGenericCont rol object.
Aha - now we're getting somewhere! OK, so you do have access to the
underlying data... So how precisely do you want to export it to Excel...?
You have a few possibilities here... Do you want to display the data in
Excel in a browser window, create a CSV file which the user can download and
display in Excel etc.

What is the purpose of exporting the data to Excel anyway...? Is the user
going to process it in some way...?
Feb 9 '07 #6
So how precisely do you want to export it to Excel...?

I'd like to create it in a csv file.
What is the purpose of exporting the data to Excel anyway...? Is the user
going to process it in some way...?
the user would like to save the data off and process it at a later
time.

Feb 9 '07 #7
So now that we know what I want to do, does anyone know how I can do
it? How do I get ahold of a control that is built in HTML and not set
as server side and do so inside the VB.NET code?

Feb 10 '07 #8
"Doogie" <dn******@dtgne t.comwrote in message
news:11******** **************@ s48g2000cws.goo glegroups.com.. .
So now that we know what I want to do, does anyone know how I can do
it? How do I get ahold of a control that is built in HTML and not set
as server side and do so inside the VB.NET code?
Apologies - I thought you'd got it...

You don't need to "get ahold" of this control at all, as you already have
the data anyway (i.e. the dataset).

All you need to do is add another button to your page which takes the
dataset and does the export. There are tons of examples of the various ways
you can do this:
http://www.google.co.uk/search?sourc...t+export+Excel
Feb 10 '07 #9
Hi Mark, I was kind of figuring that would be an option of mine, to
use the dataset originally returned and can do that easily enough.
However, woudln't there be a performance hit of some kind if I'm
storing the data in a control on the page, and I'm storing the same
data in a dataset in memory? By the way, thank you for your continued
help here. :)
Feb 10 '07 #10

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

Similar topics

1
5042
by: Matt | last post by:
I have an ASP page that calls ASP routines that I created that execute a database query and return the results to a recordset. I then iterate through the recordset and display the data in a table. Before I iterate through the recordset I instruct the browser that the content type is Excel using the following line: (Response.ContentType = "application/vnd.ms-excel") This works fine with Excel 2003 but with older versions (I tested Excel...
5
3793
by: Maria L. | last post by:
Hi, I need to export the content of a DataGrid (in Windows application in C#), into an Excel spreadsheet. Anyone knows how to do this? Any code snippets would help! thanks a lot, Maria
2
4001
by: Siu | last post by:
Hi, I use the following code to export and import a file Excel from resp. into a Web page with the following code: //EXPORT Response.Clear(); Response.Buffer = true; Response.ContentType = "application/vnd.ms-excel"; Response.Charset = ""; this.EnableViewState = false;
6
4071
by: Elena | last post by:
I'm trying to export data to an Excel worksheet. I can export the data in the cell values perfectly. I need the code to change a header and footer for the worksheet, not for the columns. Is this possible? If so, I really need the code immediately. Thank you, Elena
13
13260
by: Hemant Sipahimalani | last post by:
The following piece of code is being used to export HTML to excel. HttpContext.Current.Response.ContentType = "application/vnd.ms-excel" HttpContext.Current.Response.AddHeader("content-disposition", "attachment;filename=ABC.xls") HttpContext.Current.Response.Write(strHTML) HttpContext.Current.Response.End() However when the user tries to save it the Default File Type is Web Page(*.htm; *.html)
5
31929
by: Simon | last post by:
Dear reader, With the export command you can export a query to Excel. By activate this command a form pop's up with the following text:
1
9780
by: smaczylo | last post by:
Hello, I've recently been asked to work with Microsoft Access, and while I feel quite comfortable with Excel, I'm at a complete loss with databases. If someone could help me with this issue I'm having I'd be most appreciative. The database is already constructed, I'm just wanting to export the data to an excel file. In short, I'm hoping to export two Tables (or queries...not sure which to use - they both seem to have the same data) in...
1
10514
by: CoolFactor | last post by:
MY CODE IS NEAR THE BOTTOM I want to export this Access query into Excel using a command button on an Access form in the following way I describe below. Below you will find the simple query I am trying to export to Excel using a command in an Access Form. RowID strFY AccountID CostElementWBS 1 2008 1 7 2 2008 1 7 I want to...
3
7168
by: =?Utf-8?B?YzY3NjIyOA==?= | last post by:
Hi all, I have a question for you. I have a .csv file which has many lines of data. Each line has many data fields which are delimited by ",". Now I need to extract part of data from this file but save it as an excel file. The data in this excel file will be imported into an Access database. The
2
6425
hemantbasva
by: hemantbasva | last post by:
Note We need to have a template on server for generating report in multiple sheet as we do not had msoffice on server moreover this require a batch job to delete excel file created by the method.... it creates 6 sheets # region Namespaces using System;
0
9605
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
10395
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10130
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7667
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6887
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5553
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5692
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3865
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3017
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.