|
-
Aug 16th, 2006, 07:26 AM
#1
Thread Starter
Frenzied Member
new to crystal
hi, i'm new for crystal report i'm using vb.net 2005, how cani make it when a button is pressed to show the report or if there is onther way please tell me.
tanks
-
Aug 16th, 2006, 08:14 AM
#2
Re: new to crystal
In this sample i created a crystal report based on a SQL 2000 stored procedures.
VB Code:
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim cr As New CrystalReport1
Dim ds As New DataSet1
Dim com As New SqlClient.SqlCommand
Dim con As New SqlClient.SqlConnection("integrated security=SSPI;data source=(local);persist security info=False;initial catalog=dinefer")
con.Open()
com.Connection = con
com.CommandType = CommandType.StoredProcedure
com.CommandText = "devolve_corpo_encomenda"
com.Parameters.Clear()
com.Parameters.Add("@numero_encomenda", SqlDbType.VarChar).Value = "5/06"
Dim adap As New SqlClient.SqlDataAdapter(com)
adap.Fill(ds, "test")
cr.SetDataSource(ds.Tables("test"))
Me.CrystalReportViewer1.ReportSource = cr
End Sub
"The dark side clouds everything. Impossible to see the future is."
-
Aug 16th, 2006, 08:22 AM
#3
Thread Starter
Frenzied Member
Re: new to crystal
i'm using sql 2005 does it work on the 2005? and i saw on the toolbox some crystal report option but i wasn't able to use cuz i don't know how to use them. if there is a simple way to creat a crystal report using them let me know.
tanks
-
Aug 16th, 2006, 08:37 AM
#4
Re: new to crystal
It will work on MS SQL 2005. The easiest way to create a new report is to use the crystal report creation wizard. create a new connection to your sql table and add it to your report.
"The dark side clouds everything. Impossible to see the future is."
-
Aug 16th, 2006, 11:51 AM
#5
Thread Starter
Frenzied Member
Re: new to crystal
i try it but if i did the databse in sql 2005 it's not showing the report it's only showing the correct report when i use msft access
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|