NOn Embedded Crystal Report in vs2008
in VS2008 i need to show the report in CR (8.5 or any other version) designed outside the visual studio.
But i dont want to embed the CR in my application so that i can edit reports easily without building the app once again.
and also it should work without installing CR in the client machine.
i am using it fine in vb6 & cr8.5 using the following code
Code:
Crp.Reset
Crp.DataFiles(0) = App.Path + "\" & MyCom.ID & "\Inventory.mdb"
Crp.Password = V_CrystalPass
Crp.SelectionFormula = "{Rpt.Date} >=#" & v_dt1 & "# and {Rpt.Date} <=#" & v_dt2 & "#" & IIf(Trim(V_SqlConditions) <> "", " and " & V_SqlConditions, " ")
Crp.Formulas(0) = "Company = '" & MyCom.Name & "'"
Crp.Formulas(1) = "Ason= '" & Format(Date, "dd-MM-yyyy") & "'"
Crp.Formulas(2) = "Title = '" & V_Title & " Credit Note'"
Crp.Formulas(3) = "fromto = 'From " & Format(Dtp1.Value, "dd-MM-yyyy") & " To " & Format(Dtp2.Value, "dd-MM-yyyy") & " '"
Crp.ReportFileName = App.Path + "\" + Filename
Crp.WindowState = crptMaximized
Crp.Action = 1
Re: NOn Embedded Crystal Report in vs2008
You can 'show' non embedded CR reports in VS2008, but they must be version 9, 10, 11, 12 and next ones
And they will work without installing CR in the client machine
You cann't use that VB6 code that only works for VB6 & CR reports versions 8.5, 8, 7, 4.6
Re: NOn Embedded Crystal Report in vs2008
I know it will work in vb6 not in .net i need the code for .net any help
Re: NOn Embedded Crystal Report in vs2008
Code to load an external rpt file in a vb.net app :
Need to reference CrystalDecisions.CrystalReports.Engine
Need to add CrystalReportViewer control (in this case is in the frmViewer)
Code:
'Module
Public CRReport As CrystalDecisions.CrystalReports.Engine.ReportDocument
'Any form
'Command button Click event
CRReport = New CrystalDecisions.CrystalReports.Engine.ReportDocument
CRReport.Load("NameOfReport.rpt", CrystalDecisions.Shared.OpenReportMethod.OpenReportByTempCopy)
frmViewer.ShowDialog(Me)
'frmViewer
'Load event
CrystalReportViewer1.ReportSource = CRReport
Re: NOn Embedded Crystal Report in vs2008
But jggtz if i do so i have a problem
it works good. but after building the project if i change some thing in the report i.e here "nameofreport.rpt" then it does not reflect in the frmviewer shown
Re: NOn Embedded Crystal Report in vs2008
Post your code...
and be sure where are you editing and saving the rpt file
must be the same path from where you load it...
Re: NOn Embedded Crystal Report in vs2008
it worked for me i corrected mistakes in my code
Dim CRReport As CrystalDecisions.CrystalReports.Engine.ReportDocument
CRReport = New CrystalDecisions.CrystalReports.Engine.ReportDocument
CRReport.Load("e:\gplus\report1.rpt", [Shared].OpenReportMethod.OpenReportByTempCopy)
CRReport.SetDatabaseLogon("rsk", "rsk")
CRReport.VerifyDatabase()
CRReport.Refresh()
CRReport.FileName = "e:\gplus\report1.rpt"
form1.CrystalReportViewer1.ReportSource = CRReport
Form1.ShowDialog(Me)
it updates the correction in the report file. ok
but whether it will work without CR installed on the user machine.
Re: NOn Embedded Crystal Report in vs2008
It will work if you INSTALL the project properly