Jump to content

jo_atman

Members
  • Posts

    31
  • Joined

  • Last visited

 Content Type 

Forum

Downloads

Featured Visualizations

Knowledge Base

Documentation (PDF Downloads)

Blog

Documentation (Test Area)

Documentation

Dr. Jaspersoft Webinar Series

Security Advisories

Events

Profiles

Posts posted by jo_atman

  1. This is the age-old question: how do i change the font used in the report dynamically? I have gone through the forum and found the following answers:

    1. make as many lines as there are fonts and use printWhen to get the right font to print. This is a hack.

    2. use a parameter or field to determine the font and change the <style> in the field. this one is still very cumbersome. if you have a hundred fields to show, putting the <expr> ? val1 : val2 with all the <style> stuff is tedious.

    What's the laziest way to get this done :)

    could i define <style>s at the beginning and then use the expression in 2. and switch between the styles?

    Is there a cleaner way to do this through my datasource?

    Thanks,

    Nilesh

  2. Folks,

    I'm trying to pass a parameter into my subreport from the main report, and this is what i have:

    in main report:

    <subreport isUsingCache="true">

    <reportElement x="25" y="5" width="501" height="128"/>

    <parametersMapExpression>

    $P{REPORT_PARAMETERS_MAP}

    </parametersMapExpression>

    <subreportParameter name="contractProxy">

    <subreportParameterExpression>

    <![CDATA[$P{contractProxy}]]>

    </subreportParameterExpression>

    </subreportParameter>

    <subreportExpression

    class="net.sf.jasperreports.engine.JasperReport">

    <![CDATA[$P{GeneralInfoSubReport}]]>

    </subreportExpression>

     

    </subreport>

     

    So i have tried passing the parameter as both an individual one, as well as the whoel param map.

     

    In the subreport, i say,

     

    <parameter name="contractProxy" class="..."/>

    ...

    <textFieldExpression

    class="java.lang.String">

    <![CDATA[$P{contractProxy}.getValue("contractID")]]>

    </textFieldExpression>

     

    And i get the following error:

    net.sf.jasperreports.engine.JRException: Errors were encountered when compiling report expressions class file:

    1. com.sabre.airprice.ContractProxy cannot be resolved to a type

    value = (java.lang.String)(((com.sabre.airprice.ContractProxy)parameter_contractProxy.getValue()).getValue("contractID"));

    <------------------------------>

    2. com.sabre.airprice.ContractProxy cannot be resolved to a type

    value = (java.lang.String)(((com.sabre.airprice.ContractProxy)parameter_contractProxy.getValue()).getValue("contractID"));

    <------------------------------>

    3. com.sabre.airprice.ContractProxy cannot be resolved to a type

    value = (java.lang.String)(((com.sabre.airprice.ContractProxy)parameter_contractProxy.getValue()).getValue("contractID"));

    <------------------------------>

    3 errors

     

     

    The same textFieldExpression in my main report compiles without a hitch.

     

    Any help is greatly appreciated.

    Thanks,

    Nilesh

  3. Tim,

    On an unrelated topic, I apologize for "decreasing your karma". i had no idea what those thumbs up/down icons were, and i thought it would give me info on those, and instead, it "decreased your karma", whatever that means. i had no intention of doing that.

  4. Folks,

    I'm looking at the samples, and i was checking out the subreports sample, and either i don't understand how it works, or something is missing or both.

    The zip file contained the following files:

    MasterReport.html

    MasterReport.jrxml

    MasterReport.pdf

     

    Shouldn't there be a jrxml or something for the subreport part? basically i can't figure out where the subreport text is coming from. e.g.

    in the left column it says, "Products ordered by people in <City>", and on the right side it says, "Addresses in <city>", but i don't see this text in the MasterReport.jrxml.

     

    Thanks,

    Nilesh

×
×
  • Create New...