inkimar Posted October 11, 2006 Share Posted October 11, 2006 Hello! Having a table with more than 300.000 posts.These are stored in a mysql database.I want to be able to search those post with ansql-query, giving me a result-set of 3000-4000 posts. Not knowing Jasperreports, wanting to favour OS and learn OS-applications when I do small apps like this one. Is JasperReports the right tool for me, or do I have to write a small Servlet program for this which hands me the result on a jsp-page ?Thinking that Excel and VBA could give me a fair result here.But both approaches would require that I have to study to get into the technique, rather read about OS. could anyone give me an advice on how to handle this problem. regards, i Link to comment Share on other sites More sharing options...
rsilverns.sympatico.ca Posted October 12, 2006 Share Posted October 12, 2006 You could write the query in a servlet and then run the query and pass the result set into the report to be used to fill the report, OR pass the connection to the database into the report and have a queryString already specified in the report for the <queryString> element to run the query for you. Either way, jasper can easily format and display the output nicely. Link to comment Share on other sites More sharing options...
inkimar Posted October 12, 2006 Author Share Posted October 12, 2006 Hello, thanks for the advice. So I could write a simple servlet-appwhere the JSP has three fields, based on the inputof those fields I will conduct a search and the resultset will be displayed in jasperreport ....(jr)Sound like I could do all in my servlet withno use of jr? or do you mean that I write my serlvet within the 'framework' of jr ?Not so familiar with jr. testing openreports, based on jasperreports, at the moment,I could ask more questions in that forum on this subject related to input instead of drop-down menus. regards, i Link to comment Share on other sites More sharing options...
rsilverns.sympatico.ca Posted October 12, 2006 Share Posted October 12, 2006 In consideration of a modular design and ease of updates I would include the queryString in the report and just pass in a connection to a database to run the query against. (That being said, I would leave it up to lucian or teodor to comment on which is the most efficient approach for large datasets.) Doing it this way, you would take the 3 fields that you are searching by... lets use an example of students... you could search by student age, student FirstName, student last name.... So you pass to the report a parameters Hashmap containing... "STUDENT_AGE"->"15""STUDENT_FNAME"->"Jasper""STUDENT_LNAME->"Anon" Then your query string would look something roughly like... select * from database.table where age='$P!{STUDENT_AGE}', fname='$P!{STUDENT_FNAME}' etc. etc. Note: You would have to define these 3 parameters in your report definition. It is true you could simply return an html page containing the data organized in a table etc. and not use jasperreports at all. JasperReports brings a lot of flexibility to the process however. With Jasper you could export to CSV, HTML, PDF, XLS etc. etc. as per your needs with little changing of the code. It is all a matter of specific demands of the project. Link to comment Share on other sites More sharing options...
inkimar Posted October 13, 2006 Author Share Posted October 13, 2006 Thanks! Using openreports helped me out here.I was able to do the search there, using a txt-field where I could not have a drop-down-list. So everything is working for me on my XP. is this what is referred to as crystal-reports !?still beeing new to this lingo. getting into trouble when exporting my .war toa debian machine, getting a 'java.lang.ClassCastException' - is my app trying to connect to some .jars in the JBoss installation instead of those I provided. due to the fact the openreports is built using JasperReports I ask this question here. :unsure: regards, i Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now