Results 1 to 5 of 5

Thread: new to crystal

  1. #1

    Thread Starter
    Frenzied Member met0555's Avatar
    Join Date
    Jul 2006
    Posts
    1,385

    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

  2. #2
    Frenzied Member Asgorath's Avatar
    Join Date
    Sep 2004
    Location
    Saturn
    Posts
    2,036

    Re: new to crystal

    In this sample i created a crystal report based on a SQL 2000 stored procedures.

    VB Code:
    1. Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    2.         Dim cr As New CrystalReport1
    3.         Dim ds As New DataSet1
    4.         Dim com As New SqlClient.SqlCommand
    5.         Dim con As New SqlClient.SqlConnection("integrated security=SSPI;data source=(local);persist security info=False;initial catalog=dinefer")
    6.         con.Open()
    7.         com.Connection = con
    8.         com.CommandType = CommandType.StoredProcedure
    9.         com.CommandText = "devolve_corpo_encomenda"
    10.         com.Parameters.Clear()
    11.         com.Parameters.Add("@numero_encomenda", SqlDbType.VarChar).Value = "5/06"
    12.         Dim adap As New SqlClient.SqlDataAdapter(com)
    13.  
    14.         adap.Fill(ds, "test")
    15.  
    16.         cr.SetDataSource(ds.Tables("test"))
    17.         Me.CrystalReportViewer1.ReportSource = cr
    18.     End Sub
    "The dark side clouds everything. Impossible to see the future is."

  3. #3

    Thread Starter
    Frenzied Member met0555's Avatar
    Join Date
    Jul 2006
    Posts
    1,385

    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

  4. #4
    Frenzied Member Asgorath's Avatar
    Join Date
    Sep 2004
    Location
    Saturn
    Posts
    2,036

    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."

  5. #5

    Thread Starter
    Frenzied Member met0555's Avatar
    Join Date
    Jul 2006
    Posts
    1,385

    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
  •  



Click Here to Expand Forum to Full Width