发布一款免费的GRID控件

yrb 2007-03-22 05:56:42
Yfgrid控件说明:
本Grid控件支持多Sheet、单元格合并、行列冻结、页面设置、打印(预览)等常规Grid操作,Grid内容保存为XML格式文件,采用OLE的方式导出EXCEL文件。目前没有表达式求值和图表功能,计划下一个版加入表达式求值。本Grid可以用于C/S或B/S程序的数据录入和报表打印部分,如果开发B/S程序,可以非常方便的使用AJAX技术进行报表填写、数据传送。
本Grid控件可以免费使用,不过免费版本在页眉上打印尚未注册字样。
本控件使用VC++开发,尚完善中,欢迎各位提出宝贵建议。
下面是控件支持的方法和事件,更详细的信息稍后提供。
控件下载地址:
http://www.yfsoft.cn/soft/yfgrid.rar
1、本控件支持的方法:
Sub GetCurSheet(CurSheet as integer)

Sub GetSelectRange(Sheet As Integer, Col1 As Long, Row1 As Long, Col2 As Long, Row2 As Long)

Sub GetFocusCell(Sheet As Integer, Col As Long, Row As Long)

Sub SetBgColor(heet As Integer, Col1 As Long, Row1 As Long, Col2 As Long, Row2 As Long, BgColor As OLE_COLOR)

Sub SetFgColor(Sheet As Integer, Col1 As Long, Row1 As Long, Col2 As Long, Row2 As Long, FgColor As OLE_COLOR)

Sub SetBorderAll(Sheet As Integer, Col1 As Long, Row1 As Long, Col2 As Long, Row2 As Long, Width As Integer)

Sub SetBorderLeft(Sheet As Integer, Col1 As Long, Row1 As Long, Col2 As Long, Row2 As Long, Width As Integer)

Sub SetBorderTop(Sheet As Integer, Col1 As Long, Row1 As Long, Col2 As Long, Row2 As Long, Width As Integer)

Sub SetBorderRightSetBorderRight(Sheet As Integer, Col1 As Long, Row1 As Long, Col2 As Long, Row2 As Long, Width As Integer)

Sub SetBorderBottom(Sheet As Integer, Col1 As Long, Row1 As Long, Col2 As Long, Row2 As Long, Width As Integer)

Sub SetInsideAll(Sheet As Integer, Col1 As Long, Row1 As Long, Col2 As Long, Row2 As Long, Width As Integer)

Sub SetInsideVertical(Sheet As Integer, Col1 As Long, Row1 As Long, Col2 As Long, Row2 As Long, Width As Integer)

Sub SetInsideHorizontal(Sheet As Integer, Col1 As Long, Row1 As Long, Col2 As Long, Row2 As Long, Width As Integer)
Sub SetFontName(Sheet As Integer, Col1 As Long, Row1 As Long, Col2 As Long, Row2 As Long, FontName As String)

Sub SetFontBold(Sheet As Integer, Col1 As Long, Row1 As Long, Col2 As Long, Row2 As Long, Bold As Integer)

Sub SetFontItalic(Sheet As Integer, Col1 As Long, Row1 As Long, Col2 As Long, Row2 As Long, Italic As Integer)

Sub SetFontUnderline(Sheet As Integer, Col1 As Long, Row1 As Long, Col2 As Long, Row2 As Long, Underline As Integer)

Sub SetFontSize(Sheet As Integer, Col1 As Long, Row1 As Long, Col2 As Long, Row2 As Long, Size As Integer)

Sub SetHorzAlign(Sheet As Integer, Col1 As Long, Row1 As Long, Col2 As Long, Row2 As Long, Align As Integer)

Sub SetVertAlign(Sheet As Integer, Col1 As Long, Row1 As Long, Col2 As Long, Row2 As Long, Align As Integer)

Sub MergeCell(Sheet As Integer, Col1 As Long, Row1 As Long, Col2 As Long, Row2 As Long)

Sub UnMergeCell(Sheet As Integer, Col1 As Long, Row1 As Long, Col2 As Long, Row2 As Long)

Sub InsertCol(Sheet As Integer, Col As Long, ColCount As Long)

Sub InsertRow(Sheet As Integer, Row As Long, RowCount As Long)

Sub DeleteCol(Sheet As Integer, Col As Long, ColCount As Long)

Sub DeleteRow(Sheet As Integer, Row As Long, RowCount As Long)

Sub AppendSheet(SheetName As String, ColCount As Long, RowCount As Long)

Sub DeleteSheet(Sheet As Integer)

Sub SetFixedColRow(Sheet As Integer, Col As Long, Row As Long)

Sub SaveToXmlFile(XmlFile As String) As Boolean

