473,839 Members | 1,390 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

beginning tutorial for exporting data from ASP to Excel

I did a search in this forum, as well as at www.asp.faq.com, and MSDN, and
would like to know how to use ASP to build a report and create an .xls file
as a result.

I've seen lots of tutorials that are for developers who know some basics
that I don't know. Assuming I know ASP, and can use Excel the normal way,
can anyone point me to a tutorial or set of instructions that will get me up
and running?
Jul 22 '05 #1
5 2033
this will get you started
--
Curt Christianson
Site & Scripts: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com
"middletree " <mi********@hto mail.com> wrote in message
news:e9******** ******@TK2MSFTN GP12.phx.gbl...
I did a search in this forum, as well as at www.asp.faq.com, and MSDN, and
would like to know how to use ASP to build a report and create an .xls
file
as a result.

I've seen lots of tutorials that are for developers who know some basics
that I don't know. Assuming I know ASP, and can use Excel the normal way,
can anyone point me to a tutorial or set of instructions that will get me
up
and running?

Jul 22 '05 #2
Ooops...
http://www.darkfalz.com/1085

sorry about that

--
Curt Christianson
Site & Scripts: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com
"middletree " <mi********@hto mail.com> wrote in message
news:e9******** ******@TK2MSFTN GP12.phx.gbl...
I did a search in this forum, as well as at www.asp.faq.com, and MSDN, and
would like to know how to use ASP to build a report and create an .xls
file
as a result.

I've seen lots of tutorials that are for developers who know some basics
that I don't know. Assuming I know ASP, and can use Excel the normal way,
can anyone point me to a tutorial or set of instructions that will get me
up
and running?

Jul 22 '05 #3
Perfect!

Thanks!
"Curt_C [MVP]" <software_AT_da rkfalz.com> wrote in message
news:%2******** ********@TK2MSF TNGP10.phx.gbl. ..
Ooops...
http://www.darkfalz.com/1085

sorry about that

--
Curt Christianson
Site & Scripts: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com
"middletree " <mi********@hto mail.com> wrote in message
news:e9******** ******@TK2MSFTN GP12.phx.gbl...
I did a search in this forum, as well as at www.asp.faq.com, and MSDN, and would like to know how to use ASP to build a report and create an .xls
file
as a result.

I've seen lots of tutorials that are for developers who know some basics
that I don't know. Assuming I know ASP, and can use Excel the normal way, can anyone point me to a tutorial or set of instructions that will get me up
and running?


Jul 22 '05 #4
Hi,

I have written a software component to write new binary xls files from
scratch without using Excel. It is called litXLS and you find it here:
http://www.oraxcel.com/projects/litxls

Gerrit-Jan Linker
Linker IT Software
Jul 22 '05 #5

middletree wrote:
I did a search in this forum, as well as at www.asp.faq.com, and MSDN, and would like to know how to use ASP to build a report and create an ..xls file as a result.


Here's an ASP that I wrote that will help you. Basically, create your
report in HTML, then place a server.execute( "makeexcel.asp" ) (or
whatever you call this program), just before your HTML in the report
file. What makes this good is that you can fine tune your report in
HTML, then add the server.execute and it will convert it to XLS.

Couple of notes: You set session("tablen ame") to whatever XLS filename
you want. There are also a number of settings you use, anything that
calls the DEF function is a session var you can set before executing
this file. In addition, session("rowsto repeat") is a value for the
number of rows in your HTML to repeat at the top of each page.

There are also various styles that I've created that you can use...
<%
response.Buffer = true
Response.Conten tType = "applicatio n/vnd.ms-excel"
Response.AddHea der "Content-Disposition","f ilename=" &
session("tablen ame") &".xls"

function def(val)
if session(val)<>" " then
execute(val &"=" & session(val))
session(val)=""
end if
end function

'-------------default settings-----------------------------------
fitheight=9999
fitwidth=1
orientation="la ndscape"
lmargin=.25
rmargin=.25
tmargin=.25
bmargin=.75
'

def "fitheight"
def "fitwidth"
def "orientatio n"
def "lmargin"
def "rmargin"
def "tmargin"
def "bmargin"

%>
<html xmlns:v="urn:sc hemas-microsoft-com:vml"
xmlns:o="urn:sc hemas-microsoft-com:office:offi ce"
xmlns:x="urn:sc hemas-microsoft-com:office:exce l"
xmlns="http://www.w3.org/TR/REC-html40">
<style>
@page
{margin:<%=lmar gin%>in <%=rmargin%>i n <%=bmargin%>i n <%=tmargin%>i n;
mso-footer-data:"&LPrinted on &D &T&RPage &P of &N";
mso-header-margin:.25in;
mso-footer-margin:.25in;
mso-page-orientation:<%= orientation%>;
mso-horizontal-page-align:center;}
td {font-size:10px;white-space:normal;}
br {mso-data-placement:same-cell;}

