Crystal报表未显示所有记录 [英] Crystal Report Not Displaying All Records

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

问题描述

我在Access数据库中创建了一个包含10条记录的表。我打算在水晶报告中显示这些记录。第一次运行应用程序时,所有10条记录都显示没有问题,但随后显示9条记录,直到程序重新启动。我的代码如下: -



I created a table in access database with 10 records. I intend to display these records in crystal report. The first time I run the application all 10 records were displayed with no problem but display 9 records subsequently untill the program is restarted. my code is as follows:-

Private Sub IndividualLedgerReport_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

      Dim rpt As New IndividualledgerReport2     'The Report you Created
      Dim mycon As New OleDb.OleDbConnection
      Dim mycom As String
      Dim myda As New OleDb.OleDbDataAdapter
      Dim mydt As New DataTable
      Try
          mycon.ConnectionString = "provider=Microsoft.ace.Oledb.12.0; Data source= c:\FinancialStatement\FinStatDB.accdb;Jet OLEDB:Database Password=victor"
          mycon.Open()

          mycom = "Select * from individualledger "
          myda = New OleDb.OleDbDataAdapter(mycom, mycon)
          myda.Fill(mydt)



          rpt.SetDataSource(mydt)
          CrystalReportViewer1.ReportSource = rpt

          mycon.Close()

      Catch ex As Exception
          MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error)

      End Try

  End Sub



请帮助!





先生好。


PLEASE HELP!


Mr. Do Good.

推荐答案

试试 ReportDocument.Refresh 方法 [ ^ ]和/或 CrystalReportViewer.RefreshReport 方法 [ ^ ]
Try ReportDocument.Refresh Method[^] and/or CrystalReportViewer.RefreshReport Method[^]


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

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