• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

Dynamic Reports using jsp

 
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am trying to generate dynamic report for my project
Everytime i will be selecting different fields to be displayed
in the report based on some criteria . My idea is to set the data with is retrived
from resultset into my dto(data transfer object) and display this in jsp.( I am sucessfull in generating the
dynamic query).
But i am facing problem in set the values to dto since my query fields
vary every time. I am not able to understand to which dto property
i have to set values returned from resultset since i do not know in advance which fields will be selected
by user. All the values are coming from only one table.
I am not using any report framework for this project. Can anybody suggest how
this can be solved.

thanks in advance.
 
Sheriff
Posts: 67590
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If the key/value pairs are constantly changing, perhaps a DTO, which is best-suited for non-changing properties, isn't the best structure.

Perhaps there is another Java construct (cough, Map) that could hold arbitrary key/value pairs (cough, Map) that you could use.
 
Ranch Hand
Posts: 118
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
subtle...
 
Bear Bibeault
Sheriff
Posts: 67590
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by John Gregory:
subtle...

as a hammer!
[ April 02, 2008: Message edited by: Bear Bibeault ]
 
chetan raj
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi thanks for the prompt reply.
can anybody give a link
to an example on generating dynamic
reports will be helpful.

thanks in advance
 
Rancher
Posts: 43026
76
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It seems that the question doesn't have much to do with generating reports, but with reading a number of options the user may have selected, and how to generate a database query from that, correct?

In that case, you need to check for all the options (because the user might have selected any or all of them), and generate the query in a way that allows each one of them to be used or not used. Can you think of a way to do that?
 
F is for finger. Can you stick your finger in your nose? Doesn't that feel nice? Now try this tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
reply
    Bookmark Topic Watch Topic
  • New Topic