回复 15楼dof的帖子
之所以实例化FpSpread是因为业务需要,要向当前的fpspread里添......
garfieldzf8 发表于 2014-9-28 9:15:00
将多个Spread XML加载到同一个Spread中,你所使用的代码本身是正确的,在公式自动计算这一块,需要设置 this.FpSpread1.ClientAutoCalculation = true; 同时还要设置每个Sheet的this.FpSpread1.Sheets[0].AutoCalculation = true;
- protected void Page_Load(object sender, EventArgs e)
- {
- if (!IsPostBack)
- {
- this.FpSpread1.Sheets.Clear();
- string fpXml = "";
- fpXml = Server.MapPath("t1.xml");
- FpSpread fp = new FpSpread();
- fp.Open(fpXml);
- fp.Sheets[0].SheetName = "t1";
- this.FpSpread1.Sheets.Add(fp.Sheets[0]);
- this.FpSpread1.Sheets[0].AutoCalculation = true;
- fpXml = Server.MapPath("t2.xml");
- fp = new FpSpread();
- fp.Open(fpXml);
- fp.Sheets[0].SheetName = "t2";
- this.FpSpread1.Sheets.Add(fp.Sheets[0]);
- this.FpSpread1.Sheets[1].AutoCalculation = true;
- this.FpSpread1.ClientAutoCalculation = true;
- }
- }
复制代码
FarpointSample.zip
(26.82 KB, 下载次数: 399)
|