Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > .NET > Other .NET > Crystal Reports
Password Reminder
Register
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
Crystal Reports General discussion about Crystal Reports. For discussions specific to the book Professional Crystal Reports for VS.NET, please see the book discussion forum for that book.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Crystal Reports section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old December 16th, 2005, 05:31 AM
Registered User
 
Join Date: Aug 2005
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default VB 2005 crystal problem

I have the following function in my app (2005) that should be loading a form
and populating a crystal report contained by a crystal report viewer.

I have an almost identical piece of code in another app (.Net) which works
fine, however when this report is displayed it contains no data. Can't
really see why. Can anyone help?

Public Function PrintReports(ByVal strSQL As String, ByVal strSelect As
String, ByVal strReportName As String, ByVal strXSDName As String) As
Integer

Try

Dim myRptString As String = strReportRoot & strReportName

Dim myXsdTable As String = strXSDName

Dim oleConn As New System.Data.OleDb.OleDbConnection(strConnADO)

Dim oleAdapter As New System.Data.OleDb.OleDbDataAdapter()

Dim myDataset As New DataSet()

Dim myReport As New CrystalReport1

Dim myForm As New frmCrystalViewer

Dim objClass As New clsSQL

If objClass.RunPassedSQL("Delete From SubscriptionsPrintQueue") = False Then
GoTo CatchError ' Deletes data records in table

If objClass.RunPassedSQL(strSQL) = False Then GoTo CatchError ' Populates
data in table

objClass = Nothing

oleAdapter.SelectCommand = New System.Data.OleDb.OleDbCommand(strSelect,
oleConn)

' Connect to the data source, fetch the data, and disconnect from the
database.

oleAdapter.Fill(myDataset, myXsdTable)

MessageBox.Show(myDataset.Tables(0).Rows.Count) ' Shows over 35k records

With myReport

.SetDataSource(myDataset)

.Refresh()

MessageBox.Show(.Rows.Count) ' Shows 0 records

End With

With myForm

.CrystalReportViewer1.ReportSource = myReport

.CrystalReportViewer1.DisplayGroupTree = False

.CrystalReportViewer1.Refresh()

.CrystalReportViewer1.RefreshReport()

.CrystalReportViewer1.Visible = True

.Show()

End With

Catch objE As Exception

MessageBox.Show(objE.Message & vbCrLf & vbCrLf & "Please contact your IT
department.", "Error encountered ==> clsCrystal:PrintReports",
MessageBoxButtons.OK, MessageBoxIcon.Error)

GoTo catcherror

End Try

TheExit:

Exit Function

CatchError:

GoTo TheExit

End Function



Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Deploye crystal report with VB.NET 2005 zrtv Crystal Reports 2 June 6th, 2009 08:09 AM
VB 2005 Crystal Report Connection with SQL 2000 blackspear BOOK: Professional Crystal Reports for VS.NET 0 December 3rd, 2008 09:49 AM
Using Crystal in VB 2005 without Report Viewer csdunaway Crystal Reports 6 July 18th, 2007 11:48 AM
Export Crystal 8.5 using VB 2005 mahegazy Pro Visual Basic 2005 0 March 23rd, 2006 03:11 AM



All times are GMT -4. The time now is 09:46 PM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.