如何加载子报告 [英] How to Load Sub Report

查看:89
本文介绍了如何加载子报告的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Crystal Reports中使用了两个子报表.我正在为子报表的设置数据源使用以下编码.主要报告将会到来.但是子报告没有显示.请任何人帮助我.

I am using two subreports in Crystal Reports. I am using following coding for set datasource for the subreport. The main report will come. But the subreport is not displaying. Please anybody help me.

rptdoc.SetDataSource(ds.Tables[0]);
rptdoc.Subreports[0].SetDataSource(ds2.Tables[0]);
rptdoc.Subreports[1].SetDataSource(ds3.Tables[0]);



而且我也尝试了以下代码,错误显示对象引用不是对象的实例"



And also I tried this following code, the error displays "the object reference is not to an instance of an object"

rptdoc.OpenSubreport("SALESTRANSACTION").SetDataSource(ds2);
rptdoc.OpenSubreport("RECEIPTTRANSACTION").SetDataSource(ds2);

推荐答案

似乎,您正在使用空对象?你调试过代码了吗?在哪一行生成此异常?
It seems that , you are using a null object? have you debugged your code? In which line this exception is generated?


这篇关于如何加载子报告的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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