We help IT Professionals succeed at work.

Report Generation Problem

prasadtvsv
prasadtvsv asked
on
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

Comment
Watch Question

CERTIFIED EXPERT
Top Expert 2012

Commented:
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
Hi Prasad,
Can you try this link


http://www.planet-source-code.com/xq/ASP/txtCodeId.2463/lngWId.1/qx/vb/scripts/ShowCode.htm

Hope this help you
Regards
Sridhar
VK

Commented:
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.

Commented:
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.

Author

Commented:
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

Explore More ContentExplore courses, solutions, and other research materials related to this topic.