Karan Saxena

+ Follow
since May 23, 2014
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Karan Saxena


I am new to jaspersoft and has been exploring it features since a few days .

I was wondering is it possible to generate report in jaspersoft ,onclick of a button as csv file or pdf file based on user specified parameters .

please reply soon ...
3 years ago
Hi thanks for the prompt reply :-

Here are the answers to your question :-

1. The speed of my network is around 2 mbps

2. I am using Jboss as 7.1

3.My payload include JSON DATA ,images ,text ,no videos ,,nested jsp

Hope to get an answer soon
3 years ago
I read the web ,, and came to know that apache reverse proxy increase web performance by caching ,so that popular web pages don't have to refetched .

You have mentioned that gz compression can be used to compress data on the fly .Please elaborate what data are you talking about ,is it the data we fetch from database ,or you are talking about something else .

Please elaborate gz compression ,I am new to this
3 years ago
Is there any way by which I can increase Struts2 based web application performance if my network is slow ???

Maximun I can think of is ,Keeping size of WAR small .

Removing unwanted comments and white space to increase performance .

Please let me know is there any other way ,by which I can achieve better performance when network is slow .

3 years ago
I am using <sj:autocompleter> in my jsp page; whenever I select an element from dropdown list first time and click on submit then it works fine but when I again try to select an element from the list then, I am not able to select an element .

But when I use s:select instead of sj:autocompleter I am able to do reselection normally: the problem only comes when I use sj:autocompleter.
4 years ago
Data in drop down ,not persisting in chrome and IE -11 .But working fine in firefox .

error shown via inspect element is -> Cannot read property split() is undefined .

Below is the Funtion in jsp ,used to display the data in dropdown

exact line in which I am getting error is -- var count = data.id.split("_")[1];

I am using Jboss AS 7.1 ,but I want to configure it in a way such that it displays only error messages instead of info or log messages on the console .please guide ,I don't haveany clue to start .
4 years ago
Actually I have got a situation ,and I am looking for guidance .. The thing is I have got a table which contains entries for days and time at which a user can access the system .

The columns are in this way :-

Userid day accesstimefrom accesstimeto

now I am looking for a way by which I can ensure that for a particular user who has got entry in the table ,the user should be able to access the system at the time and day specified in the table upto the value in accesstimeto column of my table .for if

userid =1

then user with userid =1 can access the system only at wednesday at 02:00 in the night till 04:00 i.e for 2 hrs

Please provide a way how can I achieve this ,

I am using
Jboss 7.1 as server
oracle 10g DB

hey sorry for my mistakes .i really appreciate your reply ,

I figured out something myself ,just need a little help now

i wrote the below function to get value of checked checkboxes ,so that I can send the value to java class using ajax ,the name of variable I have used in code is checkID

but inside java class ,I just get ["true" ,"true"] incase I select two checkboxes instead of actual value of checkbox...

Please help asap
Hello .what I am trying to do is that ,I have got 7 checkboxes on screen representing days of the week ,,and there is a save button on click of that button ,I want to send the id/name/value of all those checkboxes which have been checked by user along with the ajax call to the java class , so that I can know all the days for which user has checked the corresponding checkbox .

till now I have used .change function
but when i used alert($("#checkboxes").val()); to know ,what is ultimatley stored in that variable checkboxes ,it shows a pop without anything..

Please refer to function getParam() in the below code which is invoked when button is clicked

Please help whats wrong with this ,,,

The argument value gets it value from jsp at rumtime

The moment the control reaches at :- formatter = DateTimeFormat.forPattern("HH:mm"); it could not go beyond this
I executed this part DateTimeFormat.forPattern("HH:mm"); by pressing cntrl+shift+I and got this message :- could not resolve type: org.joda.time.format.DateTimeFormat

Please help whats wrong

and Please let me know if anything else is wrong with the code

Basically what I want to do is increment time for eg: if time is 09:00 and I want to increment it by 30 then it should become 09:30 and this goes on till the time loop condition is satisfied ,,when i researched on net ,I found out that Joda library is easirer to work with for such tasks ,Please advice and help asap

I am a newbie

4 years ago
Hi I tried what you said but didnt get to work

then i found the link

Similarly i created a fonts.xml file and a jasperreports_extension.properties file under my webinf folder

but i wasnt able to get it working

here is the code for

<?xml version="1.0" encoding="UTF-8"?>
<fontFamily name="Arial Unicode MS">


Here is the code for jasperreports_extension.properties


Please whats wrong with the approach..
5 years ago
Thanks buddy will surely try out your solution and let you know
5 years ago
one thing more the arialUnicode .jar zip included two other files namely -report24775-eastAsian.jrxml ,,,and report24775-eastAsian.jasper.please help what to do with these .

I am new to jasper ,please help asap ...urgently required.
5 years ago
Hi buddy ,thanks for the prompt reply,,

I have downloaded the zip for arial unicode font jar ,and has included both arial unicode .jar and itextasian.jar in the buildpath of my web folder .but as I am using

Adhoc Reports ,so do i need to make any additional changes in templates.java file .

Below is the code for the file:-

import static net.sf.dynamicreports.report.builder.DynamicReports.*;

import java.awt.Color;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Locale;

import com.lowagie.text.Font;

