Click here to Skip to main content
15,923,142 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hey all
I've been given a question to solve and would like some advise on where to start preferably with a few links.

Sorry for the Subject title, I don't have a word to summarise the question.

Current System
The system currently has a database table of users and a table of reports the users had inserted into the database.
Reports are currently accessed in a large drop down list, but because this would get rather messy after you have 1000s of reports to search through.

Question
The requested change to this system is to add folders to separate the reports allowing users to choose between looking at all reports or choosing a specific folder and then the drop down list below showing all database reports in that folder

Summary:
1.User selects Folder A from the Browse controller
2.The user chooses folder C that is inside A
2.Reports within database folder C are then shown in a drop down list to be loaded on selection.

The solution I thought was to have 2 drop down lists, the first shows all of the possible folders you can choose from and then sub-folders and so on inside those folders
The second drop down list would be a list of all reports in the folder chosen in the first drop down list

Thanks in Advance
Posted
Updated 5-Aug-11 1:07am
v2

1 solution

Here's a better design.
Create a table that can hold information about hierarchical virtual folders. Something like this:
SQL
CREATE TABLE ReportFolders (
FolderID int IDENTITY(1,1),
FolderName varchar(100) NOT NULL,
ParentFolderID int NULL
)


Your reports table can contain a FolderID column that contains the ID of the folder under which the report is shown.

Add a tree view to your reports page and show the folders from the table in the TreeView. Initially fill the TreeView with the top level folders (where ParentFolderID is null). In the node expand event, add the nodes representing the child folders (ParentFolderID = Id of the current folder) and the reports under the folder (where Reports.FolderID = Id of the current folder).

This will result in a much better Reports management system than a single level dropdown list.
 
Share this answer
 
Comments
Phoenix234 5-Aug-11 7:09am    
Interesting, Although how would I handle Sub folders? and browse through the folders in the first place?

Say I Clicked folder A then inside folder A is Folder C. How would I show that with a controller?
[no name] 5-Aug-11 8:28am    
You read all folders whose Parent Folder is Folder A and then add these folders as nodes under Folder A.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900