Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

export from ASP to excel

Posted on 2003-03-19
4
Medium Priority
?
288 Views
Last Modified: 2008-02-01
Hi
I could export the data from ASP to excel sheet

but problem is width adjustment.
since each of my field name is quite big i am unable to control width of
my excel sheet.

I tried with <table width = 10%> also but it is not taking.

If we are in excel sheet we have option format --> column --> width
how to adjust this width in excel sheet?
I am exporting data by content type.

thanks

swap
0
Comment
Question by:swapnilv
3 Comments
 

Accepted Solution

by:
Zelja earned 252 total points
ID: 8165629
Hi,
well I am not sure how far excel files can be manipulated by pure ASP, I usually use VB com objects to manipulate with excel file.
There are 2 possibilities, get some object for example www.softartisans.com - Excel Writer
or code your own..here is a helpfull link from msdn:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/modcore/html/deovrunderstandingexcelapplicationobject.asp

regards.
Zeljko
0
 

Assisted Solution

by:maldo
maldo earned 248 total points
ID: 8166891
Swap,

Are you exporting the data directly from the ASP using the Excel Object Library and SQL/Access or some other database?  If so, try something like this:

Set ExcelApplication = Server.CreateObject( "Excel.Application" )

ExcelApplication.Visible = False

ExcelApplication.Workbooks.Add

Set ExcelWorksheet = ExcelApplication.Worksheets( 1 )

ExcelWorksheet.Range( "A1:F1" ).ColumnWidth = Array( 14.86, 35.71, 33.14, 16.14, 16.14, 16.14 )

The values you set in the array will control the column width for the range you have specified.  Hope this helps.

maldo
0
 
LVL 58

Expert Comment

by:Gary
ID: 9315780
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

Split Points - maldo / Zelja

Please leave any comments here within the next seven days.
 
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
 
GaryC123
EE Cleanup Volunteer
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I have helped a lot of people on EE with their coding sources and have enjoyed near about every minute of it. Sometimes it can get a little tedious but it is always a challenge and the one thing that I always say is:   The Exchange of informatio…
I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
Integration Management Part 2
When cloud platforms entered the scene, users and companies jumped on board to take advantage of the many benefits, like the ability to work and connect with company information from various locations. What many didn't foresee was the increased risk…
Suggested Courses

571 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question