这样绑定应该可以
void Document_LocateDataSource(object sender, LocateDataSourceEventArgs args)
{
WaybillBLL bll = new WaybillBLL();
string reportName = args.Report.PageReport.Document.Printer.DocumentName;
switch (reportName)
{
case "RdlReport":
string btime = args.Report.Parameters[0].Values[0].Value.ToString();
string name = args.Report.Parameters[1].Values[0].Value.ToString();
//获取报表的参数值:
args.Data = bll.GetWaybillFeeDataRDL3(btime, name);
break;
case "RdlReport矩表":
//string btime2 = args.Report.Parameters[0].Values[0].Value.ToString();
//string name2 = args.Report.Parameters[1].Values[0].Value.ToString();
//获取报表的参数值:
args.Data = bll.GetWaybillFeeDataRDL3("", "");
break;
case "随车清单":
PrintListByPlanNoViewModel planView; List<PrintGoodsInfo> goodsList;
bool IsTrue = bll.GetTranSportGoodsList(out planView, out goodsList);
if (IsTrue)
{
if (args.DataSourceName == "InfoData")
{
if (args.DataSetName == "TranInfoDs")
{
args.Data = planView;
}
}
if (args.DataSourceName == "InfoData")
{
if (args.DataSetName == "GoodInfoPointDs")
{
args.Data = goodsList;
}
}
}
break;
default:
args.Data = null;
break;
}
} |