双11狂欢大促

盲盒赢 定制羽绒服

开启惊喜盲盒,抽取你的专属好礼

— 惊喜奖品抢先看 —

winfrom报表FastReport第二次加载报错跟踪不到

起个昵称真费劲 起个昵称真费劲 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
哪位大神帮忙看看
/// <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在楼下。报的错是
...全文

相关推荐

评论 3
收藏 已收藏
分享
返回顶部
起个昵称真费劲
图表区 4,818 成员 14,133 内容