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

Subreport Problem


shivac

Recommended Posts

 Hi there,

              I created a master report which having a subreports, When I give a preview in iReport it is Working fine. I m getting the following error message when I was running from jasperserver  "net.sf.jasperreports.engine.JRRuntimeException: Parameter "DATABASE_TIMEZONE" does not exist". I refered earlier forum posts, but nothing turned out to help. My subreport contain only graphs I m not passing any parameters, then i called that subreport in master report. please help me out.

 

Thanks in advance

Shivac

Link to comment
Share on other sites

  • Replies 12
  • Created
  • Last Reply

Top Posters In This Topic

 Hi Anandharaj

                         Thanks for your quick replay, I m using JasperServer 3.1 and iReport 3.1.2. when I give a preview in iReport it is working fine and when I run from JasperServer then it Shows "net.sf.jasperreports.engine.JRRuntimeException: Parameter "DATABASE_TIMEZONE" does not exist". here I attached Master Report xml file.

 

Thanks in advance

Shivac

Link to comment
Share on other sites

Based on attached master jrxml file, it will not work if you run from JS. You need to upload both xml file to JS, and in your master report, you need to call the sub-report using the "repo". Currently it point to a local directory which will only accessible if you run through ireport..
Link to comment
Share on other sites

 Hi Anandharaj,

                I m not getting your point, can you please give me some clear details about  where i have to upload my main & subreport xml?.can you explain me What is "repo" Where can I use this.  I m created simple chart in subreport, then in main report i m just give a path for "use existing report  : D:iReport_Examples catLine.jrxml " then "Connection Exp : using the Master Report" Then no parameters. Then i give a preview its working. what mistake i commited here?. Then I call main Report .jrmxl file to JasperServer. Is this correct or have to change anything?.

 

Thanks in advacne

Shivac



Post Edited by siva chidhambaram at 04/06/09 03:37
Link to comment
Share on other sites

 Hi there

              can anybody help me how to do a subreport, I m using iReport 3.1.2 and JasperServer 3.1 .

In my main Report I gave a Report Expression as "<subreportExpression class="java.lang.String"><![CDATA["repo:/Reports/SubReportDealer"]]></subreportExpression>" i tried like "/Reports/SubReportDealer" but no use it giving a error massage as "java.lang.ClassCastException: com.jaspersoft.jasperserver.api.metadata.jasperreports.domain.client.ReportUnitImpl". "/Reports/SubReportDealer" Under a Report folder I created a JasperServer Report. What's the mistake i commited here?. can anybody help me out this?.

 

Thanks in advance

Shivac

Link to comment
Share on other sites

Hi,

Assume that you have uploaded both xml file in JS:

/

 - mainreport

- subreport

 

So, in you main reportm, you need to call the sub-report using "repo" notation: repo:/subreport
Below is sample from my report. (im passing parameter also to subreport)

Code:
<subreport  isUsingCache="true"><reportElement  x="0"  y="0"  width="2400"  height="100"  key="subreport-1"  stretchType="RelativeToTallestObject"/><subreportParameter  name="SubParam">  <subreportParameterExpression><![CDATA[$P{MainParam}]]>  </subreportParameterExpression></subreportParameter>					<connectionExpression><![CDATA[$P{REPORT_CONNECTION}]]></connectionExpression><subreportExpression  class="java.lang.String"><![CDATA["repo:/subreport"]]></subreportExpression></subreport>
Link to comment
Share on other sites

Hi Anandhraj,

After following your instructions now I'm getting another error. I have attaced the code also.

My Main report name is : report1

Subreport name is : catLine (which is a line graph)

both are loaded to JS.

The error now is

com.jaspersoft.jasperserver.api.JSExceptionWrapper: Error loading object from URL : repo:/catLine

Code:
<subreport isUsingCache="true">				<reportElement x="11" y="16" width="166" height="100"/>				<connectionExpression><![CDATA[$P{REPORT_CONNECTION}]]></connectionExpression>				<subreportExpression class="java.lang.String"><![CDATA["repo:/catLine"]]></subreportExpression>			</subreport>
Link to comment
Share on other sites

Hi Anadhraj...

Hey its working now. Thanks a lot. But Its good for one subreport. If we have two subreports and when called from JS now its giving this following error. What error is this? whats the cause and how to fix it? Plz help.

 

com.jaspersoft.jasperserver.api.JSExceptionWrapper: java.io.UTFDataFormatException: Invalid byte 1 of 1-byte UTF-8 sequence.

 

the files are same. Here instead of one subreport the report1.jrxml calls two subreports.

Link to comment
Share on other sites

  • 2 months later...
  • 4 years later...

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...