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

  • Home
  • SEARCH
  • 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 1037451
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T14:51:12+00:00 2026-05-16T14:51:12+00:00

I am trying to compile a sub-report from on the fly from java. I

  • 0

I am trying to compile a sub-report from on the fly from java.
I placed the subreport expression in the MAIN report as follows.

<subreportExpression class="net.sf.jasperreports.engine.JasperReport"><![CDATA[SubReportCompiler.getCompiledReport("reportId")]]></subreportExpression>

My subreportcompiler code is as follows:

public class SubReportCompiler {

private static final String JR_XML_HEADER = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
    + "<!DOCTYPE jasperReport PUBLIC \"-//JasperReports//DTD Report Design//EN\" \"http://jasperreports.sourceforge.net/dtds/jasperreport.dtd\">";


public static JasperReport getCompiledReport(String reportId)
{

    Report report = Report.getReportObject(reportId, applicationId);

    String jasperXML=JR_XML_HEADER + report.getJASPERXML();
    InputStream jrXMLStream = new ByteArrayInputStream(jasperXML.getBytes());
    JasperReport jReport;

    try {
        jReport = JasperCompileManager.compileReport(jrXMLStream);
    } catch (JRException e) {
        throw new ReportException(e.getMessage(), e);
    }
    catch (Exception e)
    {
        throw new ReportException(e.getMessage(), e);
    }

    return jReport;
}

}

while I am trying to execute the main report from java. I am getting the following error.

(java.lang.String) No such property: SubReportCompiler for class: report2_1280833699753_269232

Do I need to register any of the properties? How to compile the subreport on the fly from java while execution of the main report?

  • 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-16T14:51:13+00:00Added an answer on May 16, 2026 at 2:51 pm

    Where SubReportCompiler class is placed in? Is it placed somewhere in application Java packages? If yes, you should specify fully qualified class name in JRXML:

    <subreportExpression class="net.sf.jasperreports.engine.JasperReport">
    <![CDATA[mypackage.SubReportCompiler
    .getCompiledReport("reportId")]]></subreportExpression>

    Replace “mypackage” in the code above with your package name.

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

Sidebar

Related Questions

When trying to compile this code: #include <iostream> #include <vector> using namespace std; class
While trying to compile an LLVM IR, like this llc main.ll -o main.s &&
I am trying to compile the latest version of Qt for the mac (from
Im trying to write a generic base class that will allow sub classes to
i'm trying to add subreport to report. I have setted connection type to use
I am trying to compile Rcpp_0.9.7 from source on sparc-sun-solaris2.10. I am getting the
I'm trying to compile a project from the command line, like this: devenv.exe myproj.sln
I'm trying to run jGuru examples of RMI from the tutorial at ( http://java.sun.com/developer/onlineTraining/rmi/RMI.html
I am trying to create a report with 2 sub-reports for new and used
I'm trying out some code from a singleton base class article . But when

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.