谁能帮我解决这个问题?利用OWC在服务器上生成图像输出到客户端出错!
我用OWC在服务器上生成图像,输出到客服端,产生以下错误:
Microsoft VBScript 编译器错误 错误 '800a03f6'
缺少 'End'
/iisHelp/common/500-100.asp,行242
Microsoft Office Web Components 9.0 错误 '800a03ec'
无法打开文件 c:\inetpub\wwwroot\test\1078668340437.gif 以进行导出。
/test/OwcTest.asp,行14
我已经将IIS下面改制站点设置为可写了。我将代码贴出如下:
<%
function ExportChartToGIF(objCSpace, strAbsFilePath, strRelFilePath){
var date=(new Date()).getTime();
var strFileName
strFileName=date+".gif"
objCSpace.ExportPicture(strAbsFilePath+"\\"+strFileName,"gif",650,400);
return strRelFilePath+"\/"+strFileName
}
function CleanUpGIF(GIFpath){
var objFS;
var objFolder;
var gif;
objFS=Server.CreateObject("Scripting.FileSystemObject");
objFolder=objFS.GetFolder(GIFpath);
for(gif in objFolder){
if(gif.Name.indexOf(".gif")!="-1"&&((new Date()).getTime()-(gif.DateLastModified).getTime>100))
objFS.DeleteFile(GIFpath+"\\"+gif.Name,True);
}
objFolder = nothing;
objFS = nothing;
}
%>
<%
var objChartSpace;
var objChart ;
var objSeries ;
var objConn ;
var objRS ;
var c ;
var series ;
var strChartAbsPath ;
var strChartRelPath ;
var strChartFile ;
var axis ;
var fnt;
var ax;
strChartAbsPath = Server.MapPath(".")
strChartRelPath = Server.MapPath(".")
objChartSpace = Server.CreateObject("OWC.Chart")
objChart = objChartSpace.Charts.Add();
c = objChartSpace.Constants;
objChart.Border.Color="red" ;
objChart.type=1;
objChart.HasLegend = true;
objChart.HasTitle=true;
objChart.Title.Caption ="利用office web component打造精品图表" ;
fnt=objChart.title.font;
fnt.name="宋体";
fnt.size=12;
fnt.bold=true;
fnt.color="red" ;
objConn = Server.CreateObject("ADODB.Connection") ;
objConn.Open("Provider=SQLOLEDB.1;Password=sa;Persist Security Info=True;User ID=sa;Initial Catalog=Northwind;Data Source=ZHJZH;User Id=sa;");
objRS = Server.CreateObject("ADODB.Recordset")
objRS.ActiveConnection = objConn ;
objRS.CursorType = adOpenStatic ;
objRS.CursorLocation = adUseClient ;
objRS.Open("select count(products.ProductName) as col,categories.CategoryName from products,categories where products.CategoryID=categories.CategoryID group by categories.CategoryName");
objChartSpace.DataSource = objRS ;
objChart.SetData(c.chDimSeriesNames,0,"CategoryName" );
for(objSeries in objChart.SeriesCollection){
objSeries.SetData(c.chDimCategories, 0, "CategoryName")
objSeries.SetData(c.chDimvalues, 0, "col" )
}
ax=objChart.Axes(c.chAxisPositionBottom)
ax.hastitle=true
ax.Title.Caption = "种类"
fnt=ax.title.font
fnt.name="宋体"
fnt.size=15
fnt.bold=true
fnt.color="blue"
ax=objChart.Axes(c.chCategoryAxis)
ax.hastitle=true
ax.Title.Caption = "数量"
fnt=ax.title.font
fnt.name="宋体"
fnt.size=15
fnt.bold=true
fnt.color="green"
strChartFile = ExportChartToGIF(objChartSpace, strChartAbsPath, strChartRelPath)
Response.Write ("<IMG SRC='" +strChartFile+"'>" +"<P>" )
CleanUpGIF(strChartAbsPath)
objRS.Close
objRS = nothing
objConn = nothing
objSeries = nothing
objChart = nothing
objChartSpace = nothing
%>
请大侠帮我看看是哪里出物了!谢谢!