By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,569 Members | 1,422 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,569 IT Pros & Developers. It's quick & easy.

To create an application which select report and fetches all fields stored in View

P: 29
Hi All,
Iam new in asp.net 2003 and sql server. I have to create an application having following criteria.

Proposed Steps

1. Create a table containing fields as Name of Report, View Name or Query in the database.

2. In the User Interface Label box, Combo box, Command Button, Table and web grid 5.2 controls are used.

3. First in the Combo Box user selects a report and click on the Command button. Inside Command button click event method, a query is fired taking report name as parameter which fetches all the fields of the corresponding View stored in the Custom_Rep_Table.

4. After fetching all the fields from the View, these fields are displayed in the table created dynamically. Corresponding to the fields there are specific Checkboxes and textboxes.

5. User specifies the values for the fields in the textboxes and checked out the checkbox(s) and clicks on the second Command Button. Inside the second command button click event method a query is fired which takes the parameters in the table which are checked and according to the parameters displays all the records inside the view in the Web Grid.

Any suggestions
Feb 4 '08 #1
Share this Question
Share on Google+
2 Replies


P: 32
Hi All,
Iam new in asp.net 2003 and sql server. I have to create an application having following criteria.

Proposed Steps

1. Create a table containing fields as Name of Report, View Name or Query in the database.

2. In the User Interface Label box, Combo box, Command Button, Table and web grid 5.2 controls are used.

3. First in the Combo Box user selects a report and click on the Command button. Inside Command button click event method, a query is fired taking report name as parameter which fetches all the fields of the corresponding View stored in the Custom_Rep_Table.

4. After fetching all the fields from the View, these fields are displayed in the table created dynamically. Corresponding to the fields there are specific Checkboxes and textboxes.

5. User specifies the values for the fields in the textboxes and checked out the checkbox(s) and clicks on the second Command Button. Inside the second command button click event method a query is fired which takes the parameters in the table which are checked and according to the parameters displays all the records inside the view in the Web Grid.

Any suggestions
You could use :

SELECT TABLE_NAME FROM INFORMATION_SCHEMA.VIEWS WHERE TABLE_NAME LIKE 'reportsForMyApp_%'

This would list all the views whose name starts with "reportsForMyApp". You can also store the name of the views in a table created specificly for that.

After the user selects the report he wants, you can list the columns in the view with :

SELECT COLUMN_NAME FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'viewName'

You can use the result set to list the available column names to the user. After he selects what he wants, you can include those fields in a query that would looks like

SELECT [insert what the user has choosed here] FROM [the table name]


Hope this helps
Feb 4 '08 #2

P: 29
thankx

But my problem is different. Actually in Userinterface i have a form which contains
a drop down list box in that reportname which is stored as a record is populated.
After that when user clicks a report in ddl , the corresponding view which is also stored as record in the table is selected and the query returns the fields in the view and we have to display that fields in the table
Feb 5 '08 #3

Post your reply

Sign in to post your reply or Sign up for a free account.