..currency { mso-number-format:"_($* #,##0.00_)"}
..currencybold {mso-number-format:"_($* #,##0.00_)";fon t-weight:700;}
..number2dec {mso-number-format: Fixed;}
..number2decbol d {mso-number-format: Fixed; font-weight:700;}
..text {mso-number-format:General; text-align:general;w hite-space:
normal }
..num2text {mso-style-parent:text; mso-number-format:"\@";whi te-space:
normal}

</style>
<xml>
<x:ExcelWorkboo k>
<x:ExcelWorkshe ets>
<x:ExcelWorkshe et>
<x:Name>Sheet 1</x:Name>
<x:WorksheetOpt ions>
<x:DoNotDisplay Gridlines/>
<x:CodeName>She et1</x:CodeName>
<x:FitToPage/>
<x:Print>
<x:ValidPrinter Info/>
<x:Scale>10</x:Scale>
<x:FitHeight><% =fitheight%></x:FitHeight>
<x:FitWidth><%= fitwidth%></x:FitWidth>
<x:HorizontalRe solution>600</x:HorizontalRes olution>
<x:VerticalReso lution>600</x:VerticalResol ution>
</x:Print>
</x:WorksheetOpti ons>
<x:AutoFormatWi dth/>
</x:ExcelWorkshee t>
<x:AutoFormatWi dth/>
</x:ExcelWorkshee ts>

</x:ExcelWorkbook >
<%if session("rowsto repeat")>0 then%>
<x:ExcelName>
<x:Name>Print_T itles</x:Name>
<x:SheetIndex>1 </x:SheetIndex>

<x:Formula>=She et1!$1:$<%=sess ion("rowstorepe at")%></x:Formula>
</x:ExcelName>
<%end if%>
</xml>

Jul 22 '05 #6

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

Similar topics

3
8016
by: Chris | last post by:
Could someone please provide me an effective means of exporting data from a data set (or data grid) to Excel?
3
9251
by: sridevi | last post by:
Hello How to export data from ms-access database to excel worksheet using ASP. mainly i need to export data to multiple worksheets. it is very urgent to us. i have a sample code which works only exporting to single worksheet. but i need to export data to multiple worksheets. it is very urgent to us. so please help me in code.
4
3952
by: D | last post by:
I've created a report with many subreports of aggregate data. I want my client to be able to export this data to Excel to make her charts, etc. Only one problem: one of the fields is a "SchoolYear" TEXT field that contains data such as 2000/01, 2001/02, etc. If I export a Query with this kind of data to Excel, it gives me the text value of this field; however, when I export a Report bound to this TEXT field, Excel gives me the values 36526,...
2
7717
by: G | last post by:
When I export data from access to excel by with "export" or "Analyze with" I seem to loose parts of some fields (long text strings). Is there a way to export it all to excel? Thanks G
4
6189
by: Hitesh | last post by:
Hi, I have three datagrid control on my aspx page and one export to excel button, i want to export all the 3 datagrids contents in one excel file. how can i achive that? -- Thanks Hitesh
2
2313
by: pmud | last post by:
Hi, I am exporting data from an EDITABLE DATA GRID EXCEL. But the 1st column in data grid is Edit Column. I want to display all columns in Excel except for the Edit column. The following code which I am using allows exporting only from text data from data grid & not from Edit columns which are link buttons. How to leave this column while displaying data from data grid in Excel?
2
2418
by: bienwell | last post by:
Hi, I have a question about exporting data from datagrid control into Excel file in ASP.NET. On my Web page, I have a linkbutton "Export data". This link will call a Sub Function to perform exporting ALL data from the datagrid control. Exporting data works fine when I show all data on the datagrid control. I'd like to shows only 30 records on the datagrid control instead of ALL data using page navigation, and perform exporting...
1
6977
by: 333sridhar333 | last post by:
Hi, I am having a problem in exporting a data from jsp to excel. I am getting the values from a servlet and populating it to a JSP. And form there i export them to Excel. The functionality works fine. But the problem is with the exported data. I am having values with leading zeros. for example: Patron Code
2
3585
by: 333sridhar333 | last post by:
Hi, I am having a problem in exporting a data from jsp to excel. I am getting the values from a servlet and populating it to a JSP. And form there i export them to Excel. The functionality works fine. But the problem is with the exported data. I am having values with leading zeros. for example: Patron Code
0
9697
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,...
0
10588
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...
1
10650
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
9426
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...
0
7019
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
5867
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4492
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
2
4065
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3136
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.