How to create the cyrstal report for given input text file in VB.NET(Urgent)

Hi,
I want to create the crystal report for a text file....
But don't want to use the ODBC....
If i use the Access/Excel(DAO) then it asks for the server name,Login ID,database etc which is not applicable for the text file which i want to get converted into the crystal report...
I am not getting how to create the crystal report for a given text file....
Also how to disable the print & export options of the crystal report????

Waiting eagerly for positive response...


Regards,
Trupti



TPinkAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

planoczCommented:
You have to use a ADO connection...

Imports CrystalDecisions.CrystalReports.Engine
Imports CrystalDecisions.ReportSource
Imports CrystalDecisions.Shared
Imports ADODB                                 '<---- Access
Imports System.Data.SqlClient            '<---- SQL

    Public myReport As New ReportDocument        'Gobal Report Doc
    Public sAppPath = Application.StartupPath        'Application Directory Main Path
    Public sReportPath = "\Reports\"                     'Reports Directory Path


   '**** Server Connection Vars *********
    Public sDBServer As String = "MYSERVER"
    Public sUSERid As String = "MYUSER"
    Public sDBName As String = "MYDATABASE"
    Public sDBPass As String = ""
    Public Con As OleDb.OleDbConnection      '<--- for Access
    Public Connect As SqlConnection             '<--- for msSQL
    Public sSQL As String


    Private Sub GetReportConnection(ByVal myReport)
        ' Objects used to set the proper database connection information
        Dim tbCurrent As CrystalDecisions.CrystalReports.Engine.Table
        Dim tliCurrent As CrystalDecisions.Shared.TableLogOnInfo

        Try
            ' Load the report
            myReport.Load(sAppPath & sReportPath & sReportName, CrystalDecisions.[Shared].OpenReportMethod.OpenReportByTempCopy)
            ' Set the connection information for all the tables used in the report
            For Each tbCurrent In myReport.Database.Tables
                tliCurrent = tbCurrent.LogOnInfo
                With tliCurrent.ConnectionInfo
                    .ServerName = sDBServer
                    .UserID = sUSERid
                    .Password = ""
                    .DatabaseName = sDBName
                End With
                tbCurrent.ApplyLogOnInfo(tliCurrent)
            Next tbCurrent
        Catch Exp As LoadSaveReportException
            MsgBox("Incorrect path for loading report.", _
                    MsgBoxStyle.Critical, "Load Report Error")
        Catch Exp As Exception
            MsgBox(Exp.Message & "   in GetReportConnection Procedure", MsgBoxStyle.Critical, "General Error")
        End Try
    End Sub

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
mlmccCommented:
To completely disable printing and exporting
Printing
Open the report
Click FILE --> REPORT OPTIONS
Click the NO PRINTER option.  Report cannot be printed until this is turned off

Export
Don't load any of the Export dlls on the client machine

How do you plan to display the report?  Is it from a viewer or the Crystal designer?
What version of Crystal?  Which edition?

mlmcc
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic.NET

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.