Is the error a connection error ? What is the message ? (Again, I
assume
this was all working on the old database ?)
You can also 'Force' connection parameters on the report in Code as
follows:
rpt.SetDatabaseLogin(UID, PWD, SERVER, DATABASE)
Also check that rpt.HasSavedData = False
:
This is a portion of the coding:
Dim rpt As New CrystalDecisions.CrystalReports.Engine.ReportDocument
Dim apps As New vbScheduling.dsApps
Try
Select Case sentBy
Case "coll"
daPrintAppByColl.SelectCommand.Parameters("@ClubColl").Value =
clubcoll
daPrintAppByColl.Fill(apps)
Case "id"
daID.SelectCommand.Parameters("@EventID").Value = eid
daID.Fill(apps)
Case "wk"
Dim i As Integer
'Add parameter
For i = startWknd To endWknd
daWeekends.SelectCommand.Parameters("@WeekendNum").Value = i
daWeekends.SelectCommand.Parameters("@EventYear").Value = thisYear
daWeekends.Fill(apps)
Next
End Select
rpt.Load("..\Files and Reports\EventApp.rpt",
CrystalDecisions.[Shared].OpenReportMethod.OpenReportByTempCopy)
rpt.SetDataSource(apps)
crvApp.ReportSource = rpt
It errors out on the last line crvApp.ReportSource=rpt
Brad
message
Can you post me some code illustrating how you are using this ?
Thanks
:
The dataset is what I use to fill in the data. The code selects
the
records
through the data adapter, fills the dataset and it is that data
that I
want
used for the report.
This is the only dataset used for the report. There aren't any
subreports.
message
There shouldn't be any changes if you are moving from one
database
to
another
(with the same code/Reports).
By Dataset are you referring to some .NET code or do you mean the
actual
Crystal Report itself ? BTW have you got subreports (or multiple
connections) in your Crystal Report ?
:
Maybe it is not working quite right yet. It is actually now
pulling in
EVERY record in the database, not the selections made by the
query.
Upon
looking at the datasets under set location, they only display
the
XML
File
path and the database type. There is no login information. Is
there a
way
to add this to the dataset?
Dotnetnewbie! Thank you very much! When I sent in to set a
location
there was nothing there so I used your suggestion in using the
OLEDB
Provider for SQL and it works just fine! Thank you again. I
have only
been working on this problem since yesterday afternoon.
Brad
in
message
Rightclick on "Database Fields" and click on "Set
Location..."
This will open up a properties window showing you the Login
Credentials
including
Database type
Provider
Data Source
Inital Catalog
User ID
Integrated Security
etc...
Look carefully at the DataSource, UserID and Integrated
Security
values.
If they are wrong, then you can change them by selecting the
source
from
the
right-hand side view. I use OLEDB Provider for SQL Server.
After selecting this (assuming you have to) you can then
specify
all
the
relevant connection parameters.
:
Verify database tells me that the database is up to date.
How
do I
check
the login credentials? That may be the problem.
As far as the actual dataset itself, that is working.
"dotnetnewbie" <
[email protected]>
wrote
in
message
Have you confirmed the location of your Data Source ?
i.e. When you open the Crystal Report in the Design Mode
(in
..Net),
under
Field Explorer, you should see "Database Fields". Right
click and
see if
the DataSource is looking in the correct location. Is it
using the
correct
login credentials ?
(Check the Alias too).
Also, have you tried the option "Verify Database " ? If
so
what
does
it
tell you ?
:
I get the message both ways - by debugging and also
running
the
exe.
The Crystal Reports is the one that came with Visual
Studio
Professional.
Brad
"dotnetnewbie" <
[email protected]>
wrote in
message
Do you get the dialog box for username and password
durning
DEBUG
mode
(i.e
when stepping through the .NET code ) or just when you
run
the
.exe
file
with
a user ?
Also, is the Crystal Reports you are using the one that
comes
with
.NET
itself or is it the external Packaged Crystal Reports ?
:
We recently moved several Access databases to an
instance
of
MSDE.
We
use
VB .Net for program development. Upon running one of
the
programs
a
dialog
box now pops up alerting us to enter a user name and
password.
I
searched
the Business Solutions help and found that the
database
server
needs
to
be
set up with a trusted connection. I thought I already
did this
through
the
data connection of the VS IDE.
Is there something more than I have to do on the MSDE
side?
Thanks for any useful information.
Brad