private ReportDocument Rodc = new ReportDocument();
string path = Server.MapPath("../RptSources/warehouse_product_total.rpt");
Rodc.Load(path);
if (!string.IsNullOrEmpty(report_code)) Common.SetRptText(Rodc, "Txt_reportcode", "报表编号:" + report_code);
/// <summary>
/// 设置报表内Text的值
/// </summary>
/// <param name="rptdoc"></param>
/// <param name="controlid"></param>
/// <param name="value"></param>
public static void SetRptText(ReportDocument rptdoc, string controlid, string value)
{
try
{
TextObject rptvalue = (TextObject)rptdoc.ReportDefinition.ReportObjects[controlid];
rptvalue.Text = value;
}
catch
{
throw;
}
}