|
-
Oct 9th, 2012, 08:18 AM
#1
Thread Starter
Lively Member
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
-
Oct 9th, 2012, 10:41 AM
#2
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
Last edited by jggtz; Oct 9th, 2012 at 10:46 AM.
JG
... If your problem is fixed don't forget to mark your threads as resolved using the Thread Tools menu ...
-
Oct 9th, 2012, 02:16 PM
#3
Thread Starter
Lively Member
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
-
Oct 9th, 2012, 04:24 PM
#4
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
JG
... If your problem is fixed don't forget to mark your threads as resolved using the Thread Tools menu ...
-
Oct 10th, 2012, 12:55 PM
#5
Thread Starter
Lively Member
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
-
Oct 10th, 2012, 01:12 PM
#6
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...
JG
... If your problem is fixed don't forget to mark your threads as resolved using the Thread Tools menu ...
-
Oct 11th, 2012, 02:34 AM
#7
Thread Starter
Lively Member
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.
Last edited by vpm_sampath; Oct 11th, 2012 at 02:55 AM.
-
Oct 11th, 2012, 03:00 AM
#8
Re: NOn Embedded Crystal Report in vs2008
It will work if you INSTALL the project properly
JG
... If your problem is fixed don't forget to mark your threads as resolved using the Thread Tools menu ...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|