Crystal报表未显示vb.net中的所有记录 [英] Crystal reports not showing all records in vb.net

查看:65
本文介绍了Crystal报表未显示vb.net中的所有记录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用SQLSERVER2005.我想制作一个水晶报表来显示多个表(关系表).我使用的是视图",它可以工作,但是Crystal报告未显示所有记录.

这是我的代码:

Im using SQLSERVER 2005. I want to make a crystal report to show a multiple table( relation table). Im using a ''view'' and it work, but the Crystal reports not showing all records.

Here my code :

Option Explicit On
Imports CrystalDecisions.CrystalReports.Engine
Imports CrystalDecisions.Shared
Imports System.Data.SqlClient
Public Class PrintJadwalKuliah
    Dim xKoneksi As New SqlConnection
    Dim xAdapter, xAdapter1, xAdapter2 As New SqlDataAdapter
    Dim obj_RepDoc, obj_RepDoc1, obj_RepDoc2 As New ReportDocument
    Dim Da2 As SqlDataAdapter
    Dim Ds As DataSet
    Dim dt2 As New DataTable
    Dim xDataset As New _FKIP_UNILAKDataSet()
    Private Sub PrintJadwalKuliah_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
  xKoneksi.ConnectionString = "Data Source=RAGAZ-PC\SQLEXPRESS;Initial Catalog=FKIP-UNILAK;Integrated Security=True"
        xAdapter2 = New SqlDataAdapter("SELECT * FROM [FKIP-UNILAK].[dbo].[JadwalKuliah] where jurusan =''Bahasa Inggris'' order by nama_hari desc ", xKoneksi)
        xAdapter2.Fill(xDataset, "JadwalKuliah")
        obj_RepDoc2 = New CrystalReport_JadwalKuliah
        obj_RepDoc2.SetDataSource(xDataset)
        CrystalReportViewer1.ReportSource = obj_RepDoc2
    End Sub
End Class

推荐答案

水晶报表的设计方式可能存在问题.
确保一个报告区域与另一个报告区域没有重叠.
It could be an issue with the way the crystal report has been designed.
Make sure there is no overlap of one report area over the other.


在xAdapter2.Fill(...)行之后的行上设置一个断点.然后检查DataTable/DataSet的内容,并确保您应该看到的所有记录都在其中.如果没有,那么您的SQL语句就会出现问题.您期望的记录不符合语句中WHERE子句的条件.

如果有记录,那么报告就会出现设计问题.
Set a breakpoint on the line immediately following the xAdapter2.Fill(...) line. THen chekc the contents of the DataTable/DataSet and make sure all of the records you are supposed to see are in there. If not, then you''ve got a problem a problem with your SQL statement. The records you are expecting don''t meet the criteria of the WHERE clause in your statement.

If the records are there, then you''ve got a design problem with the report.


这篇关于Crystal报表未显示vb.net中的所有记录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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