473,796 Members | 2,517 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

generate spreadsheet

<% Response.conten ttype = "applicatio n/vnd.ms-excel" %>
<% Response.AddHea der "Content-Disposition", "filename=hardw are.xls" %>

I'm using the above lines to generate a spreadsheet from a recordset. One of
the recordset fields has HTML data. Whenever the spreadsheet is generated,
it will place some of the HTML data into new rows. Same appropriate column,
but different rows. Is there a way around this?

Is there an easy to create a DBF or CSV file that would work?
thanks
Jul 19 '05 #1
11 1744
I'm sure there are other ways to run the command shell, but this freebie has
always worked for me:

see AspExec at:
http://www.serverobjects.com/products.htm#free


"shank" <sh***@tampabay .rr.com> wrote in message
news:Og******** ******@TK2MSFTN GP12.phx.gbl...
<% Response.conten ttype = "applicatio n/vnd.ms-excel" %>
<% Response.AddHea der "Content-Disposition", "filename=hardw are.xls" %>

I'm using the above lines to generate a spreadsheet from a recordset. One of the recordset fields has HTML data. Whenever the spreadsheet is generated,
it will place some of the HTML data into new rows. Same appropriate column, but different rows. Is there a way around this?

Is there an easy to create a DBF or CSV file that would work?
thanks

Jul 19 '05 #2
Sorry - replied to the wrong post !
"Mike Florio" <mi**@micro-point.com> wrote in message
news:10******** *****@corp.supe rnews.com...
I'm sure there are other ways to run the command shell, but this freebie has always worked for me:

see AspExec at:
http://www.serverobjects.com/products.htm#free


"shank" <sh***@tampabay .rr.com> wrote in message
news:Og******** ******@TK2MSFTN GP12.phx.gbl...
<% Response.conten ttype = "applicatio n/vnd.ms-excel" %>
<% Response.AddHea der "Content-Disposition", "filename=hardw are.xls" %>

I'm using the above lines to generate a spreadsheet from a recordset. One
of
the recordset fields has HTML data. Whenever the spreadsheet is

generated, it will place some of the HTML data into new rows. Same appropriate

column,
but different rows. Is there a way around this?

Is there an easy to create a DBF or CSV file that would work?
thanks


Jul 19 '05 #3
I never trusted this method and whereas CSVs don't have the "bells n
whistles" of an XLS, if all you want is data in a tabular file... CSV has to
be the format...

you can do this *really* easily just open "myfile.csv " with the FSO and
right your data seperated by commas... remember that if your data has vommas
in it, you'll have to translate them before writing out or enclose the
offending string in ""

the code I use (highly chopped and I use unixtime and session ID to make a
unique filename)

Set trs = Server.CreateOb ject("ADODB.Rec ordset")
trs.open sql, objconn ,3 ,3
alldata=trs.Get Rows

strPathInfo = "TempCSV/" & session("sessio nid") & Datediff("s",
"1/1/1970",now) & ".csv"
strPhysicalPath = Server.MapPath (strPathInfo)
set fs=Server.Creat eObject("Script ing.FileSystemO bject")
set f=fs.OpenTextFi le(strPhysicalP ath,8,true,Tris tateFalse)

for n=0 to ubound(alldata, 2)
ln=""
for m=0 to ubound(alldata, 1)
ln=ln & chr(34) & trim(alldata(m, n)) & chr(34) & ","
next
f.WriteLine(ln)
next

f.close
objconn.close
Set objconn = nothing
Set trs = nothing
set fs=nothing
set f=nothing

H

"shank" <sh***@tampabay .rr.com> wrote in message
news:Og******** ******@TK2MSFTN GP12.phx.gbl...
<% Response.conten ttype = "applicatio n/vnd.ms-excel" %>
<% Response.AddHea der "Content-Disposition", "filename=hardw are.xls" %>

I'm using the above lines to generate a spreadsheet from a recordset. One of the recordset fields has HTML data. Whenever the spreadsheet is generated,
it will place some of the HTML data into new rows. Same appropriate column, but different rows. Is there a way around this?

Is there an easy to create a DBF or CSV file that would work?
thanks

Jul 19 '05 #4
"shank" <sh***@tampabay .rr.com> wrote in message
news:Og******** ******@TK2MSFTN GP12.phx.gbl...
<% Response.conten ttype = "applicatio n/vnd.ms-excel" %>
<% Response.AddHea der "Content-Disposition", "filename=hardw are.xls" %>

I'm using the above lines to generate a spreadsheet from a recordset. One of the recordset fields has HTML data. Whenever the spreadsheet is generated,
it will place some of the HTML data into new rows. Same appropriate column, but different rows. Is there a way around this?


Write out all of your content into an HTML table.

--
Tom Kaminski IIS MVP
http://www.iistoolshed.com/ - tools, scripts, and utilities for running IIS
http://mvp.support.microsoft.com/
http://www.microsoft.com/windowsserv...y/centers/iis/

Jul 19 '05 #5
"shank" wrote:

