Solved

Crystal reports and databses

Posted on 1998-11-03
5
179 Views
Last Modified: 2010-04-30
I have a database with several tables and I need to point a crystal report to a specific table in that database at runtime. anyone know how to do this? thanks in advance :)
0
Comment
Question by:jalleman
  • 2
  • 2
5 Comments
 
LVL 1

Accepted Solution

by:
advancefiber earned 50 total points
Comment Utility
You have to point your report to the same table in both design and runtime. Is that what do you want? If yes, it's easy. Just create a new report in Crystal Report with their wizard. Otherwise, it's not easy. You need to create several reports for different tables and use a data control in code to link table and associated report together in runtime. There are special chapters in Crystal Report help file about how to create this kind of data  bund reports.

Good luck.
0
 

Author Comment

by:jalleman
Comment Utility
Well not exactly what i need. I create the database and tables at runtime, I don't know how many tables I have to create at design time, only at runtime. All the tables have the same layout and properties, just different data. So i can't create crystal reports at design time as the tables do not exist at that time. I tried linking the crystal report to a data control at run time and pointing the data control to one of the tables, but couldn't get it to work. thanks for you answer tho.
0
 
LVL 1

Expert Comment

by:advancefiber
Comment Utility
It's can be done if all tables are the same. You need to create one table in design time and link it to a data control. Then create a report according to this table's structure. In run time, point to this data control to the correct table by modifying its recordsource property. I think it will work.

But if you do not know the structure of table at design time, I do not think you can use crystal report. You may need to create your own report by using Printer control at run time.

0
 
LVL 7

Expert Comment

by:Inteqam
Comment Utility
?
0
 

Author Comment

by:jalleman
Comment Utility
What i ended up doing was creating a temp table at design time and creating a crystal report linking to that table. Then at runtime populating that temp table with current data and then running the crystal report via a component. also the table structure never changes so populating the temp table was not a problem.
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now