473,394 Members | 2,168 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

help with crystal issue

Hi,
I am trying to print direct to printer using crystal in vs. Here is part of
my code.

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button2.Click

oconn = New SqlConnection(sconnstr)

'oconn.Open()

Try

ocmd.Connection = oconn

ocmd.CommandText = "select user_id,user_name from users where user_id = 1"

ocmd.CommandType = CommandType.Text

oda.SelectCommand = ocmd

Dim ds As New DataSet1

oda.Fill(ds, "users")

orpt.SetDataSource(ds.Tables(0))

rap.Load("C:\Documents and Settings\username\My Documents\Visual
Studio\Projects\crystal\WindowsApplication1\Window sApplication1\CrystalReport1.rpt")

rap.PrintToPrinter(1, False, 0, 0)

Catch ex As Exception

MsgBox(ex.Message)

Finally

oconn.Close()

oconn = Nothing

ocmd = Nothing

oda = Nothing

orpt = Nothing

rap = Nothing

End Try

End Sub

When the button is clicked the page is printed only with the column headers.
I checked my sql statement against the database and it returns 1 row. I
checked to see if the dataset is populated using

MsgBox(ds.Tables(0).Rows(0).Item(1).ToString)

The dataset has the correct data. The dataset is an .xsd file created
manually.

Any ideas?

Thanks

Aug 26 '05 #1
0 1054

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

14
by: LP | last post by:
Hi, I will be taking on a new project developing a web-based "reporting system". The first requirement I got from BI group is "we just want to look at the data". Basically, there is a huge...
20
by: LP | last post by:
Hi, I will be taking on a new project developing a web-based "reporting system". The first requirement I got from BI group is "we just want to look at the data". Basically, there is a huge...
7
by: John | last post by:
I am using Crystal Reports in my application I made using Visual Studio.NET. I installed my application on the client machine, with all the DLLs required(added the merge modules), the engine and...
5
by: Jay | last post by:
I am getting mixed messages from the asp.net website hosting providers - some say they do not support Crystal Reports due to a $25,000 per cpu licensing fee, others say all I need to do is install...
11
by: =?Utf-8?B?cmtibmFpcg==?= | last post by:
How can I stop receiving this message while calling a crystal report? "The report you requested requires further information." Thanks
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.