Connecting Tech Pros Worldwide Forums | Help | Site Map

Dynamic Report Generator

Member
 
Join Date: Jul 2008
Posts: 77
#1: Aug 25 '08
Hi all,
I have to create a dynamic report in vb.net.
I never had done something like this before.Users want to see tables name and when they choose the table they will select which fields should appear in report.

How should I do tha?

insertAlias's Avatar
Forum Leader
 
Join Date: Apr 2008
Location: San Antonio, TX (USA)
Posts: 2,608
#2: Aug 26 '08

re: Dynamic Report Generator


What DB are you using? There should be stored procedures to list table names and field names that you can bind to dropdowns or checklists or whatever. Then it is just a matter of building the query string based on the user's input. If you used a checkboxlist, you could loop through all the items, and if it is checked, add that field to your query string.

The hard part might be the conditional statements. Study the format that Access uses for it's query designer. That might help.

Also, you should look into premade programs for this. For example, if you are using MSSQL 2005, you should look into SSRS.

Good luck.
Member
 
Join Date: Jul 2008
Posts: 77
#3: Aug 26 '08

re: Dynamic Report Generator


Quote:

Originally Posted by insertAlias

What DB are you using? There should be stored procedures to list table names and field names that you can bind to dropdowns or checklists or whatever. Then it is just a matter of building the query string based on the user's input. If you used a checkboxlist, you could loop through all the items, and if it is checked, add that field to your query string.

The hard part might be the conditional statements. Study the format that Access uses for it's query designer. That might help.

Also, you should look into premade programs for this. For example, if you are using MSSQL 2005, you should look into SSRS.

Good luck.

Hi,
Thanks for reply, I as far as I know in vb.net I have to create Dataset and connect that dataset to my crystal report. If I want to give the user the ability to select the fields in run time how can I create dataset before(In design time)?

The other concern is how to design the crystal report? For example there may be a time user only select 3 fields to have report how can I put this 3 field in my report? What happens if user chooses to have 10 fields? I don't know how can I move columns in crystal report in order to have a good looking report?
I am using SQL2005 as database.
Please Help me to learn.
insertAlias's Avatar
Forum Leader
 
Join Date: Apr 2008
Location: San Antonio, TX (USA)
Posts: 2,608
#4: Aug 26 '08

re: Dynamic Report Generator


You should have mentioned that you were using Crystal Reports in the first place.

I've noticed that you post a lot, but rarely provide enough information in your first post. Please remember that we need to know this information for every post:

Platform: Forms, ASP.NET, console, etc
Language: VB.NET, C#
Database Platform (if applicable): MSSQL Server, MySql, Access, Oracle, etc
Other Important Software: Crystal Reports, 3rd party DLLs, AJAX extensions, AJAX toolkit, etc.

Please remember to provide these in every thread you start.

MODERATOR
Member
 
Join Date: Jul 2008
Posts: 77
#5: Aug 26 '08

re: Dynamic Report Generator


Quote:

Originally Posted by insertAlias

You should have mentioned that you were using Crystal Reports in the first place.

I've noticed that you post a lot, but rarely provide enough information in your first post. Please remember that we need to know this information for every post:

Platform: Forms, ASP.NET, console, etc
Language: VB.NET, C#
Database Platform (if applicable): MSSQL Server, MySql, Access, Oracle, etc
Other Important Software: Crystal Reports, 3rd party DLLs, AJAX extensions, AJAX toolkit, etc.

Please remember to provide these in every thread you start.

MODERATOR

I will do that but I should make it clear that I am using crystal report viewer in vb.net.
Reply