http://www.yintan.8u8.com
7-3  ʽ
7-3T test
             eptoxls.dll(win98 winnt/win2000 	Server)Ĺɺʹ

ܣ
	*.xlsļReportPath 

ͣ  
	


л
	Windows2000/Win98/Winnt + Excel2000(9.0) + IIs/Pws + MTS/Com+

һ

     eptoxls.dll

     xxxݿ-----+-- reportfmt 
		    |-- chartfmt 
                    |-- Ӧóݱ

     reportfmt 	{		/*ͷβϢ*/
		xh int,		/*Զ*/
		f1,f2,f3,f4,f5,..,fn varchar(20),
		czy varchar(15)
		}
     chartfmt   {
		xh int,		/*Զ*/
		beginrow 	int,/*ʼк*/
		begincol 	int,/*ʼк*/
		endrow   	int,/*к*/
                endcol    	int,/*к*/
		byRorC    	int,/*л*/
                Ctype     	int,/*ͼ*/
		CrtCap    	varchar(30),/*ͼ*/
		RowCap   	varchar(20),/*б*/
		ColCap   	varchar(20),/*б*/
		czy       	varchar(15)
		}
     hbfmt 	{		/*ϲϢ*/
		hbstr varchar(50),  /*¼ҪϲĵԪϢ*/
		czy varchar(15)
		}

װ

	1.װIIS4.0ϣװexcel2000
        
     	2.win98:
           	copy eptoxls.dll c:\windows\system\inetsrv
	   	regsvr32 eptoxls.dll
     	  NT/2000 server:
           	copy eptoxls.dll  c:\winnt\system32\inetsrv
	   	regsvr32 eptoxls.dll
ʹ
    
     dim xlapp
     xlapp=server.createobject("eptoxls.class1")
     xlapp.
     
     б
			DBtype As integer
			ݿ 1 access     2 MS-sql-server
			DBServer As String
                     	'ַ 202.0.191.1  locate
    			DbName As String
			'ݿmydb
  			UserName As String
			'ݿĺϷ:sa
  			Password As String
			'ݿĲߵĿ123456/ûпԿ
  			ReportPath As String
			'ɵļŵĿ¼· d:\inetpub\wwwroot\report
 
     б	dbtoexcel(sql1,sql2,sql3,Cflag,hbflag,czy)
               	dim sql1 as string	/*ͷsqlѯ*/
	       	dim sql2 as string	/*sqlѯ*/
	       	dim sql3 as string	/*βsqlѯ*/
		dim cflag as intager 	/*ͼ־ 1 Ҫ 0 Ҫ*/
		dim hbflag as intager 	/*ϲ־ 1 Ҫ 0 Ҫ*/
		dim czy as string  	/*ֻhbflagCflagһֵ1ʱ壬ÿմ""*/

    		  sql1sql3һӦreportfmt
		strsql1="select <field list> from reportfmt where <condition>"	
		strsql2="select <field list> from sbsltjb where <condition>"
     		strsql3="select <field list> from reportfmt where <condition>"

     һasp:
       
     	dim xlapp
	dim retstr
	dim strsql1,strsql2,strsql3     
	xlapp=server.createobject("eptoxls.class1")
	xlapp.dbserver="(locate)"
	xlapp.dbtype=2
	xlapp.dbname="sqldatabase"  /*sql */  Access Ϊ  xlapp.dbname=d:\mydatabase.mdb"
	xlapp.UserName="sa"  /*access */  
	xlapp.password="sql"  /*access */
	xlapp.reportpath="d:\inetpub\report"
	strsql1="select caption from reportfmt where lx=1 and czy='"&czy&"'"	
	strsql2="select xmmc,f1,f2,f3,f4,f5,f6,f7 from sbsltjb where czy='"&czy"'"
     	strsql3="select tail1,czy from reportfmt where lx=2 and czy='"&czy&"'"	
	retstr=xlapp.dbtoexcel(strsql1,strsql2,strsql3,0,0,"")
        response.write "ļ"&retstr
        <a href=<%=retstr%> >ʾ</a>
        set xlapp=nothing

ġԭ
	eptoxls һʽreportfmtγɱͷͱβ
        ڵǰreportfmt insert ׷ӱͷϢ Щ¼Ϊ lx=1
		  reportfmt ׷βϢЩ¼Ϊ lx=2
        žͿԵdbtoexcelγɰͷ壬βı*.xls

        Ϊ˷ֹֹͻreportfmt׷czy ʶϢDelete¼
	Insert
		﷨
               delete from reportfmt where czy=?
               insert into reportfmt values("1","aaa","mmm",czy)
         ϵͳûʹһԱ뽫czy Ϊ ûIP

塢ϲԪ
	òhbflagΪ1ʱúϲԪܣ Ϊ 0
	CflagΪ1 ڵǰӦñ֤hbfmtֻиòԱ1¼,
		hbstr varchar(50), 
		czy varchar(15)
		ֵ
		ĸʽ

		str="1,2,1,3;2,3,4,3;"  	/*ʾb1-c1ϲ  c2-c4ϲ*/
		﷨
		delete from hbfmt where czy=?
		insert into hbfmt values(str,"10001")
ͼ
	
        ҪͼúʱҪCflag Ϊ 1 Ϊ 0
        CflagΪ1 ڵǰӦñ֤chartfmtֻиòԱ1¼,
		beginrow 	int,		/*ʼк*/
		begincol 	int,		/*ʼк*/
		endrow   	int,		/*к*/
                endcol    	int,		/*к*/
		byRorC    	int,		/*л 1  2 */
                Ctype     	int,		/*ͼ*/
		CrtCap    	varchar(30),	/*ͼ*/
		RowCap   	varchar(20),	/*б*/
		ColCap   	varchar(20),	/*б*/
		czy       	varchar(15)

         ЩֶдChartfmtֶβܿ,ҲӦɾٲ
		﷨
		delete from chartfmt where czy=?
		insert into chart values(3,1,10,15,1,3,"豸ͼ""λ""""10001")

ߡѯӲԱ(czy=)Ϊ˽ͻ


ˡעⶨֹreportĿ¼µ*.xlsļ
          
	  ð汾WIN98+excel2000 Уwin2000 server+excel2000ҲУ
	Ҫװexcel2002

špjqm.exe ע



				ȡϢ뵽www.yintan.8u8.com  
				ʽhttp://www.softreg.com.cn/shareware.asp?id=11383
				yuxiaotom@tom.com  2003/06/25  



 