CR questions, and TY to Bill

P

Patrick

Now I got my report form to load without a licensing error, thanks to Bill
(William Vaughn).

But I keep getting the error "can't load data" when I start the form.

In my delvelopment system it mostly all worked from day one, but moving it
to another machine involved installing MDAC, MSDE, the .NET Framework, and
learning how to load a database on another sqlserver instance. And I thought
installing Visual Foxpro apps was a hassle.

In the Crystal reports visual designer for the VS.NET IDE, you can only set
the datasource property for a database that's been attached (binded?) to a
specific data provider. In fact, I could not even get the tables to load in
my main form with MSDE on the target system until I 'attached' the database
to MSDE on that machine. Is that normal?

Now evidently, the crystal reports control is looking for the database in
the wrong place, too. I've been reading the stuff on CR in the VS.NET
documentation, and it's really fragmented and the clearest code I found for
telling the control how to find the data was written in C#! I figured this
out because the statements all end with ";". It sure wasn't labled as C#
code. What is the equivalent VB code for the C# keyword, "using"?

It seems like I should be able to set the values with
Crystalreports1.SetDatabaseLogon("user","pwd", "server", "datasource") in
the form load event. But I get an error that says "setdatabaselogon" is not
a member of crystalreports1.

Can anyone point me in the right direction for some programmatic control of
CR controls in VB? I found some CR newgroups but it seems like there's not
much traffic in those.
 
G

Guest

Try looping throught each table in the crystalReport.Database.Tables
collection and set LogOnInfo.ConnectionInfo.DatabaseName,
LogOnInfo.ConnectionInfo.ServerName and LogOnInfo.ConnectionInfo.Password for
each table.

Personally, I prefer to use a dataset as the datasource for a report.

Regards,
Phil.
 
P

Patrick

Thanks, Phil, I finally found some code on how to do that from an SDK I
found at Crystal reports website. What I was having trouble with was getting
the connection string to even SEE the server, so the question of finding
tables was almost moot at that point.

I used datasets in my main form, but since I had hand coded them, crystyal
reports could not see them. I did not want to go back and do it all over
with GUI controls.
 
W

William \(Bill\) Vaughn

Ah, I would advise to use Reporting Services... not the Dark Crystal.

--
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
Microsoft MVP
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________
 
P

Patrick

Maybe so, but I have never used Reporting Services, and it wan't even
mentioned in my school courses. I only recently noticed the component in
toobox.
 

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

Top