FastReport编码 table数据模板

 

 

 

 

<?xml version="1.0" encoding="utf-8"?>
<Report ScriptLanguage="CSharp" ReferencedAssemblies="System.dll&#13;&#10;System.Drawing.dll&#13;&#10;System.Windows.Forms.dll&#13;&#10;System.Data.dll&#13;&#10;System.Xml.dll&#13;&#10;System.Core.dll&#13;&#10;System.Drawing.dll" ReportInfo.Created="05/21/2020 15:51:04" ReportInfo.Modified="06/19/2020 14:13:19" ReportInfo.CreatorVersion="2019.3.2.0">
<ScriptText>using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Windows.Forms;
using System.Drawing;
using System.Data;
using FastReport;
using FastReport.Data;
using FastReport.Dialog;
using FastReport.Barcode;
using FastReport.Table;
using FastReport.Utils;
using System.Linq;
using System.Drawing;

namespace FastReport
{
public class ReportScript
{

private void Table1_ManualBuild(object sender, EventArgs e)
{

DataSourceBase datas = Report.GetDataSource(&quot;DataTable&quot;);
datas.Init();

int colCount = datas.Columns.Count;

Table1.PrintRow(0);
for (int i = colCount; i &lt; colCount; i++)
{
Cell1.Text = datas.Columns[i].Alias;
Table1.PrintColumn(0);
}

while (datas.HasMoreRows)
{
Table1.PrintRow(1);
for (int i = 0; i &lt; colCount; i++)
{
Cell2.Text = datas[datas.Columns[i]].ToString();
Table1.PrintColumn(0);
}
datas.Next();
}


Table1.Width=Page1.Width;
}



}
}
</ScriptText>
<Dictionary/>
<ReportPage Name="Page1" Watermark.Font="宋体, 60pt" UnlimitedWidth="true">
<DataBand Name="Data1" Width="718.2" Height="151.2" Cursor="No">
<TableObject Name="Table1" Width="85.05" Height="45.35" ManualBuildEvent="Table1_ManualBuild">
<TableColumn Name="Column1" Width="85.05"/>
<TableRow Name="Row1" Height="21.73">
<TableCell Name="Cell1" Font="宋体, 9pt"/>
</TableRow>
<TableRow Name="Row2" Height="23.62">
<TableCell Name="Cell2" Font="宋体, 9pt"/>
</TableRow>
</TableObject>
</DataBand>
<PageFooterBand Name="PageFooter1" Top="155.2" Width="718.2" Height="18.9"/>
</ReportPage>
</Report>

posted @ 2020-06-28 15:45  杰克_00  阅读(624)  评论(0编辑  收藏  举报