日期:2014-05-20  浏览次数:20938 次

怎么设置水晶报表子报表列字段的宽度

现在有一个报表,报表有一个明细,明细是子报表,我想做一个打印设置是否打印显示isbn这个列
现在我在程序里面这样写

If Not isShowIsbn Then
'EnableSuppress即抑制显示【true--不显示,false--显示】
repo.ReportDefinition.ReportObjects("TitleIsbn").ObjectFormat.EnableSuppress = True
repo.ReportDefinition.ReportObjects("TitleShum").Width = 4077
repo.ReportDefinition.ReportObjects("shuh1").ObjectFormat.EnableSuppress = True
repo.ReportDefinition.ReportObjects("shum1").Width = 4077
End If

可是 shuh1和shum1 都是子报表中的,我在网上找了好久都没有关于这方面的解决方案,请高手指教一下!

------解决方案--------------------
引用:

现在有一个报表,报表有一个明细,明细是子报表,我想做一个打印设置是否打印显示isbn这个列
现在我在程序里面这样写

If Not isShowIsbn Then
'EnableSuppress即抑制显示【true--不显示,false--显示】
repo.ReportDefinition.ReportObjects("TitleIsbn").ObjectFormat.EnableSuppress = True
repo.ReportDefinition.ReportObjects("TitleShum").Width = 4077
repo.ReportDefinition.ReportObjects("shuh1").ObjectFormat.EnableSuppress = True
repo.ReportDefinition.ReportObjects("shum1").Width = 4077
End If

可是 shuh1和shum1 都是子报表中的,我在网上找了好久都没有关于这方面的解决方案,请高手指教一下!






repo.Subreports["ChildCrystalReport.rpt"].ReportDefinition.ReportObjects("shuh1").ObjectFormat.EnableSuppress