Search

Google
 

Crystal report viewer

Can you imagine that you can write a crystal report viewer in just 4 lines.

Into a vb.net project. Add a form and into the form add a crystal report viewer object and a button and a open file dialog.

into button click event add folowing code.
OpenFileDialog.ShowReadOnly = True
OpenFileDialog.Multiselect = False
OpenFileDialog.Filter = "Report files (*.rpt)|*.rpt|All files (*.*)|*.*"
OpenFileDialog.ShowDialog()

into OpenFileDialog_FileOk event add folowing code.
CrystalReportViewer.ReportSource = OpenFileDialog.FileName

thats all. now you can view any crysatl report saved in .rpt format.