| 订阅 | 在线投稿
分享
 
 
当前位置: 王朝网络 >> asp >> ASP cheng xu zhong shu chu Excel wen jian shi li yi ze

ASP cheng xu zhong shu chu Excel wen jian shi li yi ze

2008-08-25 23:34:33 编辑來源:互联网 评论
 
 
 
本文为【ASP程序中输出Excel文件实例一则】的拼音翻译版
  zai asp zhong li yong excel de yi ge fang fa shi jiang excel wen jian zuo wei yi ge shu ju ku jin xing lian jie , ran hou de cao zuo he dui access shu ju ku cao zuo lei si 。 dan shi zhe ge fang fa bu shi zong neng you yong de , ying wei excel bu shi guan xi xing de shu ju ku 。 dui yu yi ge gu ding ge shi , zhe ge ge shi li you fu duo de dan yuan ge he bing , bian kuang xian tiao yang shi , huan you tu an , dan yuan ge zhi jian huan you gong shi guan xi deng deng de , wo xiang zui rong yi li jie de jiu shi zai hou tai da kai yi ge yi you she ding hao mo ban de wen jian , ran hou zai xu yao de di fang cha ru shu ju , bao cun , shu chu ... ...
   zhe li ti dao de zhe zhong fang fa shi zhi jie jian li yi ge excel dui xiang , zai hou tai ke yi geng fang bian de dui excel wen dang jin xing ge zhong cao zuo 。
   fu wu qi duan huan bi xu yao she zhi de yi dian shi COM zu jian de cao zuo quan xian 。 zai ming ling xing jian ru “DCOMCNFG”, ze jin ru COM zu jian pei zhi jie mian , xuan ze MicrosoftExcel hou dian ji shu xing an niu , jiang san ge dan xuan xiang yi lv xuan ze zi ding yi , bian ji zhong jiang Everyone jia ru suo you quan xian 。 bao cun wan bi hou chong xin qi dong fu wu qi 。
   hen chong yao , bu she zhi de hua , bie de dian nao jiang wu fa wan cheng excel dui xiang de jian li 。
   dan shi zhe zhong fang fa ye you yi ge que han , zai wo shi ji cao zuo zhong , ru guo fu wu qi shang yi you da kai de excel wen jian , zai zhi xing tong yi wen jian , jiu hui chu cuo , zan shi huan gao bu ming bai wei he , ke neng huan you yi xie di fang mei she zhi hao ba 。
   ling wai , shang mian yin yong de wen zhang zhong shi li dai ma ge shi bu tai wan zheng , qi zhong hen duo huan xing he kong ge ge shi bu zhun que , ru guo dai ma wan zheng , zhi yao fu zhi dai ma , jiu ke yi yun xing cheng gong , ran hou zai man man jin xing yan jiu xiu gai , jiu hen rong yi shang shou le , xian ba xiu gai hou de dai ma ru xia ( shan qu le qi zhong hua tu biao de bu fen ):
  <%
  On Error Resume Next
  strAddr=Server.MapPath(".")
  set objExcelApp=CreateObject("Excel.Application")
  objExcelApp.DisplayAlerts=false
  objExcelApp.Application.Visible=false
  objExcelApp.WorkBooks.Open(strAddr&"\Templet\Null.xls")
  set objExcelBook=objExcelApp.ActiveWorkBook
  set objExcelSheets=objExcelBook.Worksheets
  set objExcelSheet=objExcelBook.Sheets(1)
  objExcelSheet.Range("B2:k2").Value=Array("Week1","Week2","Week3","Week4","Week5","Week6","Week7")
  objExcelSheet.Range("B3:k3").Value=Array("67","87","5","9","7","45","45","54","54","10")
  objExcelSheet.Range("B4:k4").Value=Array("10","10","8","27","33","37","50","54","10","10")
  objExcelSheet.Range("B5:k5").Value=Array("23","3","86","64","60","18","5","1","36","80")
  objExcelSheet.Cells(3,1).Value="InternetExplorer"
  objExcelSheet.Cells(4,1).Value="Netscape"
  objExcelSheet.Cells(5,1).Value="Other"
  objExcelSheet.Range("b2:k5").Select
  SaveAs(strAddr&"\Temp\Excel.xls")
  objExcelApp.Quit
  set objExcelApp=Nothing
  %>
  <!DOCTYPEHTMLPUBLIC"-//W3C//DTDHTML4.0Transitional//EN">
  <HTML>
  <HEAD>
  <TITLE>NewDocument</TITLE>
  <METANAME="Generator"CONTENT=" MicrosoftFrontPage5.0">
  <METANAME="Author"CONTENT="">
  <METANAME="Keywords"CONTENT="">
  <METANAME="Description"CONTENT="">
  </HEAD>
  <BODY>
  </BODY>
  </HTML>
   cao zuo wan excel wen jian xu yao jiang wen jian jin xing shu chu , shi ji nong yi xia , yong ASP de redirect dao excel fang fa , you shi hou shi zai IE zhong zhi jie da kai , you shi hou shi tan chu " xia zai da kai bao cun " chuang kou . ru guo xu yao zhi jie zai IE zhong da kai , bu fang yong FSO zai ru excel wen jian , ran hou zai IE zhong shu chu 。
  <%
  Dim Fso,FileExt,strFilePath,Mime
  strFilePath = "f:\aspxuexi.doc"
  Set Fso=Server.CreateObject("Scripting.FileSystemObject")
  FileExt = Fso.GetExtensionName(strFilePath)
  Set fso=Nothing
  Select Case FileExt
  Case "doc"
  Mime="Application/msword"
  Case "xls"
  Mime="Application/msexcel"
  End Select
  Call OutPut(strFilePath,Mime)
  '######################################################
  Function OutPut(strFilePath,Mime)
  Response.ContentType = Mime
  Const adTypeBinary = 1
  Set objStream = Server.CreateObject("ADODB.Stream")
  objStream.Open
  objStream.Type = adTypeBinary
  objStream.LoadFromFile strFilePath
  Response.BinaryWrite objStream.Read
  objStream.Close
  Set objStream = Nothing
  End Function
  '######################################################
  %>
   zai shi ji ying yong zhong 。 dang fu wu qi duan zheng zai yun xing excel huo ACCESS cheng xu shi , ke hu duan ti jiao jian li excel。application dui xiang wu fa cheng gong 。 ling yi zhong qing kuang , dang yi ge ke hu duan ti jiao qing qiu shi , bing mei you jie shu shi , ling yi ge ke hu duan ti jiao de qing qiu ye wu fa cheng gong ! huo xu zhe ge wen ti you bie de jie jue fang an , dan shi zhi shao zhe shi bu wen ding de 。
   zheng hao wo men bu men nei bu wang shang you xiang guan cheng gong de li zi , wa chu lai kan , yuan lai shi zai ke hu duan jian li excel。application de 。 zhe yang , fu wu qi duan bu hui zai chong tu 。 dui yu ke hu duan , yin wei shi zai ju yu wang nei yun xing , ke hu IE an quan ji bie ke yi she di , bing yuan xu yun xing xiang guan activeX( jiu shi zai IE gong ju xuan xiang zhong ba ge lei she ji an quan de dong xi dou she wei yuan xu , ju ti de na yi xiang mei you qu zhui jiu ), ji shi mei you she zhi ,IE ye hui tan chu jing gao chuang kou :“ shi fou yuan xu yun xing activeX?”
   shi xian de dai ma he shang pian ri zhi cha bu duo , jian dan de ru xia :
  <script language="vbscript">
  set objExcelApp=CreateObject("Excel.Application")
  objExcelApp.DisplayAlerts=true
  objExcelApp.WorkBooks.Open("http://XXX.XXX.XXX/XXX.xls")
  ' wan zheng wang lu di zhi de xls wen jian , zhe ge wen jian yi jing she zhi hao ge shi ji da yin yang shi , bao cun zai fu wu qi shang
  set objExcelBook=objExcelApp.ActiveWorkBook
  set objExcelSheets=objExcelBook.Worksheets
  set objExcelSheet=objExcelBook.Sheets(1)
  '==== ci chu wei dui excel dan yuan ge jin xing tian xie shu ju de yu ju , ru guo shi cong shu ju ku ti qu shu ju , ke you hou tai cheng xu sheng cheng zhe xie yu ju ,ASP zhong de shi lie :
  ' ru :response.write "objExcelSheet.Range(""B2"").Value="""&rs("XXX")&""""
  ' huo objExcelSheet.Range("B2").Value="<%=rs("XXX")%>"
  objExcelSheet.Range("B2:k2").Value=Array("Week1","Week2","Week3","Week4","Week5","Week6","Week7")
  objExcelSheet.Range("B3:k3").Value=Array("67","87","5","9","7","45","45","54","54","10")
  objExcelSheet.Range("B4:k4").Value=Array("10","10","8","27","33","37","50","54","10","10")
  objExcelSheet.Range("B5:k5").Value=Array("23","3","86","64","60","18","5","1","36","80")
  objExcelSheet.Cells(3,1).Value="InternetExplorer"
  objExcelSheet.Cells(4,1).Value="Netscape"
  objExcelSheet.Cells(5,1).Value="Other"
  '==================
  'objExcelApp.Quit
  'set objExcelApp=Nothing
  </script>
   shang shu dai ma zhong
   'objExcelApp.Quit
   'set objExcelApp=Nothing
   zuo wei qu xiao zhi xing , yin wei ci chu bu yao guan bi excel.applicaition, bu ran shu ju tian wan hou ,excel hui guan bi diao 。 zhe shi zai ke hu duan da kai de excel wen jian xu yao you ke hu jin xing xiu gai huo da yin deng cao zuo 。 tong shi objexcelapp dui xiang huan you da yin she zhi ji jin ru da yin yu lan jie mian deng fang fa , ke shen kao xiang guan excel xiang guan zi liao 。【原文】【汉音对照
 
 
 
 
 
 
 
 
 