import net.sf.dynamicreports.report.base.expression.AbstractValueFormatter;
import net.sf.dynamicreports.report.builder.HyperLinkBuilder;
import net.sf.dynamicreports.report.builder.ReportTemplateBuilder;
import net.sf.dynamicreports.report.builder.component.ComponentBuilder;
import net.sf.dynamicreports.report.builder.datatype.BigDecimalType;
import net.sf.dynamicreports.report.builder.style.StyleBuilder;
import net.sf.dynamicreports.report.builder.tableofcontents.TableOfContentsCustomizerBuilder;
import net.sf.dynamicreports.report.constant.HorizontalAlignment;
import net.sf.dynamicreports.report.constant.PageOrientation;
import net.sf.dynamicreports.report.constant.PageType;
import net.sf.dynamicreports.report.constant.StretchType;
import net.sf.dynamicreports.report.constant.VerticalAlignment;
import net.sf.dynamicreports.report.definition.ReportParameters;

* @author Ricardo Mariaca (r.mariaca@dynamicreports.org)
public class Templates {
public static final StyleBuilder rootStyle;
public static final StyleBuilder boldStyle;
public static final StyleBuilder italicStyle;
public static final StyleBuilder boldCenteredStyle;
public static final StyleBuilder bold12CenteredStyle;
public static final StyleBuilder bold18CenteredStyle;
public static final StyleBuilder bold22CenteredStyle;
public static final StyleBuilder columnStyle;
public static final StyleBuilder columnTitleStyle;
public static final StyleBuilder groupStyle;
public static final StyleBuilder subtotalStyle;
public static final StyleBuilder aman;

public static final ReportTemplateBuilder reportTemplate1;
public static final ReportTemplateBuilder reportTemplate2;
public static final ReportTemplateBuilder reportTemplate3;
public static final CurrencyType currencyType;
public static final ComponentBuilder<?, ?> dynamicReportsComponent;
public static final ComponentBuilder<?, ?> footerComponent;

static {
rootStyle = stl.style().setPadding(1);
boldStyle = stl.style(rootStyle).bold();
italicStyle = stl.style(rootStyle).italic();
boldCenteredStyle = stl.style(boldStyle).setAlignment(
HorizontalAlignment.CENTER, VerticalAlignment.MIDDLE);
bold12CenteredStyle = stl.style(boldCenteredStyle).setFontSize(12);
bold18CenteredStyle = stl.style(boldCenteredStyle).setFontSize(18);
bold22CenteredStyle = stl.style(boldCenteredStyle).setFontSize(22);
columnStyle = stl.style(rootStyle)
.setHorizontalAlignment(HorizontalAlignment.CENTER);// to set
// the
// alignment
// of the
// data
columnTitleStyle = stl.style(columnStyle).setBorder(stl.pen1Point())
groupStyle = stl.style(boldStyle).setHorizontalAlignment(
subtotalStyle = stl.style(boldStyle).setTopBorder(stl.pen1Point());
aman = stl.style().setBackgroundColor(Color.WHITE);

StyleBuilder crosstabGroupStyle = stl.style(columnTitleStyle);
StyleBuilder crosstabGroupTotalStyle = stl.style(columnTitleStyle)
.setBackgroundColor(new Color(170, 170, 170));
StyleBuilder crosstabGrandTotalStyle = stl.style(columnTitleStyle)
.setBackgroundColor(new Color(140, 140, 140));
StyleBuilder crosstabCellStyle = stl.style(columnStyle).setBorder(

TableOfContentsCustomizerBuilder tableOfContentsCustomizer = tableOfContentsCustomizer()
.setHeadingStyle(0, stl.style(rootStyle).bold());

reportTemplate1 = template().setLocale(Locale.ENGLISH)

reportTemplate2 = template().setLocale(Locale.ENGLISH)
.setPageFormat(PageType.A1, PageOrientation.LANDSCAPE)

reportTemplate3 = template().setLocale(Locale.ENGLISH)
.setPageFormat(PageType.A1, PageOrientation.PORTRAIT)

currencyType = new CurrencyType();

dynamicReportsComponent = cmp.horizontalList(cmp
.setFixedDimension(40, 50)

footerComponent = cmp.pageXofY().setStyle(


* Creates custom component which is possible to add to any report band
* component
public static ComponentBuilder<?, ?> createTitleComponent(String label,String username,String Currentdate,String Beforedate) {

SimpleDateFormat sim = new SimpleDateFormat(
"dd-MMM-yy hh:mm:ss aa");

return cmp
"Report Generated On : " +sim.format(new Date()) +" by "+username+" for the period "+Beforedate+" to "+Currentdate+"").setStyle(


public static CurrencyValueFormatter createCurrencyValueFormatter(
String label) {
return new CurrencyValueFormatter(label);

public static class CurrencyType extends BigDecimalType {
private static final long serialVersionUID = 1L;

public String getPattern() {
return "$ #,###.00";

private static class CurrencyValueFormatter extends
AbstractValueFormatter<String, Number> {
private static final long serialVersionUID = 1L;

private String label;

public CurrencyValueFormatter(String label) {
this.label = label;

public String format(Number value, ReportParameters reportParameters) {
return label
+ currencyType.valueToString(value,
5 years ago