Hi puneri... use below code.once you get the report displayed,then you can use the tool bar of the Report viewer to export to any other format.
Dim crtableLogoninfos As New TableLogOnInfos
Dim crtableLogoninfo As New TableLogOnInfo
Dim crConnectionInfo As New ConnectionInfo
'' Dim crdatabase As Database
Dim CrTables As Tables
Dim CrTable As Table
Dim crReportDocument As New ReportDocument
crReportDocument.Load("Put report path here")
crConnectionInfo.ServerName = "Server Name here"
crConnectionInfo.DatabaseName = "Database Name Here"
crConnectionInfo.UserID = "user id"
crConnectionInfo.Password = "password"
CrTables = crReportDocument.Database.Tables
'Set the connection info to each table present in the report
For Each CrTable In CrTables
crtableLogoninfo = CrTable.LogOnInfo
crtableLogoninfo.ConnectionInfo = crConnectionInfo
CrTable.ApplyLogOnInfo(crtableLogoninfo)
Next
'Sub Report Log on*****************************'
Dim li_Sectionindex As Integer
Dim li_ObjCtr As Integer
Dim li_TableCtr As Integer
Dim l_SubReportObject As CrystalDecisions.CrystalReports.Engine.SubreportObject
Dim l_SubRepDoc As New CrystalDecisions.CrystalReports.Engine.ReportDocument
For li_Sectionindex = 0 To crReportDocument.ReportDefinition.Sections.Count - 1
For li_ObjCtr = 0 To crReportDocument.ReportDefinition.Sections(li_Sectionindex).ReportObjects.Count - 1
With crReportDocument.ReportDefinition.Sections(li_Sectionindex)
If .ReportObjects(li_ObjCtr).Kind = CrystalDecisions.Shared.ReportObjectKind.SubreportObject Then
l_SubReportObject = CType(.ReportObjects(li_ObjCtr), CrystalDecisions.CrystalReports.Engine.SubreportObject)
l_SubRepDoc = l_SubReportObject.OpenSubreport(l_SubReportObject.SubreportName)
For li_TableCtr = 0 To l_SubRepDoc.Database.Tables.Count - 1
l_SubRepDoc.Database.Tables(li_TableCtr).ApplyLogOnInfo(crtableLogoninfo)
Next
End If
End With
Next
Next
'****************End Sub Report log on********************************'
crviewer.ReportSource = crReportDocument