水晶报表中没有数据填充. [英] No Data Populate in crystal report.

查看:72
本文介绍了水晶报表中没有数据填充.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的vb.net应用程序中.有关使用代码从数据库打印的详细信息.
我创建了一个XSD文件,并将报告源设置为此文件,并放置了必填字段.但是在水晶报表中,只打印列头.
对于XSD文件,我做了
数据(菜单)->添加新的数据源->数据库->下一步->设置连接字符串->选择数据库->测试连接成功.
对于水晶报告
添加新项目->选择Crystal报表->标准OK->项目数据源-> ADO.Net数据集->选择创建的XSD文件->选择所需的表和字段->好吧

然后按以下代码显示此报告.

In my vb.net application. For print details from a database using code.
I created a XSD file and set report source as this file and put required fields . But in crystal report only column head is printed.
For XSD file I did as
Data (Menu)-> Add New DataSource-->Database->Next->set connection string-->Select DB-->Test connection Successed .
For crystal report
Add New Item -->Select Crystal Report->Standard OK-->Project Data Source-->ADO.Net Datasets --> Select creted XSD file--> select required table & fields--> Ok

And I show this report by code as below.

StrSQl = " SELECT  * from  tbl_Members"

If (clsReport.FillData(StrSQl, ds, roConform)) = 0 /* for execute query
 Then
                       GoTo err128
                   End If
err128:
                   crptReport.SetDataSource(ds)
                   CRViewer.ReportSource = crptReport
                   CRViewer.Show()
                   CRViewer.RefreshReport()
                   ds.Dispose()



查询影响了17行.但是在水晶报表中不显示任何行.
是什么原因以及如何解决



Query effected 17 rows. But in crystal report does not show any rows.
What is the reason and how can solve

推荐答案

实际上您没有在报表查看器中加载报表文件,这就是问题所在.像下面的
Actually you didn''t loaded the report file in report viewer, that''s the problem. Like below
CRViewer.Load("C:\Report1.rpt")


有关更多详细信息
使用Crystal Report Viewer从.NET运行Crystal Report [


For more details
Run a Crystal Report from .NET using the Crystal Report Viewer[^]


正如我之前在某些帖子中所说的,这是最好的方法处理水晶报表(对我而言)是使用记录集,并具有一个模块来通过ttx文件将其解析为水晶报表.它的速度非常快,而且从来没有问题.
as i said in some post earlier, the best way to deal with crystal report (for me) is to work with recordsets and having a module to parse them to crystal report by ttx files. Its very fast and never had a problem.


这篇关于水晶报表中没有数据填充.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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