找回密码
 立即注册

QQ登录

只需一步,快速开始

chpopok

高级会员

10

主题

24

帖子

1194

积分

高级会员

积分
1194

活字格认证

chpopok
高级会员   /  发表于:2014-6-11 11:58  /   查看:4967  /  回复:3
条码控件类型为GrapeCity.ActiveReports.PageReportModel.CustomReportItem。我该转成什么控件类型予以赋值?
如:
if (item.GetType() == typeof(GrapeCity.ActiveReports.PageReportModel.TextBox))
                    {

                        GrapeCity.ActiveReports.PageReportModel.TextBox text = new GrapeCity.ActiveReports.PageReportModel.TextBox();
                        text = (GrapeCity.ActiveReports.PageReportModel.TextBox)item;
                        text.Value = stextValue;
                    }
if (item.GetType() == typeof(GrapeCity.ActiveReports.PageReportModel.CustomReportItem))
                    {

                      //条码控件此处该是转什么类型?  
                    }

3 个回复

倒序浏览
roger.wang
社区贡献组   /  发表于:2014-6-11 16:45:00
沙发
Barcode在页面报表下用CustomReportItem强转(区域报表下有Barcode class),
赋值使用CustomProperties,判断Value,赋值。

参考代码:
[Code]
GrapeCity.ActiveReports.PageReportModel.CustomReportItem obj = pgreport.Report.Body.ReportItems["条形码"] as GrapeCity.ActiveReports.PageReportModel.CustomReportItem;

obj.CustomProperties[0]
{GrapeCity.ActiveReports.PageReportModel.CustomPropertyDefinition}
    Name: "dd:Symbology"
    Value: {QRCode}
obj.CustomProperties[1]
{GrapeCity.ActiveReports.PageReportModel.CustomPropertyDefinition}
    Name: "dd:Value"
    Value: {1001}
obj.CustomProperties[1]
[/Code]
回复 使用道具 举报
chpopok
高级会员   /  发表于:2014-6-12 09:10:00
板凳
解决了、谢谢、第一个参数是条码code编码、第二个是给条码赋值对吧、呵呵
回复 使用道具 举报
roger.wang
社区贡献组   /  发表于:2014-6-12 10:10:00
地板
不客气。

你说的没错,是这样的。欢迎有问题开新帖沟通。


回复 使用道具 举报
您需要登录后才可以回帖 登录 | 立即注册
返回顶部