winfrom报表FastReport第二次加载报错跟踪不到
哪位大神帮忙看看
FrxDataTable.cs在楼下。报的错是

/// <summary>
/// 资产领用报表
/// </summary>
/// <param name="applyId">领用单Id</param>
public void ViewReport(string applyId)
{
try
{
report = null;
datatable = null;
dataviewAsset = null;
// Create report object
report = new TfrxReportClass();
report.SetGlobalVariable("Language", "Chinese");
#region 查询领用单报表数据
ApplyBLL applyBll = new ApplyBLL();
DataSet ds = null;
DataTable dtB2 = null;
DataTable dtR2 = null;
DataTable dtAsset = null;
if (!string.IsNullOrEmpty(applyId))
{
ds = applyBll.GetApplyReport(applyId);
dtB2 = ds.Tables["apply"];
dtR2 = ds.Tables["applyRel"];
dtAsset = ds.Tables["asset"];
}
#endregion
datatable = new FrxDataTable(dtB2);
datatable.Dispose();
datatable.AcceptChanges();
// These events used for Master/Detail implementation
datatable.FrxEventOnFirst += new FrxOnFirst(datatable_FrxEventHandler);
datatable.FrxEventOnNext += new FrxOnNext(datatable_FrxEventHandler);
datatable.FrxEventOnPrior += new FrxOnPrior(datatable_FrxEventHandler);
// Create the FR compatible DataView object
dataviewAsset = new FrxDataView(dtAsset, "DataViewAsset");
// We need following to make ongoing the report windows modal
report.MainWindowHandle = (int)this.Handle;
// Load demmonstration report from file
string reportPath = Smt.Utils.Common.SysRootPath() + "report\\资产领用报表.fr3";
report.LoadReportFromFile(reportPath);
report.ClearDatasets();
// Asiign datasets to report one more time
// beacuse theLoadReport... family functions breaks links between report and dataset
datatable.AssignToReport(true, report);
dataviewAsset.AssignToReport(true, report);
// Assigns DataTable to MasterBand
datatable.AssignToDataBand("MasterData1", report);
// Assigns DataView to DetailBand
dataviewAsset.AssignToDataBand("DetailData1", report);
report.ShowReport();//fastreport自带的预览窗体界面
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
}
}FrxDataTable.cs在楼下。报的错是
...全文
相关推荐
c# Winfrom圆形窗体,panel圆角,Winfrom圆角
本程序三个Winfrom,分别是Winfrom圆形窗体,panel圆角,Winfrom圆角
winfrom水晶报表
winfrom水晶报表 包含两个压缩包,一个基本操作,一个动态水晶报表打印
RDLC在winfrom报错解决办法.rar
RDLC报表 在WinForm里运行出现 未能加载文件或程序集microsoft.reportviewer.winforms,里面有所需要的的dll,下载后直接使用即可
C#打印报表
C#报表打印,用到fastreport和grid等
WinFrom的加载等待框(异步)
WinFrom的记载等待框,里面Form1是一个小示例,使用很简单。是通过异步实现的。很实用


图表区

