Results 1 to 6 of 6

Thread: [RESOLVED] Crystal report help

  1. #1

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

    Resolved [RESOLVED] Crystal report help

    hi, i making a program that needs crystal report but there is a problem it's not showing the correct report. and i posted the prolem but i didn't get the solution if there is someone who want's to help me

    vb.net 2005 SQL 2005

    tanks
    Last edited by Hack; Oct 16th, 2006 at 06:19 AM. Reason: Removed EMail address

  2. #2
    Just Married shakti5385's Avatar
    Join Date
    Mar 2006
    Location
    Udaipur,Rajasthan(INDIA)
    Posts
    3,747

    Thumbs up Re: Crystal report help

    Quote Originally Posted by met0555
    hi, i making a program that needs crystal report but there is a problem it's not showing the correct report. and i posted the prolem but i

    tanks
    Please describe the problem where you are getting the problem , and related to the crystal related problem there is the crystal report help at my signature for there you are able to learn easily how to call them in the project

  3. #3

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

    Re: Crystal report help

    well, in ur signature the code is for vb6 and before, i'm using vb.nt 2005 and SQL 2005. i will retry to explain my problem. i connected th database with the program and theni tried to make a cryst report using the report tool, then i located the database that is connected to my database , t then in the report i can only this the white paper.

  4. #4
    Just Married shakti5385's Avatar
    Join Date
    Mar 2006
    Location
    Udaipur,Rajasthan(INDIA)
    Posts
    3,747

    Thumbs up Re: Crystal report help

    Quote Originally Posted by met0555
    well, in ur signature the code is for vb6 and before, i'm using vb.nt 2005 and SQL 2005. i will retry to explain my problem. i .
    Check this code for the VB.NET change the connection and the table and the report name according to your condition
    VB Code:
    1. Dim CrystalReportViewer1 As CrystalDecisions.Windows.Forms.CrystalReportViewer = New CrystalDecisions.Windows.Forms.CrystalReportViewer
    2. Dim rpt As CrystalDecisions.CrystalReports.Engine.ReportDocument = New CrystalDecisions.CrystalReports.Engine.ReportDocument
    3.         CrystalReportViewer1.ActiveViewIndex = 0
    4.         CrystalReportViewer1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
    5.         CrystalReportViewer1.DisplayGroupTree = False
    6.         CrystalReportViewer1.Dock = System.Windows.Forms.DockStyle.Fill
    7.         CrystalReportViewer1.Location = New System.Drawing.Point(0, 0)
    8.         CrystalReportViewer1.Name = "CrystalReportViewer1"
    9. Dim querystring As String = "select * from tablename"
    10.         Dim connection As New OleDbConnection(funcs.con)
    11.         connection.Open()
    12. Dim Adapter As OleDbDataAdapter = New OleDbDataAdapter(querystring, connection)
    13.         Dim ds As DataSet = New DataSet()
    14.         Adapter.Fill(ds)
    15.         Dim dt As DataTable = New DataTable
    16.         dt = ds.Tables(0)
    17.         rpt.Load(Application.StartupPath & "/reportname.rpt")
    18.         rpt.SetDataSource(dt)
    19.         CrystalReportViewer1.ReportSource = rpt

  5. #5
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Crystal report help

    I have edited your post and removed your email address.

    You should never post your email address in an open post on an open forum. Mail spam bots can pick that up and before you know it, your mailbox is full of junk mail. If you wish to share your email address with other forum members, please do so via our PM system.

    In addition, we prefer all answers to questions be publically posted rather than sent via EMail or PM. That way, everyone with a similar problem can benefit.

    Thanks.

  6. #6
    New Member
    Join Date
    Apr 2006
    Posts
    13

    Re: Crystal report help

    Here is some code that might help. You have to have the CrystalReportViewer on your form. This goes in the code of the class. When you drag the subreport onto the report you'll have to fill in the object name within the format tab of the subreport. I recommend you do your report and subreport work within the VS environment.

    Dim subreportname1 As String
    Dim subreportobject1 As SubreportObject
    Dim subreport1 As New ReportDocument
    DataSetRptDocketBase1.Clear()
    SqlRptDocketBase.Fill(DataSetRptDocketBase1)
    DataSetRptSubDocketDetail1.Clear()
    SqlRptSubDocketDetail.Fill(DataSetRptSubDocketDetail1)

    Dim myreport As RptDocketsShort = New RptDocketsShort
    subreportobject1 = myreport.ReportDefinition.ReportObjects.Item("ObjRptSubDocketDetail")
    ‘ This object name is for the subreport on the main report, format object option
    subreportname1 = subreportobject1.SubreportName
    subreport1 = myreport.OpenSubreport(subreportname1)
    subreport1.SetDataSource(DataSetRptSubDocketDetail1)
    myreport.SetDataSource(DataSetRptDocketBase1)
    CrystalReportViewer1.ReportSource = myreport

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