nagaraju.padala19 Posted December 18, 2014 Posted December 18, 2014 I want more examples.That can run using java code can u send me plz..So that i can practice I am using 4.7.1 version
Java_Jasper Posted December 18, 2014 Posted December 18, 2014 You will want to use a servlet, for this.public void doGet( HttpServletRequest request, HttpServletResponse response) throws ServeltException, IOException{String directory = " ";directory = request.getPram("dir"); --your defined direcotry on your system.paramater = new HashMap(subReport(direcory)); -- this will define your sub report as a paramater in a hash map}Where subReport is the method:public Map subReport(String direcotry) throws JRExcption, FileNotFoundExcption{String japerFile = directory + " Name_of_your_file ";JaperDesign subReportDef = JRXmlLoader.load(new FileInputStream(new File( jasperFile)));JasperReport subReport = JasperCompilerManager.compileReport( subReportDef );Map result = new HashMap();result.put( "paramater_name_in_jasper_template, subReport);return result;}Enjoy!
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