<% Response.conten ttype = "applicatio n/vnd.ms-excel" %> ...

...One of the recordset fields has HTML data. Whenever the
spreadsheet is generated, it will place some of the HTML
data into new rows. Same appropriate column, but different
rows. Is there a way around this?


Server.HTMLEnco de(RS.Fields("y ourField")Value ) ?
--
Dave Anderson

Unsolicited commercial email will be read at a cost of $500 per message. Use
of this email address implies consent to these terms. Please do not contact
me directly or ask me to contact you directly for assistance. If your
question is worth asking, it's worth posting.
Jul 19 '05 #6
Server.HTMLEnco de helped stop some of the new rows, but creates another
problem. In my database I have a text field that contains HTML formatted
data for hardware specs. It includes the whole gamut of HTML syntax:
<li><ul><p><br> , etc etc etc. What I was hoping to do is export that field
into an excel cell so that a user can cut-n-paste straight into their own
pages.

How do I do that?
thanks!

"Dave Anderson" <GT**********@s pammotel.com> wrote in message
news:Of******** ******@TK2MSFTN GP10.phx.gbl...
"shank" wrote:

<% Response.conten ttype = "applicatio n/vnd.ms-excel" %> ...

...One of the recordset fields has HTML data. Whenever the
spreadsheet is generated, it will place some of the HTML
data into new rows. Same appropriate column, but different
rows. Is there a way around this?
Server.HTMLEnco de(RS.Fields("y ourField")Value ) ?
--
Dave Anderson

Unsolicited commercial email will be read at a cost of $500 per message.

Use of this email address implies consent to these terms. Please do not contact me directly or ask me to contact you directly for assistance. If your
question is worth asking, it's worth posting.

Jul 19 '05 #7

"Tom Kaminski [MVP]" <tomk (A@T) mvps (D.O.T) org> wrote in message
news:bu******** **@kcweb01.netn ews.att.com...
"shank" <sh***@tampabay .rr.com> wrote in message
news:Og******** ******@TK2MSFTN GP12.phx.gbl...
<% Response.conten ttype = "applicatio n/vnd.ms-excel" %>
<% Response.AddHea der "Content-Disposition", "filename=hardw are.xls" %>

I'm using the above lines to generate a spreadsheet from a recordset. One
of
the recordset fields has HTML data. Whenever the spreadsheet is

generated, it will place some of the HTML data into new rows. Same appropriate

column,
but different rows. Is there a way around this?


Write out all of your content into an HTML table.

--
Tom Kaminski IIS MVP

I'm not sure what you mean by writing to a table. I have a database field
with text data that includes HTML formatting. I'm trying to drop a that
field into an excel cell so another user can cut-n-paste into their own
pages without having to change anything. How an I get that done? There's
some 150+ products that will be generated into the spreadsheet. 1 product
per each row.
thanks
Jul 19 '05 #8
"shank" <sh***@tampabay .rr.com> wrote in message
news:%2******** ********@TK2MSF TNGP11.phx.gbl. ..

"Tom Kaminski [MVP]" <tomk (A@T) mvps (D.O.T) org> wrote in message
news:bu******** **@kcweb01.netn ews.att.com...
"shank" <sh***@tampabay .rr.com> wrote in message
news:Og******** ******@TK2MSFTN GP12.phx.gbl...
<% Response.conten ttype = "applicatio n/vnd.ms-excel" %>
<% Response.AddHea der "Content-Disposition", "filename=hardw are.xls" %>
I'm using the above lines to generate a spreadsheet from a recordset. One
of
the recordset fields has HTML data. Whenever the spreadsheet is

generated, it will place some of the HTML data into new rows. Same appropriate

column,
but different rows. Is there a way around this?


Write out all of your content into an HTML table.

--
Tom Kaminski IIS MVP

I'm not sure what you mean by writing to a table. I have a database field
with text data that includes HTML formatting. I'm trying to drop a that
field into an excel cell so another user can cut-n-paste into their own
pages without having to change anything. How an I get that done? There's
some 150+ products that will be generated into the spreadsheet. 1 product
per each row.


Each table cell will equate to an Excel cell when you open the page ...

--
Tom Kaminski IIS MVP
http://www.iistoolshed.com/ - tools, scripts, and utilities for running IIS
http://mvp.support.microsoft.com/
http://www.microsoft.com/windowsserv...y/centers/iis/

Jul 19 '05 #9

"Tom Kaminski [MVP]" <tomk (A@T) mvps (D.O.T) org> wrote in message
news:bu******** **@kcweb01.netn ews.att.com...
"shank" <sh***@tampabay .rr.com> wrote in message
news:%2******** ********@TK2MSF TNGP11.phx.gbl. ..

