Posts

Jasper Report Viruatization

Image
Jasper Report Viruatization There are certain things to care while implementing the Jasper Reports for huge data-set to handle the memory efficiently, so that the application does not go out of memory. Pagination of the data and use of JRDataSource Viruatization of the report. Problem:- When there is a huge data set, it is not a good idea to retrieve all the data at one time.The application will hog up the memory and you’re application will go out of memory even before coming to the jasper report engine to fill up the data Solution :- To avoid that, the service layer/Db layer should return the data in pages and you gather the data in chunks and return the records in the chunks using JRDataSource interface, when the records are over in the current chunk, get the next chunk until all the chunks gets over Even after returning the data in chunks, finally the report has to be a single file.Jasper engine build the JasperPrint object for this. To avoid the piling up of me...

Java Best Practices

Use meaning full names The name must specify where the parameter is used for. For example if you want to store the elapsed time in days, name it that way. Of course don't make it all too long, the more you need to read, the slower you will have read it. good bad Int elapsedTimeInDays Int n; // elapsed time in days int elapsedTime; // in days   int elapsedNumberOfDaysFromStarttime void postPayment( ) { ... } void do(){...} Use pronounceable and searchable names. Unpronounceable names make it difficult to search through your code and find errors Date generationTimestamp; Date genymdhms; // generate year month day hour minute second Date randTime; // sounds like ran time Use names for constant numbers. When you need to search for a certain pattern, these words help you telling where a number is u...