Go Back  Xtreme Visual Basic Talk > Legacy Visual Basic (VB 4/5/6) > General > VB and Crystal Report problem


Reply
 
Thread Tools Display Modes
  #1  
Old 12-17-2002, 07:40 AM
Ziko Ziko is offline
Centurion
 
Join Date: May 2002
Location: Canada
Posts: 105
Default VB and Crystal Report problem


Hi,
I have designed my reports in the designers in VB Application.
I set up the fields of the reports at design time to get there values from a specific database.
The problem is that I can't set the database location 'Same as
Report' because the designers are included with the VB app.
Is there a way to set the database location of a Crystal report designer at run time?
Or any other way to change the path relatively at run time?

I really appriciate any help
Thanks
Reply With Quote
  #2  
Old 12-17-2002, 08:03 AM
anhmytran anhmytran is offline
Senior Contributor

Retired Moderator
* Guru *
 
Join Date: Aug 1999
Location: Hartford, Connecticut, 06
Posts: 1,487
Default

My Crystal Reports designer is separated and independent
from VB.
However, the path of the source database is witin the reports.
The Database and the Reports can be shared throughout the
LAN.
That is the reason by now I have no idea of how to change
the path of the database in run time.
Reply With Quote
  #3  
Old 12-17-2002, 08:21 AM
Ziko Ziko is offline
Centurion
 
Join Date: May 2002
Location: Canada
Posts: 105
Default

I had my reports separated and I had no problem with the path.
The reports and the database were shared throughout the LAN. But I had to move my reports and include them into VB so I can
change the logo dynamically to the choice of the user and include
other VB code and format the sections at run time. But then I get this database location poblem and the option 'Same as Report' is disabled when the reports are designed in VB.
I know the database path at run time but the problem is how to assign it to the report?
Reply With Quote
  #4  
Old 12-24-2002, 09:48 AM
holtzy holtzy is offline
Senior Contributor
 
Join Date: Jul 2002
Location: USA
Posts: 1,041
Default

I'm trying to figure out something similar right now. Try
Code:
Dim Report As New CrystalReport1 Report.Database.SetDataSource YourRecordset
or is this even what you are asking?
__________________
God is good!!!
Reply With Quote
  #5  
Old 12-24-2002, 10:28 AM
Optikal's Avatar
Optikal Optikal is offline
Codeaholic

Retired Leader
* Guru *
 
Join Date: Oct 2002
Location: Winnipeg, MB, Canada
Posts: 4,543
Default

I do it the way holtzy said, you just have to add a database to the designer, and go to More Data Sources -> Active Data -> Active Data (Field Definitions Only). Then either point to an existing ttx file, or create a new one that describes the format of the recordset you will be passing to it at runtime.
__________________
There are 10 types of people in this world, those that understand binary, and those that don't.
Reply With Quote
  #6  
Old 12-24-2002, 11:49 AM
anhmytran anhmytran is offline
Senior Contributor

Retired Moderator
* Guru *
 
Join Date: Aug 1999
Location: Hartford, Connecticut, 06
Posts: 1,487
Default

Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
 
 
-->