Link to home
Start Free TrialLog in
Avatar of prasadtvsv
prasadtvsv

asked on

Report Generation Problem

Dear Friends

I had created a form with a textbox and a command button. The inputs in the textbox will be the table names in my database. When i click the command button  a report should be generated with all the data present in that table. I am not getting how to do it.
How the table name will be passed to the data report and how the report will be created at run time.
Please help he with your code or suggest me where i can find the help regarding this.

Thanks in advance.


Bye
Prasad

Avatar of Anthony Perkins
Anthony Perkins
Flag of United States of America image

The only way you are going to get this to work is to create a report definition for all the possible tables.  That is, assuming that they have different structures.

Once you have done that, you can then bind the recordset of the table to the DataReport and show the report.  Here is an article from MSDN that covers the bases:
http://support.microsoft.com/directory/article.asp?ID=KB;EN-US;Q190411

Anthony
ASKER CERTIFIED SOLUTION
Avatar of sridhar_PJ
sridhar_PJ

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Hello prasadtvsv !

It depends on report tool you want to use:

1. Crystal
2. Access
3. List & Label ..

If you have to implement it in one report you will get problems if the definition of the tables are too different. In dependency of the table you have to decide :

1. Where to place the fields
2. How to group the records
3. How to generate totals\subtotals
...

But if you have a seperate report for the (too different) tables you only have to call the wanted record instead of passing the string of the table-name to it.


V.K.

yes it depends on app for report I had something similar (AdHoc) report creation in Access.
There I had 5 combos for table names and based on tables selecte it picked up the PK and then joined them.
Then lets you select the criteria for each column and finally creates and runs a report. There are so many bugs though and it is very difficult to achieve the way I wanted. Involves lotsa OOP.
Avatar of prasadtvsv
prasadtvsv

ASKER

Thanks Sreedhar your link had soved my problem .
The rest had also given me some knowledge of dynamism in reports. Thanks a lot for all of you mr dear friends.

Thanks
Bye
prasad