BottomRight プロパティが部分的に表示されているセルを対象にしてしまう

文書番号 : 15743     文書種別 : 不具合     最終更新日 : 2004/10/29
文書を印刷する
対象製品
El Tabelle for .NET 2.0J
発生環境
・この現象は次のファイル バージョンのアセンブリで発生します。
v2.0.2004.0304
v2.0.2004.0324 (HotFix)
v2.0.2004.0521
v2.0.2004.0629 (HotFix)
v2.0.2004.0831 (HotFix)
v2.0.2004.1028
状況
修正済み
詳細
Sheet.BottomRight プロパティを参照したとき、部分的に表示されているセルが返される場合があります。
回避方法
この現象はファイル バージョン v2.0.2004.1130 以降のアセンブリで修正されています。

修正版は こちら からダウンロードできます。

また、次の操作を行うことで現象を回避できます

次の関数を使用することで、v1.0 やマニュアルの記載と同じ結果を得ることができます。

[Visual Basic]
Private Function GetBottomRightPosition( _
  ByRef target As GrapeCity.Win.ElTabelle.Sheet _
  ) As GrapeCity.Win.ElTabelle.Position

  Dim objBottomRight As GrapeCity.Win.ElTabelle.Position

  'BottomRightプロパティのセルが完全に表示されているか確認する
  objBottomRight = target.BottomRight
  If target.InVisibleRange(objBottomRight.ToRange, False) = True Then
    Return objBottomRight
  End If

  '左のセルを確認する
  objBottomRight = New GrapeCity.Win.ElTabelle.Position( _
    target.BottomRight.Column - 1, target.BottomRight.Row)
  If target.InVisibleRange(objBottomRight.ToRange, False) = True Then
    Return objBottomRight
  End If

  '上のセルを確認する
  objBottomRight = New GrapeCity.Win.ElTabelle.Position( _
    target.BottomRight.Column, target.BottomRight.Row - 1)
  If target.InVisibleRange(objBottomRight.ToRange, False) = True Then
    Return objBottomRight
  End If

  '左上のセルを確認する
  objBottomRight = New GrapeCity.Win.ElTabelle.Position( _
    target.BottomRight.Column - 1, target.BottomRight.Row - 1)
  If target.InVisibleRange(objBottomRight.ToRange, False) = True Then
    Return objBottomRight
  End If

End Function

'使用例
Debug.WriteLine(GetBottomRightPosition(Sheet1).Expression)

[C#]
private GrapeCity.Win.ElTabelle.Position GetBottomRightPosition(
  GrapeCity.Win.ElTabelle.Sheet target)
{
  GrapeCity.Win.ElTabelle.Position objBottomRight;

  //BottomRightプロパティのセルが完全に表示されているか確認する
  objBottomRight = target.BottomRight;
  if(target.InVisibleRange(objBottomRight.ToRange(), false) == true)
  {
    return objBottomRight;
  }

  //左のセルを確認する
  objBottomRight = new GrapeCity.Win.ElTabelle.Position(
    target.BottomRight.Column - 1, target.BottomRight.Row);
  if(target.InVisibleRange(objBottomRight.ToRange(), false) == true)
  {
    return objBottomRight;
  }

  //上のセルを確認する
  objBottomRight = new GrapeCity.Win.ElTabelle.Position(
    target.BottomRight.Column, target.BottomRight.Row - 1);
  if(target.InVisibleRange(objBottomRight.ToRange(), false) == true)
  {
    return objBottomRight;
  }

  //左上のセルを確認する
  objBottomRight = new GrapeCity.Win.ElTabelle.Position(
    target.BottomRight.Column - 1, target.BottomRight.Row - 1);
  if(target.InVisibleRange(objBottomRight.ToRange(), false) == true)
  {
    return objBottomRight;
  }
  return GrapeCity.Win.ElTabelle.Position.Empty;
}

private void button1_Click(object sender, System.EventArgs e)
{
  System.Diagnostics.Debug.WriteLine(
    GetBottomRightPosition(sheet1).Expression.ToString());
}
キーワード
ELTB04316

この文書は、以前は次のバグレポートIDで公開されていました : 4408