Function SaveToXmlDOM(pUnknown As Unknown) As Boolean
Function SaveToXlsFile(XlsFile As String) As Boolean

Function LoadFromXmlFile(XmlFile As String) As Boolean

Function LoadFromXmlDOM(pUnknown As Unknown) As Boolean

Sub SetCellText(Sheet As Integer, Col As Long, Row As Long, CellText As String)

Sub GetCellText(Sheet As Integer, Col As Long, Row As Long, CellText As String)

Sub GetRowCount(Sheet As Integer, RowCount As Long)

Sub GetColCount(Sheet As Integer, ColCount As Long)

Sub DeleteAllSheet()

Sub SetRowFlag(Sheet As Integer, Row As Long, Flag As Long)

Sub GetRowFlag(Sheet As Integer, Row As Long, Flag As Long)

Sub GetSheetIndexBySheetName(Name As String, Index As Integer)

Sub GetSheetNameBySheetIndex(Index As Integer, Name As String)

Sub SetPrtPara(Sheet As Integer)

Sub Print(Sheet As Integer)

Sub PrintPreview(Sheet As Integer)

2、控件支持的事件
Event SelectionChange(Col1 As Long, Row1 As Long, Col2 As Long, Row2 As Long, Sheet As Integer)

Event SheetChange(Sheet As Integer)

Event GotFocus()

Event LostFocus()

...全文
342 22 打赏 收藏 转发到动态 举报
写回复
用AI写文章
22 条回复
切换为时间正序
请发表友善的回复…
发表回复
yrb 2007-03-27
  • 打赏
  • 举报
回复
up
yrb 2007-03-24
  • 打赏
  • 举报
回复
xml本身就是给机器识别的。
cloudtarget 2007-03-24
  • 打赏
  • 举报
回复
xml本身就是给机器识别的。
yrb 2007-03-23
  • 打赏
  • 举报
回复
up
bluesky23 2007-03-23
  • 打赏
  • 举报
回复
LZ强. UP
快乐老猫 2007-03-23
  • 打赏
  • 举报
回复
看的头晕
yrb 2007-03-23
  • 打赏
  • 举报
