【操作】 互換表示状態でポストバックすると、デザイナで数式を設定したSPREADの操作が不能になる
対象製品
SPREAD for ASP.NET 7.0J
状況
修正済み
詳細
ウェブページとSPREADのドキュメントモード設定を行い、互換表示をONの状態でポストバックを行うと、デザイナで数式を設定したSPREADシートの操作が不能になります。
【再現手順】
1.新規WebフォームにSPREADひとつ、ボタンひとつを配置します
2.Webフォームに下記の再現コードを貼り付けます
3.また、デザイナから任意のセルに数式を設定し、Web フォームを起動します
4.IEを互換表示設定にします
5.ボタンを押下し、ポストバックを発生させます
--- シートが操作できなくなります
【再現コード】
------------------------------------
Webフォームクラス
------------------------------------
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace WebApplication37
{
public partial class WebForm1 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
FpSpread1.DocumentMode = FarPoint.Web.Spread.DocumentMode.IE11;
}
}
}
------------------------------------
aspx ファイル
------------------------------------
デザイナでセルや列に任意の数式を設定ください。
------------------------------------
web.config
------------------------------------
configurationタグ内に以下のMETAスイッチ設定を追加してください。
<configuration>
(・・・省略)
<system.webServer>
<httpProtocol>
<customHeaders>
<clear />
<add name="X-UA-Compatible" value="IE=11"/>
</customHeaders>
</httpProtocol>
</system.webServer>
</configuration>
【再現手順】
1.新規WebフォームにSPREADひとつ、ボタンひとつを配置します
2.Webフォームに下記の再現コードを貼り付けます
3.また、デザイナから任意のセルに数式を設定し、Web フォームを起動します
4.IEを互換表示設定にします
5.ボタンを押下し、ポストバックを発生させます
--- シートが操作できなくなります
【再現コード】
------------------------------------
Webフォームクラス
------------------------------------
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace WebApplication37
{
public partial class WebForm1 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
FpSpread1.DocumentMode = FarPoint.Web.Spread.DocumentMode.IE11;
}
}
}
------------------------------------
aspx ファイル
------------------------------------
デザイナでセルや列に任意の数式を設定ください。
------------------------------------
web.config
------------------------------------
configurationタグ内に以下のMETAスイッチ設定を追加してください。
<configuration>
(・・・省略)
<system.webServer>
<httpProtocol>
<customHeaders>
<clear />
<add name="X-UA-Compatible" value="IE=11"/>
</customHeaders>
</httpProtocol>
</system.webServer>
</configuration>
回避方法
Service Pack 3(v7.0.4017.2010)で修正済み。
Service Pack 3(v7.0.4017.2010)より前のバージョンでは次の回避方法が有効です。
------------------------------------------
ポストバックが実行されるタイミングでDocumentModeを再設定することで、本現象の回避が可能です。
【回避コード】
------------------------------------
Webフォームクラス
------------------------------------
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace WebApplication37
{
public partial class WebForm1 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
FpSpread1.DocumentMode = FarPoint.Web.Spread.DocumentMode.IE11;
}
}
protected void Button1_Click(object sender, EventArgs e)
{
// 【回避コード】ポストバックが実行されるタイミングでDocumentModeを再設定します
FpSpread1.DocumentMode = FarPoint.Web.Spread.DocumentMode.NotSet;
FpSpread1.DocumentMode = FarPoint.Web.Spread.DocumentMode.IE11;
}
}
Service Pack 3(v7.0.4017.2010)より前のバージョンでは次の回避方法が有効です。
------------------------------------------
ポストバックが実行されるタイミングでDocumentModeを再設定することで、本現象の回避が可能です。
【回避コード】
------------------------------------
Webフォームクラス
------------------------------------
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace WebApplication37
{
public partial class WebForm1 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
FpSpread1.DocumentMode = FarPoint.Web.Spread.DocumentMode.IE11;
}
}
protected void Button1_Click(object sender, EventArgs e)
{
// 【回避コード】ポストバックが実行されるタイミングでDocumentModeを再設定します
FpSpread1.DocumentMode = FarPoint.Web.Spread.DocumentMode.NotSet;
FpSpread1.DocumentMode = FarPoint.Web.Spread.DocumentMode.IE11;
}
}