日版宠物情人插曲《Winding Road》歌词

日版宠物情人2017的插曲,很带节奏感,日语的,女生唱的。 最后听见是在第8集的时候女主手割伤了,然后男主用嘴帮她吸了一下,插曲就出来了。 歌手:Def...

兄弟共妻,我成了他们夜里的美食

老钟家的两个儿子很特别,就是跟其他的人不太一样,魔一般的执着。兄弟俩都到了要结婚的年龄了,不管自家老爹怎么磨破嘴皮子,兄弟俩说不娶就不娶,老父母为兄弟两操碎了心...

如何磨出破洞牛仔裤?牛仔裤怎么剪破洞?

把牛仔裤磨出有线的破洞 1、具体工具就是磨脚石,下面垫一个硬物,然后用磨脚石一直磨一直磨,到把那块磨薄了,用手撕开就好了。出来的洞啊很自然的。需要猫须的话调几...

我就是扫描下图得到了敬业福和爱国福

先来看下敬业福和爱国福 今年春节,支付宝再次推出了“五福红包”活动,表示要“把欠大家的敬业福都还给大家”。 今天该活动正式启动,和去年一样,需要收集“五福”...

冰箱异味产生的原因和臭味去除的方法

有时候我们打开冰箱就会闻到一股异味,冰箱里的这种异味是因为一些物质发出的气味的混合体,闻起来让人恶心。 产生这些异味的主要原因有以下几点。 1、很多人有这种习...

 
 
