- FarPoint.Web.Spread.ImageCellType img = new ImageCellType();
- img.ImageUrl = "../../image/head.png";
- img.CssClass = "fplogoimg";
- FpSpread1.ActiveSheetView.AddSpanCell(0, 6, 3, 3);
- FpSpread1.ActiveSheetView.Cells[0, 6].CellType = img;
- FpSpread1.ActiveSheetView.Cells[0, 6].HorizontalAlign = HorizontalAlign.Right;
复制代码
导出Excel时,这个单元格是空的,能不能把这个图片也导出来呢?是我的导出方法不对吗?
在fpspread中添加图片时能不能不用ImageCellType,像Excel一样图片浮在所有表格上面,可以随便移动?
导出Excel方法:
- System.IO.MemoryStream ms = new System.IO.MemoryStream();
- FpSpread1.SaveExcel(ms, FarPoint.Excel.ExcelSaveFlags.UseOOXMLFormat);
- Response.Clear();
- Response.ContentType = "application/VND.ms-excel";
- string filename = HttpUtility.UrlEncode(ddlWell.SelectedItem.Text + "日报.xlsx");
- Response.AddHeader("Content-Disposition", "attachment;filename=" + filename);
- Response.BinaryWrite(ms.ToArray());
- ms.Flush();
- ms.Close();
- Response.End();
复制代码 |
|