回复 3楼noahark的帖子
Spread 前台没有提供到处 Excel 的相应方法。可以 CallBack 到后台导出,测试代码如下:
js
- <script language="javascript" type="text/javascript">
- // <![CDATA[
- function Button1_onclick() {
- var spread = this.document.getElementById("FpSpread1");
- spread.CallBack("saveasexcel");
- }
- // ]]>
- </script>
复制代码
C#:
- protected void FpSpread1_ButtonCommand(object sender, FarPoint.Web.Spread.SpreadCommandEventArgs e)
- {
- if (e.CommandName=="saveasexcel")
- {
- this.FpSpread1.SaveExcel(this.Server.MapPath("test.xls"));
- }
- }
复制代码 |