报表制作工具/报表分析/自定义报表的快速开发组件,看一下代码酷不酷?

abcd9009 2007-08-01 03:59:27
1、VB.NET示例
下载地址:
http://www.etcell.com/
http://www.etcell.com/download.aspx?id=51

'创建ATGridServer WEB服务器端组件对象
Dim ATGrid1 As New ATGridServer

'打开报表模板文件,其中testDBF.et是有WinTable报表设计器制作完成
If Not ATGrid1.OpenDocEx("ETFiles/testDBF.et") Then
Response.Write("不能装载报表模板")
Response.End()
End If

'通过行列获得单元格对象
Dim ppCell As New Cell
ppCell = ATGrid1.GetCell(3, 2)
If Not (ppCell Is Nothing) Then
Response.Write("行值:" & ppCell.Row.ToString())
Response.Write("列值:" & ppCell.Col.ToString())
Response.Write("合并的行数:" & ppCell.RowSpan.ToString())
Response.Write("合并的列数:" & ppCell.ColSpan.ToString())
Response.Write("用行列字符串表示为:" & ppCell.RowColStr.ToString())
Response.Write("单元格的值为:" & ppCell.Value)
Response.Write("单元格的值为:" & ppCell.VarValue)
Response.Write("单元格的文本字符串为:" & ppCell.Text)
Response.Write("单元格的文本字符串为:" & ppCell.VarText)
End If

'输出为html页面
ATGrid1.ResponseHtml(false)

'释放ATGridServer WEB服务器端组件对象
ATGrid1.Close()



2、ASP示例
下载地址:
http://www.etcell.com/
http://www.etcell.com/download.aspx?id=51

'创建ATGridServer WEB服务器端组件对象
Set ATGrid1 = new ATGridServer

'打开报表模板文件,其中testDBF.et是有WinTable报表设计器制作完成
If Not ATGrid1.OpenDocEx("ETFiles/testDBF.et") Then
Response.Write "不能装载报表模板"
Response.End
End If

'通过行列获得单元格对象
Set ppCell = New Cell
ppCell = ATGrid1.GetCell(3, 2)
If Not (ppCell Is Nothing) Then
Response.Write "行值:" & ppCell.Row
Response.Write "列值:" & ppCell.Col
Response.Write "合并的行数:" & ppCell.RowSpan
Response.Write "合并的列数:" & ppCell.ColSpan
Response.Write "用行列字符串表示为:" & ppCell.RowColStr
Response.Write "单元格的值为:" & ppCell.Value
Response.Write "单元格的值为:" & ppCell.VarValue
Response.Write "单元格的文本字符串为:" & ppCell.Text
Response.Write "单元格的文本字符串为:" & ppCell.VarText
End If

'输出为html页面
ATGrid1.ResponseHtml False

'释放ATGridServer WEB服务器端组件对象
ATGrid1.Close
Set ATGrid1 = Nothing



3、C#.NET示例
下载地址:
http://www.etcell.com/
http://www.etcell.com/download.aspx?id=51

//创建ATGridServer WEB服务器端组件对象
ATGridServer ATGrid1 = new ATGridServer();

//打开报表模板文件,其中testDBF.et是有WinTable报表设计器制作完成
if(!ATGrid1.OpenDocEx("ETFiles/testDBF.et"))
{
Response.Write("不能装载报表模板");
Response.End();
}

//通过行列获得单元格对象
Cell ppCell = new Cell();
ppCell = ATGrid1.GetCell(3, 2);
if(ppCell != null)
{
Response.Write("行值:" ppCell.Row.ToString());
Response.Write("列值:" ppCell.Col.ToString());
Response.Write("合并的行数:" ppCell.RowSpan.ToString());
Response.Write("合并的列数:" ppCell.ColSpan.ToString());
Response.Write("用行列字符串表示为:" ppCell.RowColStr.ToString());
Response.Write("单元格的值为:" ppCell.Value);
Response.Write("单元格的值为:" ppCell.VarValue);
Response.Write("单元格的文本字符串为:" ppCell.Text);
Response.Write("单元格的文本字符串为:" ppCell.VarText);
}

//输出为html页面
ATGrid1.ResponseHtml(false);

//释放ATGridServer WEB服务器端组件对象
ATGrid1.Close();
ATGrid1 = null;



4、JSP示例 (特别注意:jsp中属性名和其他语言属性名称不同,需用“Get 属性名”方法取得)
下载地址:
http://www.etcell.com/
http://www.etcell.com/download.aspx?id=51

//创建ATGridServer WEB服务器端组件对象
ATGridServer ATGrid1 = new ATGridServer(pageContext);

//打开报表模板文件,其中testDBF.et是有WinTable报表设计器制作完成
if(!ATGrid1.OpenDocEx("ETFiles/testDBF.et"))
{
out.print("不能装载报表模板");
out.close();
}

//通过行列获得单元格对象
Cell ppCell = new Cell();
ppCell = ATGrid1.GetCell(3, 2);
if(ppCell != null)
{
out.print("行值:" ppCell.GetRow());
out.print( "列值:" ppCell.GetCol());
out.print( "合并的行数:" ppCell.GetRowSpan());
out.print( "合并的列数:" ppCell.GetColSpan());
out.print( "用行列字符串表示为:" ppCell.GetRowColStr());
out.print( "单元格的值为:" ppCell.GetValue());
out.print( "单元格的值为:" ppCell.GetVarValue());
out.print( "单元格的文本字符串为:" ppCell.GetText());
out.print( "单元格的文本字符串为:" ppCell.GetVarText());
}

//输出为html页面
ATGrid1.ResponseHtml(false);

//释放ATGridServer WEB服务器端组件对象
ATGrid1.Close();
ATGrid1 = null;




5、PHP示例
//创建一个ATGridServer控件对象
$ATGrid1 = new ATGridServer();

//打开jianli.eT报表模版文件,OpenDocEx()函数打开虚拟路方式的报表
if( !$ATGrid1->OpenDocEx("ETFiles/testDBF.et"))
{
$ATGrid1=null;
echo "打开报表文件出现错误!";
exit();
}

//通过行列获得单元格对象
$ppCell = new Cell();
$ppCell = $ATGrid1->GetCell(3, 2);
if($ppCell != null)
{
echo "行值:".$ppCell->Row;
echo "列值:".$ppCell->Col;
echo "合并的行数:".$ppCell->RowSpan;
echo "合并的列数:".$ppCell->ColSpan;
echo "用行列字符串表示为:".$ppCell->RowColStr;
echo "单元格的值为:". $ppCell->Value;
echo "单元格的值为:".$ppCell->VarValue;
echo "单元格的文本字符串为:".$ppCell->Text;
echo "单元格的文本字符串为:".$ppCell->VarText;
}

//输出为html页面
$ATGrid1->ResponseHtml(false);

//释放ATGridServer WEB服务器端组件对象
$ATGrid1->Close();
$ppCell=null;
$ATGrid1=null;

下载地址:
http://www.etcell.com/
http://www.etcell.com/download.aspx?id=51
...全文
301 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
  • 打赏
  • 举报
回复
这年头,大家都要源码

4,818

社区成员

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

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