Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP 3 Classic ASP Active Server Pages 3.0 > Classic ASP Professional
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Classic ASP Professional For advanced coder questions in ASP 3. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Professional section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old July 24th, 2015, 03:03 AM
Registered User
Points: 5, Level: 1
Points: 5, Level: 1 Points: 5, Level: 1 Points: 5, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Mar 2015
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Post Export Report into Excel sheet in ASP page

I have a html report in classic asp using javascript and json using db2 connect database. But I want to create a button like export to excel sheet and while clicking on it the report contains details should display in excel sheet format.

pls help on the same.

my current code like
<HTML><HEAD>
<title> -Report</title>
<META content="text/html; charset=windows-1252" http-equiv=Content-Type>
<STYLE>THEAD {
BORDER-BOTTOM: 0px; BORDER-LEFT: 0px; BACKGROUND: turquoise; BORDER-TOP: 0px; BORDER-RIGHT: 0px; fontWeight: "700"
}
TH {
BACKGRO

<SCRIPT type=text/javascript src="jquery.min.js"></SCRIPT>
<SCRIPT type=text/javascript src="AISServices.js"></SCRIPT>

<SCRIPT language=JavaScript>
....

var mainHeader = .....

var urlCall = IFTAReportServiceURL + param_report + '?date='+ param_date;



$(document).ready(function()
{
// fix for ie 10 - moved this block of code under the ready function
// to make sure the form is loaded before we access form elements
jqxhr = $.getJSON(urlCall, function (data)
{
ReportDataObject=data;
toggleDiv("Waiting");
loadPage();
toggleDiv("DataLoaded");
---
function LoadValues() {

var valrrdd=$("#FSRRDD").val();
..
}
var test=$.grep(ReportDataObject.ReportData.Rows,funct ion(item, i)
{
var retval=false;
var str = item[1]+item[2];
...
}
$("#ReportDisplay").detach();
$("#Results").append(CreateTableView(ReportDataObj ect.ReportData.Header, test));

function CreateTableView(objHeader, objArray) {
--
}

function loadPage()
{

$("#S10").append(ReportDataObject.SearchData.Repor tCode);
$("#S11").append(months[ReportDataObject.SearchData.Month]);
$("#S12").append(ReportDataObject.SearchData.Year) ;
$("#S13").append(ReportDataObject.SearchData.Repor tTimeStamp);
$("#S14").append(ReportDataObject.SearchData.Repor tName);

--

}

like this...

any help on this would be appreciate..
Reply With Quote
  #2 (permalink)  
Old July 26th, 2015, 07:26 PM
Friend of Wrox
Points: 6,664, Level: 34
Points: 6,664, Level: 34 Points: 6,664, Level: 34 Points: 6,664, Level: 34
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2004
Location: Sydney, NSW, Australia.
Posts: 1,870
Thanks: 12
Thanked 20 Times in 20 Posts
Send a message via AIM to mat41
Default

There are loads of examples on how to do this. Have you had a search for classic asp to excel? In short there is one key line which will allow you to do this. As you will see the hundreds of examples out there its this:

Response.ContentType = "application/vnd.ms-excel"

It is important where you put this. here is how I uses it. After my global includes
Code:
<% OPTION EXPLICIT %>
<!-- #include file ="../../scripts/global.inc" -->
<!-- #include file ="../../scripts/functions.inc" -->
<%   Response.ContentType = "application/vnd.ms-excel"
        ...
%>
Also note - You need to remove CSS from the standard included files and place it in the page. Inside style tags in the head of course.....
__________________
Wind is your friend
Matt
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Export Values to Excel Sheet from Sub form ayazhoda Access VBA 3 June 12th, 2012 03:18 PM
Gridview data export to excel sheet abhishekkashyap27 C# 2005 1 August 1st, 2008 10:10 AM
Export data from a datalist to an Excel sheet see07 ASP.NET 1.x and 2.0 Application Design 3 February 23rd, 2007 06:20 PM
Export from Access to Excel in ASP generated page u0107 Classic ASP Basics 1 July 16th, 2006 05:25 AM
Export Image to Excel sheet haribala.raj General .NET 0 September 13th, 2005 11:56 PM



All times are GMT -4. The time now is 09:53 AM.


Powered by vBulletin®
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.