Error loading crystal report in vb.net -
imports system.data.sqlclient imports system.configuration imports system.linq imports crystaldecisions.crystalreports.engine imports crystaldecisions.shared public class form1 private sub button1_click(sender object, e eventargs) handles button1.click dim cryrpt new reportdocument dim crtablelogoninfos new tablelogoninfos dim crtablelogoninfo new tablelogoninfo dim crconnectioninfo new connectioninfo dim crtables tables dim crtable table cryrpt.load("c:\users\dad\desktop\report\myfile2.rpt") crconnectioninfo .servername = "127.0.0.1" .databasename = "xxx" .userid = "sa" .password = "123456" end crtables = cryrpt.database.tables each crtable in crtables crtablelogoninfo = crtable.logoninfo crtablelogoninfo.connectioninfo = crconnectioninfo crtable.applylogoninfo(crtablelogoninfo) next crystalreportviewer1.reportsource = cryrpt crystalreportviewer1.refresh() end sub end class i getting below error while trying load crystal report in visual studio 2013.
an unhandled exception of type 'crystaldecisions.shared.crystalreportsexception' occurred in crystaldecisions.crystalreports.engine.dll
additional information: load report failed.
on line cryrpt.load("c:\users\dad\desktop\report\myfile2.rpt")
the path correct.
you can try variant
report.load(reporttemplatefullname, _ crystaldecisions.shared.openreportmethod.openreportbytempcopy)
Comments
Post a Comment