zai asp zhong li yong excel de yi ge fang fa shi jiang excel wen jian zuo wei yi ge shu ju ku jin xing lian jie , ran hou de cao zuo he dui access shu ju ku cao zuo lei si 。 dan shi zhe ge fang fa bu shi zong neng you yong de , ying wei excel bu shi guan xi xing de shu ju ku 。 dui yu yi ge gu ding ge shi , zhe ge ge shi li you fu duo de dan yuan ge he bing , bian kuang xian tiao yang shi , huan you tu an , dan yuan ge zhi jian huan you gong shi guan xi deng deng de , wo xiang zui rong yi li jie de jiu shi zai hou tai da kai yi ge yi you she ding hao mo ban de wen jian , ran hou zai xu yao de di fang cha ru shu ju , bao cun , shu chu ... ... zhe li ti dao de zhe zhong fang fa shi zhi jie jian li yi ge excel dui xiang , zai hou tai ke yi geng fang bian de dui excel wen dang jin xing ge zhong cao zuo 。 fu wu qi duan huan bi xu yao she zhi de yi dian shi COM zu jian de cao zuo quan xian 。 zai ming ling xing jian ru “DCOMCNFG”, ze jin ru COM zu jian pei zhi jie mian , xuan ze MicrosoftExcel hou dian ji shu xing an niu , jiang san ge dan xuan xiang yi lv xuan ze zi ding yi , bian ji zhong jiang Everyone jia ru suo you quan xian 。 bao cun wan bi hou chong xin qi dong fu wu qi 。 hen chong yao , bu she zhi de hua , bie de dian nao jiang wu fa wan cheng excel dui xiang de jian li 。 dan shi zhe zhong fang fa ye you yi ge que han , zai wo shi ji cao zuo zhong , ru guo fu wu qi shang yi you da kai de excel wen jian , zai zhi xing tong yi wen jian , jiu hui chu cuo , zan shi huan gao bu ming bai wei he , ke neng huan you yi xie di fang mei she zhi hao ba 。 ling wai , shang mian yin yong de wen zhang zhong shi li dai ma ge shi bu tai wan zheng , qi zhong hen duo huan xing he kong ge ge shi bu zhun que , ru guo dai ma wan zheng , zhi yao fu zhi dai ma , jiu ke yi yun xing cheng gong , ran hou zai man man jin xing yan jiu xiu gai , jiu hen rong yi shang shou le , xian ba xiu gai hou de dai ma ru xia ( shan qu le qi zhong hua tu biao de bu fen ): <% On Error Resume Next strAddr=Server.MapPath(".") set objExcelApp=CreateObject("Excel.Application") objExcelApp.DisplayAlerts=false objExcelApp.Application.Visible=false objExcelApp.WorkBooks.Open(strAddr&"\Templet\Null.xls") set objExcelBook=objExcelApp.ActiveWorkBook set objExcelSheets=objExcelBook.Worksheets set objExcelSheet=objExcelBook.Sheets(1) objExcelSheet.Range("B2:k2").Value=Array("Week1","Week2","Week3","Week4","Week5","Week6","Week7") objExcelSheet.Range("B3:k3").Value=Array("67","87","5","9","7","45","45","54","54","10") objExcelSheet.Range("B4:k4").Value=Array("10","10","8","27","33","37","50","54","10","10") objExcelSheet.Range("B5:k5").Value=Array("23","3","86","64","60","18","5","1","36","80") objExcelSheet.Cells(3,1).Value="InternetExplorer" objExcelSheet.Cells(4,1).Value="Netscape" objExcelSheet.Cells(5,1).Value="Other" objExcelSheet.Range("b2:k5").Select SaveAs(strAddr&"\Temp\Excel.xls") objExcelApp.Quit set objExcelApp=Nothing %> <!DOCTYPEHTMLPUBLIC"-//W3C//DTDHTML4.0Transitional//EN"> <HTML> <HEAD> <TITLE>NewDocument</TITLE> <METANAME="Generator"CONTENT=" MicrosoftFrontPage5.0"> <METANAME="Author"CONTENT=""> <METANAME="Keywords"CONTENT=""> <METANAME="Description"CONTENT=""> </HEAD> <BODY> </BODY> </HTML> cao zuo wan excel wen jian xu yao jiang wen jian jin xing shu chu , shi ji nong yi xia , yong ASP de redirect dao excel fang fa , you shi hou shi zai IE zhong zhi jie da kai , you shi hou shi tan chu " xia zai da kai bao cun " chuang kou . ru guo xu yao zhi jie zai IE zhong da kai , bu fang yong FSO zai ru excel wen jian , ran hou zai IE zhong shu chu 。 <% Dim Fso,FileExt,strFilePath,Mime strFilePath = "f:\aspxuexi.doc" Set Fso=Server.CreateObject("Scripting.FileSystemObject") FileExt = Fso.GetExtensionName(strFilePath) Set fso=Nothing Select Case FileExt Case "doc" Mime="Application/msword" Case "xls" Mime="Application/msexcel" End Select Call OutPut(strFilePath,Mime) '###################################################### Function OutPut(strFilePath,Mime) Response.ContentType = Mime Const adTypeBinary = 1 Set objStream = Server.CreateObject("ADODB.Stream") objStream.Open objStream.Type = adTypeBinary objStream.LoadFromFile strFilePath Response.BinaryWrite objStream.Read objStream.Close Set objStream = Nothing End Function '###################################################### %> zai shi ji ying yong zhong 。 dang fu wu qi duan zheng zai yun xing excel huo ACCESS cheng xu shi , ke hu duan ti jiao jian li excel。application dui xiang wu fa cheng gong 。 ling yi zhong qing kuang , dang yi ge ke hu duan ti jiao qing qiu shi , bing mei you jie shu shi , ling yi ge ke hu duan ti jiao de qing qiu ye wu fa cheng gong ! huo xu zhe ge wen ti you bie de jie jue fang an , dan shi zhi shao zhe shi bu wen ding de 。 zheng hao wo men bu men nei bu wang shang you xiang guan cheng gong de li zi , wa chu lai kan , yuan lai shi zai ke hu duan jian li excel。application de 。 zhe yang , fu wu qi duan bu hui zai chong tu 。 dui yu ke hu duan , yin wei shi zai ju yu wang nei yun xing , ke hu IE an quan ji bie ke yi she di , bing yuan xu yun xing xiang guan activeX( jiu shi zai IE gong ju xuan xiang zhong ba ge lei she ji an quan de dong xi dou she wei yuan xu , ju ti de na yi xiang mei you qu zhui jiu ), ji shi mei you she zhi ,IE ye hui tan chu jing gao chuang kou :“ shi fou yuan xu yun xing activeX?” shi xian de dai ma he shang pian ri zhi cha bu duo , jian dan de ru xia : <script language="vbscript"> set objExcelApp=CreateObject("Excel.Application") objExcelApp.DisplayAlerts=true objExcelApp.WorkBooks.Open("[url=http://XXX.XXX.XXX/XXX.xls]http://XXX.XXX.XXX/XXX.xls[/url]") ' wan zheng wang lu di zhi de xls wen jian , zhe ge wen jian yi jing she zhi hao ge shi ji da yin yang shi , bao cun zai fu wu qi shang set objExcelBook=objExcelApp.ActiveWorkBook set objExcelSheets=objExcelBook.Worksheets set objExcelSheet=objExcelBook.Sheets(1) '==== ci chu wei dui excel dan yuan ge jin xing tian xie shu ju de yu ju , ru guo shi cong shu ju ku ti qu shu ju , ke you hou tai cheng xu sheng cheng zhe xie yu ju ,ASP zhong de shi lie : ' ru :response.write "objExcelSheet.Range(""B2"").Value="""&rs("XXX")&"""" ' huo objExcelSheet.Range("B2").Value="<%=rs("XXX")%>" objExcelSheet.Range("B2:k2").Value=Array("Week1","Week2","Week3","Week4","Week5","Week6","Week7") objExcelSheet.Range("B3:k3").Value=Array("67","87","5","9","7","45","45","54","54","10") objExcelSheet.Range("B4:k4").Value=Array("10","10","8","27","33","37","50","54","10","10") objExcelSheet.Range("B5:k5").Value=Array("23","3","86","64","60","18","5","1","36","80") objExcelSheet.Cells(3,1).Value="InternetExplorer" objExcelSheet.Cells(4,1).Value="Netscape" objExcelSheet.Cells(5,1).Value="Other" '================== 'objExcelApp.Quit 'set objExcelApp=Nothing </script> shang shu dai ma zhong 'objExcelApp.Quit 'set objExcelApp=Nothing zuo wei qu xiao zhi xing , yin wei ci chu bu yao guan bi excel.applicaition, bu ran shu ju tian wan hou ,excel hui guan bi diao 。 zhe shi zai ke hu duan da kai de excel wen jian xu yao you ke hu jin xing xiu gai huo da yin deng cao zuo 。 tong shi objexcelapp dui xiang huan you da yin she zhi ji jin ru da yin yu lan jie mian deng fang fa , ke shen kao xiang guan excel xiang guan zi liao 。
󰈣󰈤
  免责声明:本文仅代表作者个人观点,与王朝网络无关。王朝网络登载此文出于传递更多信息之目的,并不意味着赞同其观点或证实其描述,其原创性以及文中陈述文字和内容未经本站证实,对本文以及其中全部或者部分内容、文字的真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
 
 
华丽的模特拍摄(8)
华丽的模特拍摄(7)
华丽的模特拍摄(6)
华丽的模特拍摄(5)
八里沟
朝阳宫
天下峨眉 云上金顶
老家(四)
 
>>返回首页<<
 
 
 为你推荐
 
 
 
 转载本文
 UBB代码 HTML代码
复制到剪贴板...
 
 热帖排行
 
 
 
 
 
©2005- 王朝网络 版权所有