how to connect crystal report with vb.net ?

Answer Posted / kafeel ahmad

Take crystal report from toolbox .Take New form (I named it
frmRpt)Then take crystal report Viewer from tool box and
place it on new form(frmRpt) I named crystal report Viewer
as crptVW
double click on newform(frmRpt) and place this code---

Public Class frmRpt
Public strRptName As Object
Public strRptFilter As String
Private Sub frmRpt_Load(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles MyBase.Load
If strRptFilter <> "" Then
crptVW.SelectionFormula = strRptFilter
End If
crptVW.ReportSource = strRptName
crptVW.Show()
End Sub
End Class


now if u want to call it on button_click then paste this
code on that button_click event ------

Dim objRpt As New frmRpt
objRpt.strRptName = New crList
' objRpt.strRptFilter = "{ConsultantMaster.ConId}="
& cboConIDX.SelectedValue 'if want to filter
objRpt.Show()

'now u can open as many crystal report just paste code
above on button_click()

Is This Answer Correct ?    8 Yes 8 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is enumerator?

565


what is commom language runtime?

553


Explain some of the exclusive features which are present in vb?

515


What’s the difference between private and shared assembly?

689


What is the significance of delegates. Where should they be used?

513






What is the advantage of using system.text.stringbuilder over system.string?

606


How can we store decimal data in .net?

540


Explain the difference between thread and process?

508


Can you please explain the difference between authentication and authorization?

536


What do you mean by serialization and deserialization and it's use.

603


Why do we use byref keyword in vb.net?

599


How do you define a read only property in a class module?

527


thak you Mr Govind for replying to my question. My next question is that how to retrieve image stored in an SQL server table and assign it to any image control or picture control using VB.net

1703


What are the different types of a stream?

561


Is vb net a scripting language?

543