Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
Max10128
Starting Member
10 Posts |
Posted - 2006-08-21 : 10:41:24
|
HiIm relatively new to ASP/SQL and have been thrown into the deep end by work. Ive got courses to go on, but not for another 3-6months.Ive got an ASP file calling a database using SQL. Once you hit the "go" button, it puts this data into an Excel file, under a new window (still showing the asp file in the address bar). It currently shows:1)Item numbers that end in "0" i.e. 3.10, 12.20 appear as 3.1 and 12.2 respectively in the Bill of Materials … i.e. being treated as decimals … I need them to show-up as text.************************************************** *******************2)When saving the spreadsheet … it would be good to get "X" to set the default file name to: <Quote ID>_<Customer>_<Platform>_<version>.[xls|pdf]************************************************** *******************3) When a spreadsheet is displayed, it is in an editable Excel format.Is it possible to lock the file automatically when its opened or password protect it? ************************************************** *******************4)If a spreadsheet window is open and you try and open a new one, the old one pops-up/is still there. Need to be able to close the old one and re-open a new one automatically.If necessary i will post the code.Any takers?Thanks |
|
Srinika
Master Smack Fu Yak Hacker
1378 Posts |
Posted - 2006-08-21 : 10:48:45
|
Max10128,The question u have is more related to ASP (not much to do with SQL Server). Thus the forum (New To SQL Server) is not appropriate for ur Q. The SQL Team has a forum called other development tools, but, u might get a better response, if u posted ur Q in an ASP related forum (like CodeGuru)Srinika |
|
|
Max10128
Starting Member
10 Posts |
Posted - 2006-08-21 : 11:03:39
|
HiQuestion 1 is definately SQL based. I have no idea if the last 3 are, or are not.Its been suggested i use "formatnumber", but this will add zeros after the decimal place to every number. And i wouldnt know how to add it in anyway!! ;o)This is what i have so far - just a small section of the code:********************************************itemno = 0objADORS.movefirst Do while Not objADORS.EOF itemno = itemno + 1 bgColor = getBGcolor (objADORS.Fields("MDATE").value, objADORS.Fields("AID").value, objADORS.Fields("isBuildingBlock").value = true, objADORS.Fields("orderable").value <> "n") response.write "<tr>" & vbcrlfresponse.Write "<td align=right>" & itemno & "</td>" & vbcrlf******************************************** |
|
|
Srinika
Master Smack Fu Yak Hacker
1378 Posts |
Posted - 2006-08-21 : 11:27:04
|
There is an SQL solution, however, its better to do in the front end.I think u can use Format function.Something like the following may work :response.Write "<td align=right>" & format(itemno,"0.00") & "</td>" & vbcrlfAgain if it works, its ASPSrinika |
|
|
Max10128
Starting Member
10 Posts |
Posted - 2006-08-21 : 12:00:29
|
Hithanks for the help, but it didnt work.I will continue this dicussion in the "Other Development Tools" section. |
|
|
|
|
|
|
|