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
Printable View
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
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
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
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.
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