如何在运行时更改晶体重新传输中的子报表字段的对齐方式 [英] How to change alignment of a Subreport field in crystal reoport at runtime

查看:60
本文介绍了如何在运行时更改晶体重新传输中的子报表字段的对齐方式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在水晶报告中,我想相应地设置字段对齐



i我正在使用此代码



In a crystal report, I want to set alignment of a fields accordingly

i am using this code

var main = cr.ReportDefinition.ReportObjects["head1"];
            gro.ObjectFormat.HorizontalAlignment = CrystalDecisions.Shared.Alignment.RightAlign;//working
var sub = cr.ReportDefinition.ReportObjects["h1"];
            gro.ObjectFormat.HorizontalAlignment = CrystalDecisions.Shared.Alignment.RightAlign;//not working





其中head是主报告的字段,h是子报告的字段



显示错误索引超出了数组的范围。



请帮帮我



谢谢



where "head" is the field of main report and "h" is the field of sub report

Are showing error "Index was outside the bounds of the array."

pls help me

thanks

推荐答案

h1未在主报告中定义,因为您只是解释。

为此,您需要通过SubReports属性访问子报告。
h1 is not defined in the main report as you just explain.
To do so, you need to access the sub report through the SubReports property.


这篇关于如何在运行时更改晶体重新传输中的子报表字段的对齐方式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