回复 25楼roger.wang的帖子
完全照抄您的demo了。
protected void Page_Load(object sender, EventArgs e)
{
string fileName = GetExcel();
this.FpSpread1.OpenExcel(fileName);
}
private string GetExcel()
{
string fileName = @"D:\testsparkline.xlsx";
Stream localFile = new FileStream(fileName, FileMode.Create);
Stream stream = new FileStream(@"D:\sparkline.dat", FileMode.Open);
int leng = stream.Length < Int32.MaxValue ? (int)stream.Length : 0;
byte[] buf = new byte[leng];
stream.Read(buf, 0, leng);
stream.Close();
localFile.Write(buf, 0, leng);
localFile.Close();
//mem.CopyTo(localFile);
return fileName;
}
就是CopyTo自己用read和write 实现了。
web.config也配置了:
<httpHandlers>
<add path="FpChart.axd" verb="*" type="FarPoint.Web.Chart.ChartImageHttpHandler" validate="true" />
</httpHandlers>
sparkline.dat用的您的文件。还是没图。 |