Crystal Report sort of problem

M

MadCrazyNewbie

Hey Group,

Sorry to be a pain yet again. I problem that i don`t know how to get
around:(

I use the following connection class on my project:

Private Shared mConnectionsstring As String =
"Provider=Microsoft.Jet.OLEDB.4.0;Data Source="
Private Shared mLocation As String
Private Shared connArray As ArrayList
Public Shared Sub setString(ByVal ind As Integer)
Dim connArray As New ArrayList()
connArray.Add("J:\Excellence.Net\LiveNetDB.mdb")
connArray.Add("J:\Excellence.Net\DevNetDB.mdb")
connArray.Add("C:\Program Files\Excellence.Net\LiveLocalDB.mdb")
mLocation = connArray(ind).ToString
End Sub
Public Shared ReadOnly Property [String]() As String
Get
Return "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & mLocation & ";"
End Get
End Property

and then I use:
Connection.setString(Me.cboSelectDB.SelectedIndex) on my Login form and
<WhateverDataConnect>.ConnectionString = Connection.String
on the load event of every other form.

And the following to print my Crystal Reports:

rptForm.Text = "Excellence.Net - Fax Meter Reading Report" 'Set the form's
titlebar
rptForm.CRVReportPrint.ReportSource = New FaxMeterReadings() 'Tell the
viewer which report to display
rptForm.CRVReportPrint.RefreshReport() 'Refresh the viewer
rptForm.ShowDialog() 'Show the report

How do I get my report Print to determin which database it using? I.E -
Network or Local? All I can find on my Crystal report is the Set Location,
to which I have to choose a databse.

Many Thanks again for any help

Regards
MCN
 
B

BrianDH

This may be of no help but may I suggest... connect to your DB by way of a
Web Service / Stored Poc.

Then changing DB is a snap.

just a thought

B


MadCrazyNewbie said:
Hey i`ve found this but im so confused, i ain`t got a clue what it means, is
this what I should be looking into?

http://support.businessobjects.com/library/kbase/articles/c2011464.asp

Any help would be much appriciated

Thanks
MCN

MadCrazyNewbie said:
Hey Group,

Sorry to be a pain yet again. I problem that i don`t know how to get
around:(

I use the following connection class on my project:

Private Shared mConnectionsstring As String =
"Provider=Microsoft.Jet.OLEDB.4.0;Data Source="
Private Shared mLocation As String
Private Shared connArray As ArrayList
Public Shared Sub setString(ByVal ind As Integer)
Dim connArray As New ArrayList()
connArray.Add("J:\Excellence.Net\LiveNetDB.mdb")
connArray.Add("J:\Excellence.Net\DevNetDB.mdb")
connArray.Add("C:\Program Files\Excellence.Net\LiveLocalDB.mdb")
mLocation = connArray(ind).ToString
End Sub
Public Shared ReadOnly Property [String]() As String
Get
Return "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & mLocation & ";"
End Get
End Property

and then I use:
Connection.setString(Me.cboSelectDB.SelectedIndex) on my Login form and
<WhateverDataConnect>.ConnectionString = Connection.String
on the load event of every other form.

And the following to print my Crystal Reports:

rptForm.Text = "Excellence.Net - Fax Meter Reading Report" 'Set the form's
titlebar
rptForm.CRVReportPrint.ReportSource = New FaxMeterReadings() 'Tell the
viewer which report to display
rptForm.CRVReportPrint.RefreshReport() 'Refresh the viewer
rptForm.ShowDialog() 'Show the report

How do I get my report Print to determin which database it using? I.E -
Network or Local? All I can find on my Crystal report is the Set Location,
to which I have to choose a databse.

Many Thanks again for any help

Regards
MCN
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top