crystal reportviewr problem
-
s = "drop view q1" cmd.CommandText = s dr = cmd.ExecuteReader() dr.Close() s = "create view q1 as select sum(fatrq1)reglz from reglz where fatrdate between '" + str + "'and'" + str2 + "'" cmd.CommandText = s dr = cmd.ExecuteReader dr.Close() Form7.Show()
in form 7 i put this codeCrystalReportViewer1.ReportSource = ("CrystalReport1.rpt")
and i saved my report in debug and when i when i click the bottom to show the report he tell me error loading the report is there any one to help me -
s = "drop view q1" cmd.CommandText = s dr = cmd.ExecuteReader() dr.Close() s = "create view q1 as select sum(fatrq1)reglz from reglz where fatrdate between '" + str + "'and'" + str2 + "'" cmd.CommandText = s dr = cmd.ExecuteReader dr.Close() Form7.Show()
in form 7 i put this codeCrystalReportViewer1.ReportSource = ("CrystalReport1.rpt")
and i saved my report in debug and when i when i click the bottom to show the report he tell me error loading the report is there any one to help mehi, specify the error in detail. anyway use this procedure (in place of Form7.show) to show report call crystalForm.showReport() where crystalForm contains crystalReportviewer and showReport procedure.
Private sub ShowReport() Try Dim obj As CrystalReport1 = New CrystalReport1 Dim ds As New DataSet Dim da As OleDbDataAdapter Dim str As String str = "select * from TableName" 'Query da = New OleDbDataAdapter(str, conn) ' where conn is connection object da.Fill(ds) obj.SetDataSource(ds.Tables(0)) me.CrystalReportViewer1.ReportSource = obj Me.Show() Catch ex As Exception MsgBox(ex.Message, MsgBoxStyle.Information, "Report") End Try End sub
one more thing ,CrystalReport1.rpt must be include in your project (not in debug folder) hope this helpsRupesh Kumar Swami Software Engineer, Integrated Solution, Bikaner (India)