Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 854235
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T07:53:34+00:00 2026-05-15T07:53:34+00:00

I have two tables to be printed in same page. Data for those tables

  • 0

I have two tables to be printed in same page. Data for those tables will be supplied from a map from a custom data source. I need to implement it. I googled for implementing this task.

At that time I came across sub-reports concept, but I didn’t get much info for how to implement sub-reports.

I have an idea of how to create sub-reports. But I don’t know how to fill sub reports with customdatasource. That’s my question. Please help me in achieving this.

Note: I tried to implement subreports, but I am getting an error. Here is the code I used for compiling subreports:

JasperPrint print = new JasperPrint();
JRPdfExporter exporter = new JRPdfExporter();
JasperDesign design, design1;
JasperReport report, report1;
JasperReport jasperReport;
JasperDesign jd1;

jd1 = JRXmlLoader.load("D:\\sub_report1.jrxml");
jasperReport = JasperCompileManager.compileReport(jd1);
Map parameters = new HashMap();
parameters.put("ReportTitle", "Table Report");
parameters.put("DataFile", "TableSource.java");
parameters.put("Subreport_1", jasperReport);

design = JRXmlLoader.load("D:\\sub_report2.jrxml");
report = JasperCompileManager.compileReport(design);
parameters.put("Subreport_2", report);

design1 = JRXmlLoader.load("D:\\master_report.jrxml");
report1 = JasperCompileManager.compileReport(design1);
JasperFillManager.fillReportToFile(report1, "D:\\master_report.jrprint", parameters, new TableDataSource());

exporter.setParameter(JRExporterParameter.JASPER_PRINT, print);
exporter.setParameter(JRExporterParameter.OUTPUT_FILE_NAME, "D:K\\Report.pdf");
exporter.exportReport();

JasperViewer.viewReport(print);

Here I have compiled subreport1 & subreport2 individually and added them as a parameter in map. Then I’m getting an error while filling it through masterreports. Please help me to compile the report.

Stack trace of the compiler error:

Exception in thread “main” net.sf.jasperreports.engine.JRRuntimeException: Unkown print order 0.
at net.sf.jasperreports.engine.fill.JRFillSubreport.initSubreportFiller(Unknown Source)
at net.sf.jasperreports.engine.fill.JRFillSubreport.evaluateSubreport(Unknown Source)
at net.sf.jasperreports.engine.fill.JRFillSubreport.evaluate(Unknown Source)
at net.sf.jasperreports.engine.fill.JRFillElementContainer.evaluate(Unknown Source)
at net.sf.jasperreports.engine.fill.JRFillBand.evaluate(Unknown Source)
at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillColumnBand(Unknown Source)
at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillDetail(Unknown Source)
at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReportStart(Unknown Source)
at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReport(Unknown Source)
at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(Unknown Source)
at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(Unknown Source)
at net.sf.jasperreports.engine.fill.JRFiller.fillReport(Unknown Source)
at net.sf.jasperreports.engine.JasperFillManager.fillReport(Unknown Source)
at net.sf.jasperreports.engine.JasperFillManager.fillReportToFile(Unknown Source)
at ReportTableCompiler.main(ReportTableCompiler.java:53)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T07:53:34+00:00Added an answer on May 15, 2026 at 7:53 am

    I posted the answer for the similar question. You can check the answer here.

    Using iReport with eclipse to generate reports approperly

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.