473,320 Members | 1,732 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

how to genrate file with .xls format using asp

dear all,

i have to face many problem when i am genrating the excel file.
actually my need is that

i extract the data from data base through sql.
and store the data in excel sheet and this excel sheet is to be store where i want in my system.

plz give me the excet coding for this.

thanks and best regards
saurabh
Oct 26 '07 #1
2 1229
JamieHowarth0
533 Expert 512MB
Hi saurabh,

Your coding requirement is quite specific. Have you made any attempt at coding yourself? If you have, then show us your code and we will point you in the right direction.
If not, then also let us know and I will move this thread to the Jobs forum as it is a specific requirement for your needs that you will (more than likely) have to pay someone to develop for you.

Best regards,

medicineworker
Oct 27 '07 #2
hi medicineworker

right now i make a one control in which the control is genrate one file in CSV formats same as my requirment regarding excel file.
i am giving you the complete coading which i have to use for CSV file.

Expand|Select|Wrap|Line Numbers
  1. <%@ Language=VBScript %>
  2. <%
  3.  
  4.     showdt = "SMS_" & left(fromdate,2) & left(right(fromdate,7),2) & left(right(fromdate,4),4)
  5.  
  6. ' --------------------------
  7. ' CONNECTION
  8. ' --------------------------
  9.  
  10. pth = left(server.MapPath ("connnection.asp"),1)
  11. set con = server.createObject("ADODB.connection")
  12. con.open connectionstr1
  13. con.CommandTimeout = 900
  14. server.scripttimeout = 900
  15.  
  16. clcnt = 1
  17.  
  18.  
  19.  
  20. sql1 = "select Query(which retrive two column) "
  21.  
  22. set RS1 = server.CreateObject ("adodb.recordset") 
  23. rs1.CursorType = adOpenForwardOnly 
  24. rs1.Open sql1,con
  25. if not (rs1.bof and rs1.eof) then
  26.  
  27.  
  28.     Set MyFileObject=Server.CreateObject("Scripting.FileSystemObject")
  29. '    Set MyTextFile=MyFileObject.CreateTextFile("C:\"&showdt&".txt",true)
  30.     Set MyTextFile=MyFileObject.CreateTextFile(pth&":\\inetpub\wwwroot\cgi-bin\RefcoExports\SMS_MarginCall\SMSfiles\"&showdt&".csv",true)
  31.     %>
  32. <HTML>
  33.  
  34. <head>
  35. </head>
  36.  
  37. <BODY >
  38.  
  39.     <%
  40.  
  41.     do while not rs1.EOF 
  42.  
  43.     sms = trim(rs1(0))
  44.  
  45.         variable = sms
  46.  
  47.     MyTextFile.WriteLine(variable) 
  48.  
  49.     rs1.MoveNext 
  50.         if rs1.EOF then
  51.             exit do
  52.         end if
  53.         Loop
  54.  
  55.     MyTextFile.Close
  56.     %>
  57.     <%
  58.     Response.Write "<font size=4 color=blue>File for Custody has been created with filename as <a href=http:SMSfiles/"& showdt &".csv>"& showdt &".csv</a></font>"
  59. else
  60.     con.close
  61.     Response.Write ("<CENTER><BR><BR><BR><P ><B><FONT color=red size=3>ALERT:</FONT><BR><FONT color=darkblue size=2>FILE WAS NOT CREATED AS NO RECORDS WERE FOUND.</FONT></B></CENTER></P>") 
  62. Response.End 
  63. end if 
  64. Response.End 
  65. %>
  66.  
  67. </body>
  68. </HTML>
  69.  



In this coding one csv file is genrated in one folder as well as it also produce one link in which we show the file immediatly and store the file where we want.
Oct 29 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Job Lot | last post by:
how to genrate random colors without repeat of the same color or color code. I am creating a line graph using ComponentOne Chart control and what to show series with different colors. thanx
1
by: Query Builder | last post by:
I am new to BCP. Can anyone help me understand this? I tried searching the BOL but it doesnt show much help on syntex. Lets say I have a simple table and want to out put the records into a file....
0
by: Lokkju | last post by:
I am pretty much lost here - I am trying to create a managed c++ wrapper for this dll, so that I can use it from c#/vb.net, however, it does not conform to any standard style of coding I have seen....
7
by: John Dann | last post by:
I'm trying to read some binary data from a file created by another program. I know the binary file format but can't change or control the format. The binary data is organised such that it should...
1
by: steve | last post by:
Hi all, Here's some work in progress that should allow you to run a batch file as a custom action in a VS deployment project. Yup I know you can use js or wsh, but the target may not have...
9
by: JimmyKoolPantz | last post by:
IDE: Visual Studio 2005 Language: VB.NET Fox Pro Driver Version: 9.0.0.3504 Problem: I currently have a problem altering a DBF file. I do not get any syntax errors when running the program. ...
3
by: forest demon | last post by:
for example, let's say I do something like, System.Diagnostics.Process.Start("notepad.exe","sample.txt"); if the user does a SaveAs (in notepad), how can i capture the path that the user...
5
by: sonu | last post by:
hey good morning ...... how to convert a video file in .flv format in php for linux hosting......is there any package whis provide this facility . Can i use ffmpeg for linux hosting...
5
by: rahullko05 | last post by:
Hi, I am developing forum website as my final year project. I am having problem in generating different URLs but keeping the same page.. Scenario: I am showing threads for different languages in...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.