在C#中FastReport怎么用
1个回答
推荐于2016-10-13 · 知道合伙人软件行家
关注
展开全部
引用:FastReport.dll,FastReport.Bars.dll,FastReport.Editor.dll
设计好**.frx 文件
CS代码:
DataSet FDataSet = new DataSet();
DataTable table = new DataTable();
table.TableName = "Items";
FDataSet.Tables.Add(table);
table.Columns.Add("id", typeof(int));
table.Columns.Add("aaa", typeof(string));
table.Rows.Add(0,"ab");
table.Rows.Add(1,"abc");
FastReport.Report report1 = new FastReport.Report();
try
{
// load the existing report
report1.Load("***.frx");
// register the dataset
report1.RegisterData(FDataSet);
report1.GetDataSource("Items").Enabled = true;
// run the report
report1.Show();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
finally
{
// free resources used by report
report1.Dispose();
}
设计好**.frx 文件
CS代码:
DataSet FDataSet = new DataSet();
DataTable table = new DataTable();
table.TableName = "Items";
FDataSet.Tables.Add(table);
table.Columns.Add("id", typeof(int));
table.Columns.Add("aaa", typeof(string));
table.Rows.Add(0,"ab");
table.Rows.Add(1,"abc");
FastReport.Report report1 = new FastReport.Report();
try
{
// load the existing report
report1.Load("***.frx");
// register the dataset
report1.RegisterData(FDataSet);
report1.GetDataSource("Items").Enabled = true;
// run the report
report1.Show();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
finally
{
// free resources used by report
report1.Dispose();
}
本回答被提问者和网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询