**********************************please see the image first link given below*********************************

I have made a crystal report to assign a database to it i created a module with following code and added this module to my form

Imports System.Data.SqlClient
Imports System.Data.Sql

Module Module1
    Public acscmd As New SqlCommand
    Public acsconn As New SqlConnection
    Public acsda As New SqlDataAdapter
    Public acsds As New DataSet
    Public strsql As String
    Public Strreportname As String
    Sub Connect()
        acsconn.ConnectionString = "Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\Items.mdf;Integrated Security=True;Connect Timeout=30;User Instance=True;"
        If acsconn.State = ConnectionState.Open Then
        End If
    End Sub

End Module

and in form 2 i dropped a crystal report viewer and crystal report document for that i write this code and a print button

Imports CrystalDecisions.CrystalReports.Engine

Public Class Form2

    Private Sub Form2_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        strsql = "select * from Items"
        acscmd.CommandText = strsql
        acscmd.Connection = acsconn
        acsda.SelectCommand = acscmd
        Strreportname = "CrystalReport1"
        Dim Strreportpath As String = Application.StartupPath & "\" & Strreportname & ".rpt"
        If Not IO.File.Exists(Strreportpath) Then
            Throw (New Exception("Unable to load report charu"))

        End If

        Dim rptdocument As New CrystalDecisions.CrystalReports.Engine.ReportDocument
        CrystalReportViewer1.ShowRefreshButton = False
        CrystalReportViewer1.ShowCloseButton = False
        CrystalReportViewer1.ShowGroupTreeButton = False
        CrystalReportViewer1.ReportSource = rptdocument

    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim cryRpt As New ReportDocument
        CrystalReportViewer1.ReportSource = cryRpt
    End Sub
End Class

when compiling no error see this image i dont know how to fill up these details please help me how to fill up these connection details.image details

see image :http://www.mediafire.com/view/?oz0nmmqkm2nw232
please give which details to be filled and how can i determine them

please please help me

4 Years
Discussion Span
Last Post by john.knapp

I believe you need to provide a the connection and logon properties separately for Crystal Reports. I haven't had a chance to look into it yet, but have seen that mentioned in other discussions. You might try the Crystal Reports SDK here, and look through their discussion groups to see if there's a quick answer applicable to your situation. Their community landing page for Visual Studio is here.

Edited by john.knapp: addtional info

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.