本文介绍了预览不会显示所有信息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




我正在使用VB.NET 2002和在我的应用程序中访问2002数据库我每个报告都有一个数据集。我使用水晶报告执行报告
并使用textobject添加一些特定的
信息,如下所示:

Dim dbDataAdapter As OleDbDataAdapter
Dim dbDataSet As new dsBalancete()
Dim frmCrystalReport As new frmCrystalReportViewer()
Dim ReportBalancete As new rptBalancete()

Dim SQL as String
Dim objTextObject As TextObject

'打开连接
Connection.Open()

SQL ="SELECT * FROM qBalancete;"
dbDataAdapter =新OleDbDataAdapter(SQL,dbConnection)
dbDataAdapter.Fill(dbDataSet,"qBalancete")
ReportBalancete.SetDataSource(dbDataSet)

'关闭连接
Connection.Close()

dblTotal = 5465464
objTextObject = ReportBalancete.ReportDefinition.ReportObjects.Item("TextTotal")
objTextObject.Text = Format(dblTotal,"Currency" )

如果预览那么
            frmCrystalReport.CrystalReportViewer1.ReportSource = ReportBalancete
其他
            ReportBalancete.PrintToPrinter(1,True,1,1000)
结束如果

objTextObject = Nothing
dbDataAdapter = Nothing
dbDataSet = Nothing

问题是,当我打印时,使用PrintToPrinter语句它
工作得很好,但是当我尝试预览时,它不会出现在
屏幕上。

发生了什么事?

提前坦克,

Hi,

I'm using VB.NET 2002 and Access 2002 databases in my application. I
have also one Dataset for each report that I have. I doing my reports
with crystal reports and I use textobject to add some particular
information, like this:

Dim dbDataAdapter As OleDbDataAdapter
Dim dbDataSet As New dsBalancete()
Dim frmCrystalReport As New frmCrystalReportViewer()
Dim ReportBalancete As New rptBalancete()

Dim SQL as String
Dim objTextObject As TextObject

' Opens the connection
Connection.Open()

SQL = "SELECT * FROM qBalancete;"
dbDataAdapter = New OleDbDataAdapter(SQL, dbConnection)
dbDataAdapter.Fill(dbDataSet, "qBalancete")
ReportBalancete.SetDataSource(dbDataSet)

' Closes the connection
Connection.Close()

dblTotal = 5465464
objTextObject = ReportBalancete.ReportDefinition.ReportObjects.Item("TextTotal")
objTextObject.Text = Format(dblTotal, "Currency")

If Preview Then
            frmCrystalReport.CrystalReportViewer1.ReportSource = ReportBalancete
Else
            ReportBalancete.PrintToPrinter(1, True, 1, 1000)
End If

objTextObject = Nothing
dbDataAdapter = Nothing
dbDataSet = Nothing

The problem is that when I print, with PrintToPrinter statement it
works just fine but when I try to preview it doesn't appear on then
screen.

What's happening ?

Tanks in advance,
Jorge

推荐答案


这篇关于预览不会显示所有信息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-22 12:59