Jump to content
We've recently updated our Privacy Statement, available here ×

Examples on subreports


nagaraju.padala19

Recommended Posts

  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

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!

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...