haor(一个好人):我做了以下步骤: 1、打开VB,新建Active Dll 2、“工程”-》“部件”中将你发给我的mschart.ocx添加进来。 3、“确定”后报错: Microsoft Chart Control 6.0是单线程部件,不能用于多线程工程。 请修改工程的线程模式或与代理商联系取得升级版。 what should I do?
给你一段代码,对你应该是有帮助的 <%@ Language=VBScript %> <% OPTION EXPLICIT %> <html> <head> <meta NAME="GENERATOR" Content="Microsoft Visual Studio 6.0"> </head> <body><!-- #INCLUDE FILE="ExcelChart.inc" --><% Dim iStartYear, iEndYear Dim strFactory, strRSMode Dim flgRSFromDatabase
'--- read the starting year submitted from the form iStartYear = Request.Form( "iYear" ) if( IsEmpty(iStartYear) or IsNull(iStartYear)) then iStartYear = 1991
'--- compute the ending year based on start year iEndYear = CInt(iStartYear)+4
'--- get the factory for which production is to be shown strFactory = Request.Form( "strFactory" ) if( IsEmpty(strFactory) or IsNull(strFactory)) then strFactory = "FACTORY 1"
'--- determine if data is to be picked up from database, recordset mode strRSMode = Request.Form( "chbRSMode" )
'--- flgRSFromDatabase = false means build recordset thru scripts without database if( not IsEmpty(strRSMode) and not IsNull(strRSMode) and strRSMode = "on" ) then flgRSFromDatabase = False else flgRSFromDatabase = True %><% Dim oRs Dim oConnection Dim strQuery
'--- recordset from database if( flgRSFromDatabase = true ) then '--- create the connection object Set oConnection = Server.CreateObject("ADODB.Connection" )
'--- open the connection 'oConnection.Open "DBQ="+server.mappath("CHARTDATA.mdb")+";DefaultDir=;DRIVER={Microsoft Access Driver (*.mdb)};" oConnection.Open "DBQ="+server.mappath("CHARTDATA.mdb")+";DefaultDir=;DRIVER={Microsoft Access Driver (*.mdb)};" '--- build the query string strQuery = "SELECT * FROM yearly_production WHERE factory_name='"+strFactory+"' AND production_year BETWEEN "+CStr(iStartYear)+" AND "+CStr(iEndYear)
Set oRs = oConnection.Execute( strQuery )
if( oRs.EOF ) then Response.Write( "No data available" ) Response.End end if
else
Set oRs = Server.CreateObject("ADODB.Recordset" )
with oRs .CursorLocation = 3 '--- client-side cursor with .Fields .Append "factory_name", adVarChar .Append "production_year",adInteger .Append "production_in_tons",adInteger end with
你说的mschart图表工具,哪里有下载。
用VB做一个Active DLL文件,在ASP中调用。请教。
不过好象也可以直接用控件吧。(我没试过。。)
具体如何做。
急急急急急
急急急急急
tel: 65710016
are you in shanghai too?
请指教思路。
在ASP中调用了!写在DLL的类接口上.....
用Java Applet作.
然后在asp中调用。如果你需要的话,我可以给你一个。动态库也含全部源代码。你可以修改。
如果用柱状图,可以事先做一条形图,计算各字段占的比例。即可
[email protected]
yygwy.yeah.net
如果你在上海,请打[email protected]"开发Active Dll,可以用VB来实现,把Mschart访在DLL中,在给DLL写上入口参数,以后就可以直接在ASP中调用了!写在DLL的类接口上..... "
请详细描述编写方法。万分感谢。
1、打开VB,新建Active Dll
2、“工程”-》“部件”中将你发给我的mschart.ocx添加进来。
3、“确定”后报错:
Microsoft Chart Control 6.0是单线程部件,不能用于多线程工程。
请修改工程的线程模式或与代理商联系取得升级版。
what should I do?
我是这样,把各个观点折合的百分比率乘以一个定值。然后用这个值做为图表柱形的长度值,对于饼图的话完全可以设为其半径,然后嘛,那就是HTML的问题落。
从工程属性中把工程改成单线程。
我以把mschart添加到控件工具条上了。
然后怎么办?
regsvr32 E:\Study\asp\Example.dll /u
系统显示成功,"DllUnregistserver in E:\Study\asp\Example.dll succeeded"但不能删除硬盘上的Example.dll,
出错提示:
“无法删除Example.dll,共享冲突。源文件或目标文件正在使用。”
1、如何将Picture控件中用mousemove画出的线条保存到硬盘上,格式分别为*.bmp*.jpg*.gif
2、Active DLL除了在ASP中调用,还可以在那里使用,请举例说明。
3、Active DLL 和 Active exe有什么区别
4、难道每次修改了Active DLL源代码,要调试时,都要先从新启动计算机,清空内存后,再注册Active DLL,才能运行调试吗?这也太麻烦了。
谢谢
zytang
二、使用ASPImage这个组件很容易就可以画出来。这个组件好像需要注册!
修改ACITVEDLL应该不需要启动计算机吧,也太麻烦了,以前做过,应该不用
“savepicture picture1.image(应该是)保存的是bmp文件”的方法只能在用了LOADPICTURE之后才能有效,
我的意图是“将Picture控件中用mousemove画出的线条保存到硬盘上”
用以上方法保存的图片是空白的。
“修改ACITVEDLL应该不需要启动计算机吧”
请问你的操作步骤。
<%@ Language=VBScript %>
<% OPTION EXPLICIT %>
<html>
<head>
<meta NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
</head>
<body><!-- #INCLUDE FILE="ExcelChart.inc" --><%
Dim iStartYear, iEndYear
Dim strFactory, strRSMode
Dim flgRSFromDatabase
'--- read the starting year submitted from the form
iStartYear = Request.Form( "iYear" )
if( IsEmpty(iStartYear) or IsNull(iStartYear)) then iStartYear = 1991
'--- compute the ending year based on start year
iEndYear = CInt(iStartYear)+4
'--- get the factory for which production is to be shown
strFactory = Request.Form( "strFactory" )
if( IsEmpty(strFactory) or IsNull(strFactory)) then strFactory = "FACTORY 1"
'--- determine if data is to be picked up from database, recordset mode
strRSMode = Request.Form( "chbRSMode" )
'--- flgRSFromDatabase = false means build recordset thru scripts without database
if( not IsEmpty(strRSMode) and not IsNull(strRSMode) and strRSMode = "on" ) then flgRSFromDatabase = False else flgRSFromDatabase = True
%><%
Dim oRs
Dim oConnection
Dim strQuery
'--- recordset from database
if( flgRSFromDatabase = true ) then
'--- create the connection object
Set oConnection = Server.CreateObject("ADODB.Connection" )
'--- open the connection
'oConnection.Open "DBQ="+server.mappath("CHARTDATA.mdb")+";DefaultDir=;DRIVER={Microsoft Access Driver (*.mdb)};"
oConnection.Open "DBQ="+server.mappath("CHARTDATA.mdb")+";DefaultDir=;DRIVER={Microsoft Access Driver (*.mdb)};"
'--- build the query string
strQuery = "SELECT * FROM yearly_production WHERE factory_name='"+strFactory+"' AND production_year BETWEEN "+CStr(iStartYear)+" AND "+CStr(iEndYear)
Set oRs = oConnection.Execute( strQuery )
if( oRs.EOF ) then
Response.Write( "No data available" )
Response.End
end if
else
Set oRs = Server.CreateObject("ADODB.Recordset" )
with oRs
.CursorLocation = 3 '--- client-side cursor
with .Fields
.Append "factory_name", adVarChar
.Append "production_year",adInteger
.Append "production_in_tons",adInteger
end with
.Open '-- open the recordset
'--- add records
.AddNew Array("factory_name","production_year", "production_in_tons"), Array( strFactory, iStartYear, "50" )
.AddNew Array("factory_name","production_year", "production_in_tons"), Array( strFactory, iStartYear+1, "160" )
.AddNew Array("factory_name","production_year", "production_in_tons"), Array( strFactory, iStartYear+2, "90" )
.AddNew Array("factory_name","production_year", "production_in_tons"), Array( strFactory, iStartYear+3, "120" )
.AddNew Array("factory_name","production_year", "production_in_tons"), Array( strFactory, iStartYear+4, "200" )
'--- update
.Update
end with
end if
%><%
Dim oExcelChart
Dim strGIFFileName
Set oExcelChart = Server.CreateObject( "ExcelChart.cExcelChart" )
oExcelChart.AddDataSeries oRs, "production_in_tons", "Production", False, True
oExcelChart.SetXAxisHeadings oRs, "production_year"
oExcelChart.SetChartTitles "Tea production for 5 year period", "Year", "Production"
oExcelChart.SetChartOptions xl3DArea, 400, 200 'xl3DColumnClustered
oExcelChart.SetBackgroundEffect msoGradientChrome ' msoGradientCalmWater
strGIFFileName = CStr( Server.MapPath(".") & "\"+ "EXCELCHART.GIF" )
oExcelChart.ExportToGif( strGIFFileName )
Set oExcelChart = nothing
Set oRs = nothing
Set oConnection = nothing
%>
<img SRC="ExcelChart.GIF"> '在html调用即可<!-- for debugging only -->
<%
'oRs.MoveFirst
'while( not oRs.EOF )
' Response.Write( "<BR>Year:" + CStr(oRs("production_year")) + "Factory:" + oRs("factory_name") + "Production:" + CStr(oRs("production_in_tons")))
' Factory:'"&oRs("factory_name")+ "'Production:"&oRs("production_in_tons"))
' oRs.MoveNext
' wend
' Set oRs = nothing
'Set oConnection = nothing
%>
</body>
</html>