stiReport动态控制文本和图形显示不显示
var report = new StiReport();
report.Load(@"Report\RptLiteonCZ.mrt");
//report.Compile();
//如果旧料号的结尾不是-2,那么HF那个标识就不显示
if (baseMaterialLiteonCZ_Temp.OldPN.Substring(baseMaterialLiteonCZ_Temp.OldPN.Length-2)!="-2")
{
var page = report.Pages[0];
var dataBand = (StiDataBand)page.Components["DataBand1"];
dataBand.Components.Remove(report.GetComponentByName("ShapeHf"));
}
// 清除设计报表时的数据源,因为单机的数据库路径在复制到别人电脑上时是变化的
report.Dictionary.DataSources.Clear();
// 注册数据源
report.RegData("SQLiteData", dataTable);
// 同步字典以识别新数据源
report.Dictionary.Synchronize();
FormReport formReport = new FormReport();
formReport.stiReport = report;
formReport.stiReport.Render();
formReport.ShowDialog();