回复
yfgrid导出的xml文件:
<?xml version="1.0" ?>
- <YFGrid DefRowHeight="18" DefColWidth="80">
- <SheetList>
- <Sheet Name="Sheet1" ColCount="4" RowCount="10" FixedColCount="0" FixedRowCount="0">
- <StyleList>
- <Style Index="0">
<Font />
<Align />
<Border Left="1" Top="1" Right="1" Bottom="1" />
<Color />
</Style>
- <Style Index="1">
<Font />
<Align Vert="0" />
<Border Left="1" Top="1" Right="1" Bottom="1" />
<Color />
</Style>
- <Style Index="2">
<Font />
<Align Vert="1" />
<Border Left="1" Top="1" Right="1" Bottom="1" />
<Color />
</Style>
- <Style Index="3">
<Font />
<Align Horz="1" Vert="0" />
<Border Left="1" Top="1" Right="1" Bottom="1" />
<Color />
</Style>
- <Style Index="4">
<Font />
<Align Horz="1" Vert="1" />
<Border Left="1" Top="1" Right="1" Bottom="1" />
<Color />
</Style>
- <Style Index="5">
<Font />
<Align Horz="1" />
<Border Left="1" Top="1" Right="1" Bottom="1" />
<Color />
</Style>
- <Style Index="6">
<Font />
<Align Horz="2" />
<Border Left="1" Top="1" Right="1" Bottom="1" />
<Color />
</Style>
- <Style Index="7">
<Font />
<Align Horz="2" Vert="0" />
<Border Left="1" Top="1" Right="1" Bottom="1" />
<Color />
</Style>
- <Style Index="8">
<Font />
<Align Horz="2" Vert="1" />
<Border Left="1" Top="1" Right="1" Bottom="1" />
<Color />
</Style>
- <Style Index="9">
<Font />
<Align />
<Border Left="1" Top="1" Right="1" Bottom="1" />
<Color Background="4227327" />
</Style>
- <Style Index="10">
<Font />
<Align />
<Border Left="1" Top="1" Right="1" Bottom="1" />
<Color Foreground="255" />
</Style>
</StyleList>
- <CellList>
<Cell Col="0" Row="0" StyleIndex="0" CellType="0">对齐方式</Cell>
<Cell Col="0" Row="1" StyleIndex="0" CellType="0" />
<Cell Col="0" Row="2" StyleIndex="0" CellType="0" />
<Cell Col="0" Row="3" StyleIndex="0" CellType="0">背景色</Cell>
<Cell Col="0" Row="4" StyleIndex="0" CellType="0">文字色</Cell>
<Cell Col="0" Row="5" StyleIndex="0" CellType="0">合并单元格</Cell>
<Cell Col="0" Row="6" StyleIndex="0" CellType="0" />
<Cell Col="0" Row="7" StyleIndex="0" CellType="0" />
<Cell Col="0" Row="8" StyleIndex="0" CellType="0" />
<Cell Col="0" Row="9" StyleIndex="0" CellType="0" />
<Cell Col="1" Row="0" StyleIndex="1" CellType="0">左上</Cell>
<Cell Col="1" Row="1" StyleIndex="3" CellType="0">中上</Cell>
<Cell Col="1" Row="2" StyleIndex="7" CellType="0">右上</Cell>
<Cell Col="1" Row="3" StyleIndex="9" CellType="0" />
<Cell Col="1" Row="4" StyleIndex="10" CellType="0">yfgrid</Cell>
<Cell Col="1" Row="5" StyleIndex="0" CellType="0" />
<Cell Col="1" Row="6" StyleIndex="0" CellType="0" />
<Cell Col="1" Row="7" StyleIndex="0" CellType="0" />
<Cell Col="1" Row="8" StyleIndex="0" CellType="0" />
<Cell Col="1" Row="9" StyleIndex="0" CellType="0" />
<Cell Col="2" Row="0" StyleIndex="2" CellType="0">左中</Cell>
<Cell Col="2" Row="1" StyleIndex="4" CellType="0">中中</Cell>
<Cell Col="2" Row="2" StyleIndex="8" CellType="0">右中</Cell>
<Cell Col="2" Row="3" StyleIndex="9" CellType="0" />
<Cell Col="2" Row="4" StyleIndex="10" CellType="0" />
<Cell Col="2" Row="5" StyleIndex="0" CellType="0" />
<Cell Col="2" Row="6" StyleIndex="0" CellType="0" />
<Cell Col="2" Row="7" StyleIndex="0" CellType="0" />
<Cell Col="2" Row="8" StyleIndex="0" CellType="0" />
<Cell Col="2" Row="9" StyleIndex="0" CellType="0" />
<Cell Col="3" Row="0" StyleIndex="0" CellType="0">左下</Cell>
<Cell Col="3" Row="1" StyleIndex="5" CellType="0">中下</Cell>
<Cell Col="3" Row="2" StyleIndex="6" CellType="0">右下</Cell>
<Cell Col="3" Row="3" StyleIndex="9" CellType="0" />
<Cell Col="3" Row="4" StyleIndex="10" CellType="0" />
<Cell Col="3" Row="5" StyleIndex="0" CellType="0" />
<Cell Col="3" Row="6" StyleIndex="0" CellType="0" />
<Cell Col="3" Row="7" StyleIndex="0" CellType="0" />
<Cell Col="3" Row="8" StyleIndex="0" CellType="0" />
<Cell Col="3" Row="9" StyleIndex="0" CellType="0" />
</CellList>
<SelectRange Col1="0" Row1="9" Col2="0" Row2="9" />
<FocusCell Col="0" Row="10" />
- <MergeCellList>
<MergeCell Col1="1" Row1="5" Col2="3" Row2="9" />
</MergeCellList>
<ColWidthList />
- <RowHeightList>
<RowHeight Row="0" Height="33" />
<RowHeight Row="1" Height="33" />
<RowHeight Row="2" Height="33" />
</RowHeightList>
</Sheet>
</SheetList>
</YFGrid>
yrb 2007-03-23
  • 打赏
  • 举报
回复
技术支持qq:173586687,标注“grid控件”
yrb 2007-03-23
  • 打赏
  • 举报
回复
up
ChinaRa 2007-03-23
  • 打赏
  • 举报
回复
本Grid控件可以免费使用,不过免费版本在页眉上打印尚未注册字样。
呵呵,还是要注册啊
jackie168 2007-03-23
  • 打赏
  • 举报
回复
UP
yrb 2007-03-23
  • 打赏
  • 举报
回复
up
cloudtarget 2007-03-23
  • 打赏
  • 举报
回复
好像很强
yrb 2007-03-23
  • 打赏
  • 举报
回复
up
yf110 2007-03-23
  • 打赏
  • 举报
回复
好像很强
dovelee 2007-03-23
  • 打赏
  • 举报
回复
up
zzd8310 2007-03-22
  • 打赏
  • 举报
回复
UP
dashi 2007-03-22
  • 打赏
  • 举报
回复
顶~~~
dreamnyj 2007-03-22
  • 打赏
  • 举报
回复
原来是shareware啊。。。关注一下。
fim 2007-03-22
  • 打赏
  • 举报
回复
UP
加载更多回复(2)

828

社区成员

发帖
与我相关
我的任务
社区描述
Delphi 非技术区
社区管理员
  • 非技术区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