"Tom Kaminski [MVP]" <tomk (A@T) mvps (D.O.T) org> wrote in message
news:bu******** **@kcweb01.netn ews.att.com...
"shank" <sh***@tampabay .rr.com> wrote in message
news:Og******** ******@TK2MSFTN GP12.phx.gbl...
> <% Response.conten ttype = "applicatio n/vnd.ms-excel" %>
> <% Response.AddHea der "Content-Disposition", "filename=hardw are.xls" %> >
> I'm using the above lines to generate a spreadsheet from a
recordset. One
of
> the recordset fields has HTML data. Whenever the spreadsheet is generated,
> it will place some of the HTML data into new rows. Same appropriate
column,
> but different rows. Is there a way around this?

Write out all of your content into an HTML table.

--
Tom Kaminski IIS MVP

I'm not sure what you mean by writing to a table. I have a database field with text data that includes HTML formatting. I'm trying to drop a that
field into an excel cell so another user can cut-n-paste into their own
pages without having to change anything. How an I get that done? There's
some 150+ products that will be generated into the spreadsheet. 1 product per each row.


Each table cell will equate to an Excel cell when you open the page ...

--
Tom Kaminski IIS MVP
http://www.iistoolshed.com/ - tools, scripts, and utilities for running

IIS http://mvp.support.microsoft.com/
http://www.microsoft.com/windowsserv...y/centers/iis/


I still lose all my HTML tags. A user cannot cut-n-paste into their pages
keeping HTML tags intact. Here's an example of exactly what I would like to
have inthe excel cell...

<ul>
<li>Height 142 - 260cm (56" - 102")
<li>Top Aluminum Tube Diameter 38mm (1.50")
<li>Weight 3.0Kg (6.60lb)
<li>Load Capacity 50Kg (110lb)</li></ul>

Presently, all my tags are gone and only the text shows in the cells. I need
the above contents intact.
thanks
Jul 19 '05 #10

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

Similar topics

2
7380
by: Fabio | last post by:
Hello, there's a module called Spreadsheet::WriteExcel. It allows me to create a new worksheet and edit its cells: my $workbook = Spreadsheet::WriteExcel->new('my.xls'); my $worksheet = $workbook->addworksheet(); $worksheet -> write('A2', 222); But how can I put some values into the cells of an existing worksheet?
3
2288
by: Brooke | last post by:
I am new to ASP.NET, but have been programming for about 14 years (C# about 2 years). My manager asked me to develop a web application that would allow employees to view a spreadsheet that is used to manage resources (projects, employees, hours, dates, etc). The employee should only be able to view data that pertains to them, and not be able to modify it (read only view). My thought is to allow my manager to upload the spreadsheet to a...
1
1338
by: Niclas | last post by:
Hi, I am looking to develop a Windows Forms application that collects some user information and then as a final step generates a simple Excel spreadsheet based on the input. I am using Visual Studio 2005 (VB) and have the Office Development Tools installed. Is the programmatic way to generate a spreadsheet the same as the COM model used with Visual studio 2003 ? If anyone have a sample to how to do this the correct way, it would be...
1
1687
by: lennyw | last post by:
Hi I'm trying to use XSLT to do an xml to xml transformation where the output xml contains summary data on the information in the input xml. I've succesfully done a Muenchian grouping of the data from the input xml file, but I can't see how to operate on the grouped result to create and output the desired summary data. If someone could give a reference to an example or provide an actual example I'd really apprecaite it.
3
5523
by: Maxwell2006 | last post by:
Hi, We have Excel 2003 templates and we need to automatically generate excel 2003 xls files based on our SQL server database tables' data. Since we need to generate the xls files at out asp.net server side, I assume we cannot use excel automation based on the license agreement. What would b the best way to do that? Any help would be appreciated,
0
5094
by: mix01 | last post by:
Hi, I am trying to get some VBA code working, but am preplex as to why it does not work. I would really appreciate any level of help. Many thanks, Mix01 Version of the program
1
1835
by: platski | last post by:
I have learned a bit about vb recently and have been using it for my job, I still have questions and dont know how to do many things yet. I appreciate your time and efforts and hopefully I can figure out how to make this procedure work. This is all taking place in vb6 and excel 2003. I am making a userform that is activated once the user highlights a bit of spreadsheet and clicks a button on the command bar, here is what I want it to...
8
9438
by: Perl Beginner | last post by:
I am using Win32. I have created an excel spreadsheet, formatted the columns and rows, and would like to write to the cells…all of this using Spreadsheet::WriteExcel. My issue is, my script is very vast with a lot of subroutines, but I need the excel spreadsheet created in the main subroutine becasue this is where the data is that i want to capture. So if I create and format the spreadsheet within the main subroutine, and as it loops through,...
0
2211
by: dutsnekcirf | last post by:
Okay, I think this one is a really hard one for yous geniuses out there. I'm going to try my best to explain in as much detail as I can. And for the most part I just want to know if I'm doing this the right way of it there's an easier way to do it. Background/Platform: Windows XP Office Excel 2007 Visual Studio Tools for Office 2008 Document level customization VB.Net I have a spreadsheet that is used to project which site(s) a...
0
9684
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10236
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10017
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...
0
9055
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7552
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
6793
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
5577
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4120
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2928
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.