.NET Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgramming.NET Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old May 21st, 2001, 01:21 AM
Steve Schofield Steve Schofield is offline
Contributing User
ASP Free God 20th Plane (14500 - 14999 posts)
 
Join Date: Dec 2002
Posts: 14,575 Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 22
Dynamic Dropdown and producing a report

<i><b>Originally posted by : V. Vivek (vilsa@hotmail.com)</b></i><br />Hi,<br /><br />I'm fairly new to asp, I am currently creating a form in which the fields are filled by selecting from<br />a dropdown menu, whose options have to come from a field in my database (Access)<br /><br />ie. Last Name: the Dropdown menu should list all last names in the field in my db. <br /><br />Secondly, when the form is filled and I hit submit, it shoul create a report made of all the information<br />I submitted ie:<br /><br />Last Name: Vivek First Name: Veena<br />Address: #2001 - Hello Avenue.<br /><br />Is anyone aware of any scripts that can do this? And how do I bind the script to the button?<br /><br />Any help in this would be very much appreciated<br />Veena

Reply With Quote
  #2  
Old May 25th, 2001, 04:15 AM
Steve Schofield Steve Schofield is offline
Contributing User
ASP Free God 20th Plane (14500 - 14999 posts)
 
Join Date: Dec 2002
Posts: 14,575 Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 22
<i><b>Originally posted by : Deepak Adke (deepakadke@hotmail.com)</b></i><br />Hope the following code will solve u r purpose<br /><br />function createTxtFile()<br />SQL = ""<br />SQL = SQL & "SELECT C.Util_Comp_Name,C.Util_Co_Mailing,C.Util_Co_Stree t,C.Util_Co_Email,"<br />SQL = SQL & "C.Util_Co_City,C.Util_Co_State,C.Util_Co_Zip,U.Uti lity_Type_Description,"<br /> SQL = SQL & "O.Outage_Issue_Description,M.*,D.* "<br /> SQL = SQL & "from UTIL_COMPANY_MASTER C,UTILITY_TYPE U,OUTAGE_ISSUE O,"<br /> SQL = SQL & "OUTAGE_REPORT_MASTER M,OUTAGE_REPORT_DETAIL D where U.Util_Type_Id = M.Util_Type_Id "<br /> SQL = SQL & " and O.Outage_Issue_Id = M.Outage_Issue_Id "<br /> SQL = SQL & " and M.Outage_No = D.Outage_No and "<br /> SQL = SQL & "C.Util_Co_Id = M.Util_Co_Id and ltrim(rtrim(M.Outage_No)) = '" & trim(out_no) & "'"<br /><br />set rsHtml = server.createobject("Adodb.recordset")<br />response.write sql<br />rsHtml.open sql,conn,0,1<br /><br />if not rsHtml.eof then<br /><br />'****************************** store for further reference --- creating work item *********<br /> utility_desc = rsHtml("Utility_Type_Description")<br /> outage_desc = rsHtml("Outage_Issue_Description")<br /><br /> GenHtml = ""<br /> GenHtml = "<html>"<br /> GenHtml = GenHtml & "<head>"<br /> GenHtml = GenHtml & "<title>Missouri Public Service Commission</title>"<br /> GenHtml = GenHtml & "</head>"<br /> GenHtml = GenHtml & "<body>"<br /> GenHtml = GenHtml & "<p align='center'><u><b><font size='4' color='#000080'>Missouri Public Service Commission<br>"<br /> GenHtml = GenHtml & "</font></b></u></p>"<br /> GenHtml = GenHtml & "<div align='center'>"<br /> GenHtml = GenHtml & "<center>"<br /> GenHtml = GenHtml & "<table border='0' width='80%'>"<br /> GenHtml = GenHtml & "<tr>"<br /> GenHtml = GenHtml & "<td width='25%'><b>Utility Type :</b></td>"<br /> GenHtml = GenHtml & "<td width='25%'>" & rsHtml("Utility_Type_Description") & "</td>"<br /> GenHtml = GenHtml & "<td width='25%'><b>Outage Issue :</b></td>"<br /> GenHtml = GenHtml & "<td width='25%'>" & rsHtml("Outage_Issue_Description") & "</td>"<br /> GenHtml = GenHtml & "</tr>"<br /> GenHtml = GenHtml & "<tr>"<br /> GenHtml = GenHtml & "<td width='25%'><b>Outage Date :</b></td>"<br /> GenHtml = GenHtml & "<td width='25%'>" & rsHtml("Outage_Date") & "</td>"<br /> GenHtml = GenHtml & "<td width='25%'><b>Reporting Date :</b></td>"<br /> GenHtml = GenHtml & "<td width='25%'>" & rsHtml("Outage_Date") & "</td>"<br /> GenHtml = GenHtml & "</tr>"<br /> GenHtml = GenHtml & "<tr>"<br /> GenHtml = GenHtml & "<td width='25%'><b>Outage Time :</b></td>"<br /> GenHtml = GenHtml & "<td width='25%'>" & rsHtml("Outage_Date") & "</td>"<br /> GenHtml = GenHtml & "<td width='25%'><b>Reporting Time :</b></td>"<br /> GenHtml = GenHtml & "<td width='25%'>" & rsHtml("Rpt_Date") & "</td>"<br /> GenHtml = GenHtml & "</tr>"<br /> GenHtml = GenHtml & " <tr>"<br /> GenHtml = GenHtml & "<td width='25%'> </td>"<br /> GenHtml = GenHtml & "<td width='25%'> </td>"<br /> GenHtml = GenHtml & "<td width='25%'> </td>"<br /> GenHtml = GenHtml & "<td width='25%'> </td>"<br /> GenHtml = GenHtml & "</tr>"<br /> GenHtml = GenHtml & "<tr>"<br /> GenHtml = GenHtml & "<td width='25%'><b>Utility Company :</b></td>"<br /> GenHtml = GenHtml & "<td width='25%'>" & rsHtml("Util_Comp_Name") & "</td>"<br /> GenHtml = GenHtml & "<td width='25%'> </td>"<br /> GenHtml = GenHtml & "<td width='25%'> </td>"<br /> GenHtml = GenHtml & "</tr>"<br /> GenHtml = GenHtml & "<tr>"<br /> GenHtml = GenHtml & "<td width='25%'> </td>"<br /> GenHtml = GenHtml & "<td width='25%'> </td>"<br /> GenHtml = GenHtml & "<td width='25%'> </td>"<br /> GenHtml = GenHtml & "<td width='25%'> </td>"<br /> GenHtml = GenHtml & "</tr>"<br /> GenHtml = GenHtml & "<tr>"<br /> GenHtml = GenHtml & "<td width='25%'><b>City Affected :</b></td>"<br /> GenHtml = GenHtml & "<td width='25%'>" & rsHtml("City_Affected") & "</td>"<br /> GenHtml = GenHtml & "<td width='25%'> </td>"<br /> GenHtml = GenHtml & "<td width='25%'> </td>"<br /> GenHtml = GenHtml & "</tr>"<br /> GenHtml = GenHtml & "<tr>"<br /> GenHtml = GenHtml & "<td width='25%'><b>Location Affected :</b></td>"<br /> GenHtml = GenHtml & "<td width='25%'>" & rsHtml("Location_Affected") & "</td>"<br /> GenHtml = GenHtml & "<td width='25%'> </td>"<br /> GenHtml = GenHtml & "<td width='25%'> </td>"<br /> GenHtml = GenHtml & "</tr>"<br /> GenHtml = GenHtml & "<tr>"<br /> GenHtml = GenHtml & "<td width='25%'><b>County Affected :</b></td>"<br /> GenHtml = GenHtml & "<td width='25%'>" & rsHtml("County_Affected") & "</td>"<br /> GenHtml = GenHtml & "<td width='25%'> </td>"<br /> GenHtml = GenHtml & "<td width='25%'> </td>"<br /> GenHtml = GenHtml & "</tr>"<br /> GenHtml = GenHtml & "<tr>"<br /> GenHtml = GenHtml & "<td width='25%'> </td>"<br /> GenHtml = GenHtml & "<td width='25%'> </td>"<br /> GenHtml = GenHtml & "<td width='25%'> </td>"<br /> GenHtml = GenHtml & "<td width='25%'> </td>"<br /> GenHtml = GenHtml & "</tr>"<br /> GenHtml = GenHtml & "<tr>"<br /> GenHtml = GenHtml & "<td width='25%'><b>Reporting Party </b></td>"<br /> GenHtml = GenHtml & "<td width='25%'> </td>"<br /> GenHtml = GenHtml & "<td width='25%'><b>Contact Name</b></td>"<br /> GenHtml = GenHtml & "<td width='25%'> </td>"<br /> GenHtml = GenHtml & "</tr>"<br /> GenHtml = GenHtml & "<tr>"<br /> GenHtml = GenHtml & "<td width='25%'> </td>"<br /> GenHtml = GenHtml & "<td width='25%'> </td>"<br /> GenHtml = GenHtml & "<td width='25%'> </td>"<br /> GenHtml = GenHtml & "<td width='25%'> </td>"<br /> GenHtml = GenHtml & "</tr>"<br /> GenHtml = GenHtml & "<tr>"<br /> GenHtml = GenHtml & "<td width='25%'><b>First Name :</b></td>"<br /> GenHtml = GenHtml & "<td width='25%'>" & rsHtml("Rpt_First_Name") & "</td>"<br /> GenHtml = GenHtml & "<td width='25%'><b>First Name</b></td>"<br /> GenHtml = GenHtml & "<td width='25%'>" & rsHtml("Cont_First_Name") & "</td>"<br /> GenHtml = GenHtml & "</tr>"<br /> GenHtml = GenHtml & "<tr>"<br /> GenHtml = GenHtml & "<td width='25%'><b>Middle Initial :</b></td>"<br /> GenHtml = GenHtml & "<td width='25%'>" & rsHtml("Rpt_Middle_Initial") & "</td>"<br /> GenHtml = GenHtml & "<td width='25%'><b>Middle Initial :</b></td>"<br /> GenHtml = GenHtml & "<td width='25%'>" & rsHtml("Cont_Middle_Initial") & "</td>"<br /> GenHtml = GenHtml & "</tr>"<br /> GenHtml = GenHtml & "<tr>"<br /> GenHtml = GenHtml & "<td width='25%'><b>Last Name :</b></td>"<br /> GenHtml = GenHtml & "<td width='25%'>" & rsHtml("Rpt_Last_Name") & "</td>"<br /> GenHtml = GenHtml & "<td width='25%'><b>Last Name</b></td>"<br /> GenHtml = GenHtml & "<td width='25%'>" & rsHtml("Cont_Last_Name") & "</td>"<br /> GenHtml = GenHtml & "</tr>"<br /> GenHtml = GenHtml & "<tr>"<br /> GenHtml = GenHtml & "<td width='25%'><b>Phone No. :</b></td>"<br /> GenHtml = GenHtml & "<td width='25%'>" & rsHtml("Rpt_Tel") & "</td>"<br /> GenHtml = GenHtml & "<td width='25%'><b>Phone/Cellular :</b></td>"<br /> GenHtml = GenHtml & "<td width='25%'>" & rsHtml("Cont_Tel") & "</td>"<br /> GenHtml = GenHtml & "</tr>"<br /> GenHtml = GenHtml & "<tr>"<br /> GenHtml = GenHtml & "<td width='25%'><b>Email :</b></td>"<br /> GenHtml = GenHtml & "<td width='25%'>" & rsHtml("Rpt_Email") & "</td>"<br /> GenHtml = GenHtml & "<td width='25%'> </td>"<br /> GenHtml = GenHtml & "<td width='25%'> </td>"<br /> GenHtml = GenHtml & "</tr>"<br /> GenHtml = GenHtml & "<tr>"<br /> GenHtml = GenHtml & "<td width='25%'></td>"<br /> GenHtml = GenHtml & "<td width='25%'> </td>"<br /> GenHtml = GenHtml & "<td width='25%'> </td>"<br /> GenHtml = GenHtml & "<td width='25%'> </td>"<br /> GenHtml = GenHtml & "</tr>"<br /> GenHtml = GenHtml & "<tr>"<br /> GenHtml = GenHtml & "<td width='50%' colspan='2' align='center' ><b>Outage Description :</b></td>"<br /> GenHtml = GenHtml & "<td width='25%'><b>Customer Affected :</b></td>"<br /> GenHtml = GenHtml & "<td width='25%'>" & rsHtml("Outage_Description") & "</td>"<br /> GenHtml = GenHtml & "</tr>"<br /> GenHtml = GenHtml & "<tr>"<br /> GenHtml = GenHtml & "<td width='50%' colspan='2' rowspan='2' >" & rsHtml("Exp_Date_Restoral") & "</td>"<br /> GenHtml = GenHtml & "<td width='25%'><b>Restoration Date :</b></td>"<br /> GenHtml = GenHtml & "<td width='25%'>" & rsHtml("Exp_Date_Restoral") & "</td>"<br /> GenHtml = GenHtml & "</tr>"<br /> GenHtml = GenHtml & "<tr>"<br /> GenHtml = GenHtml & "<td width='25%'><b>Restoration Time :</b></td>"<br /> GenHtml = GenHtml & "<td width='25%'>" & rsHtml("Exp_Time_Restoral") & "</td>"<br /> GenHtml = GenHtml & "</tr>"<br /> GenHtml = GenHtml & "</table>"<br /> GenHtml = GenHtml & "</center>"<br /> GenHtml = GenHtml & "</div>"<br /> GenHtml = GenHtml & "</body>"<br /> GenHtml = GenHtml & "</html>"<br /><br /> end if<br /> <br /><br /> '*************** generate ramdom number for naming ..html file ************************<br /> FileName = datepart("yyyy",now()) & datepart("m",now()) & datepart("d",now()) & datepart("h",now()) & datepart("n",now()) & datepart("s",now())<br /> <br /> dim fs<br /> set fs=CreateObject("Scripting.FileSystemObject")<br /> path = server.mappath("..") & "TEMP_Documents"" & FileName & ".html"<br /> <br /> set file1=fs.CreateTextFile(path)<br /> file1.writeline(GenHtml)<br /> <br /> set fs = nothing <br /> set file1 = nothing <br /> response.write "HTML file created"<br /><br /> '************ Send mail ************************************************** ************<br /> if rsHtml("report_type") = 1 then<br /> reporttype = "Outage"<br /> else<br /> reporttype = "Incident"<br /> end if<br /><br /> if rsHtml("Outage_Am_Pm") = 1 then<br /> AmPM = "AM"<br /> else<br /> AmPm = "PM"<br /> end if<br /><br /> end function<br /><br /><br />------------<br />V. Vivek at 5/20/2001 11:21:52 PM<br /><br />Hi,<br /><br />I'm fairly new to asp, I am currently creating a form in which the fields are filled by selecting from<br />a dropdown menu, whose options have to come from a field in my database (Access)<br /><br />ie. Last Name: the Dropdown menu should list all last names in the field in my db. <br /><br />Secondly, when the form is filled and I hit submit, it shoul create a report made of all the information<br />I submitted ie:<br /><br />Last Name: Vivek First Name: Veena<br />Address: #2001 - Hello Avenue.<br /><br />Is anyone aware of any scripts that can do this? And how do I bind the script to the button?<br /><br />Any help in this would be very much appreciated<br />Veena

Reply With Quote
Reply

Viewing: ASP Free ForumsProgramming.NET Development > Dynamic Dropdown and producing a report


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway