2005 Exp - Crystal Report Source
Hi Guys,
I have created a CR Report that I use in an app (frontend to an Access DB).
As is well except the data that I used to create the CR Report is showing up in the VB.Net app although I have:
1. saved the Report without data (option within CR)
2. in my app, I specify the data source (see below)
Code:
Report.Load(Application.StartupPath & "\Dependancies\Blank.rpt")
Report.SetDataSource(Me.LogbookDataSet.tbl_Logbook)
CrystalReportViewer.ReportSource = Report
Me.PanelReport.Controls.Add(CrystalReportViewer)
?? :)
Re: 2005 Exp - Crystal Report Source
Re: 2005 Exp - Crystal Report Source
does it throw any exceptions? do you have any subreports in the report? if you do the datasource needs to be set in the subreports as well.
Re: 2005 Exp - Crystal Report Source
HI vbdotnetboy,
No exceptions - works as stated, but with the development data showing.
The following seems related; in that the development DB cannot be changed (although I have implicity set the Data Source...):
http://forums.microsoft.com/MSDN/Sho...72482&SiteID=1
Re: 2005 Exp - Crystal Report Source
does your access DB require login credentials?
Re: 2005 Exp - Crystal Report Source
Yup - that's why Crystal Reports has so much developer community love :-)
Maybe try:
Code:
Me.CrystalReportViewer1.LogOnInfo.Clear()
If Me.CrystalReportViewer1.LogOnInfo.Count = 0 Then
Me.CrystalReportViewer1.LogOnInfo.Add(New CrystalDecisions.Shared.TableLogOnInfo())
End If
Me.CrystalReportViewer1.LogOnInfo.Item(0).ConnectionInfo.ServerName = _ServerName
Me.CrystalReportViewer1.LogOnInfo.Item(0).ConnectionInfo.DatabaseName = _DatabaseName
Me.CrystalReportViewer1.LogOnInfo.Item(0).ConnectionInfo.UserID = _UserId
Me.CrystalReportViewer1.LogOnInfo.Item(0).ConnectionInfo.Password = _Password
?
Re: 2005 Exp - Crystal Report Source
Quote:
Originally Posted by vbdotnetboy
does your access DB require login credentials?
No, but suspect that may be an issue - why who the h*** knows - seems to be a problem tho. :)
Hi Merrion,
I was onto that (from the link I posted) but couldn't get the syntax right for the ServerName (have had a few cold ones....) will give it a shot ;)
Re: 2005 Exp - Crystal Report Source
Bugger, it didn't work... looked promising tho.
I do (and always did get) a dialog to select the DB path - as it's trying to use the development DB.
:rolleyes:
;)
Re: 2005 Exp - Crystal Report Source
It may be that the report template wasn't saved with the data source logged off?
Try logging off and then moving a label around to make CR think the report has changed then save it.
Re: 2005 Exp - Crystal Report Source
I will try that - thanks.
(My dev .mdb was connected using OLE DB (ADO))
Re: 2005 Exp - Crystal Report Source
I have now tried a few other 'Logon' methods to no avail (following Merrions approach).
Does any one else have a successful snippet used to 'Logon' / (re) connect to an mdb; similar to post #7?
:)
Re: 2005 Exp - Crystal Report Source
Hi Bruce,
Try calling the CR Viewer's Refresh Method and see whether that makes any difference:
Code:
Report.Load(Application.StartupPath & "\Dependancies\Blank.rpt")
Report.SetDataSource(Me.LogbookDataSet.tbl_Logbook)
CrystalReportViewer.ReportSource = Report
Me.PanelReport.Controls.Add(CrystalReportViewer)
CrystalReportViewer.Refresh