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 ?    2 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can you please explain the difference between value and reference types?

686


Explain trace in vb.net?

707


What are the objects in asp.net?

758


What is the maximum size of the textbox?

695


What is stack used for in vb. Net?

694






How to store images in sql server database through vb.net?

681


Explain the difference between c# and vb.net?

723


What are the features of c# which are not present in vb.net?

812


What is intermediate langauge?

703


Explain option strict?

716


What is pre-jit?

700


Name a feature which is common to all .net languages?

758


source code for how to login a vb.net application ?

722


Explain the components of common language runtime.

738


Which properties are used to bind a DataGridView control?

772