File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Struts and the fly likes display a dynamic search page Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "display a dynamic search page" Watch "display a dynamic search page" New topic

display a dynamic search page

yulina shu

Joined: Mar 09, 2005
Posts: 11
Hi all,

I am doing an advance search page, in which users can select the fields they want to search from a dropdown list, then search those fields from database and display them. My question is how I could display a dynamic search result page since the columns of search result are not fixed? And also how could user save those results as an excel file?

Any sample code or suggestion will be appreciated!
Senthil B Kumar
Ranch Hand

Joined: Feb 09, 2004
Posts: 160
exporting to an excel should not be a big deal. A simple solution for that would be , on click of the export to Excel button you can redirct to a diff page, which in background executes the same query and returns, only the frontend code will change when compared to the prior screen.

say if you are using JSP, initially set the mimetype to ms-excel and then construct a normal HMTL table.

If the users have MSExcel in thier PC, then this excel would automatically open in it as an excel sheet.

Work like you don't need the money. Love like you've never been hated. Dance like nobody's watching. Sing like nobody's listening. Live like it's Heaven on Earth.
Currently I Reside Here WEBlog
I agree. Here's the link:
subject: display a dynamic search page
It's not a secret anymore!