Jump to content
  • suggest me how to use JRExporter.FILTER to hide columns(filter out).


    praveen_31
    Assigned User teodord
    CategoryFeature request
    PriorityNormal
    ReproducibilityNot Attempted
    ResolutionNo Change Required
    SeverityMajor
    StatusClosed

    Hi,

    Iam using jasperreports-3.5.3.jar to my reports.

    To prepare jrxml template Iam using iReport 2.0.4 tool

    In pdf I want to hide some cloumns dynamically.

    As per below url I tried to use JRExporter.FILTER, but no luck.

     

    http://jasperforge.org/projects/jasperreports/bugtracking/bug_view_page.php?bug_id=3358

     

    Can any one suggest me how to use JRExporter.FILTER to hide columns(filter out).

    I will appreciate if you provide with an example.

     

     

    Thank You,

    Praveen



    User Feedback

    Recommended Comments

    Hi,

    I tried to use following properites(filter).

    net.sf.jasperreports.export.{format} .exclude.origin.{suffix}.{arbitrary_name}

    Properties with this syntax are used by the exporters to create default exporter filter instances that filter out content based

    on element origin information. Possible values for the {format} token are pdf, html, xls, rtf, odt, csv and txt.

    The {suffix} token can be band, group or report.

    Note that the number at the end of the properties names is just an arbitrary suffix.

    The only thing that counts is that the suffix be the same for properties referring to the same filter.

     

     

    Here my pageHeader contains 6 columns,when I use above property entire row(pageHeader) is hidden that is fine but my requirement is that I need to hide 2,3 columns in the page.

     

    Please suggest me how can I achieve the above (hiding 2,3 columns in the page).

     

    It would be great if we have similar property like "IS_REMOVE_EMPTY_SPACE_BETWEEN_COLUMNS " for PDF,HTML as it is present in XLS.

     

    Thank You,

    Praveen

    Link to comment
    Share on other sites

    Hi,

     

    You should set the optional "key" property to the elements that you want to remove.

    Then, in the exporter, you set the FILTER exporter parameter with an instance of the

     

    http://jasperreports.sourceforge.net/api/net/sf/jasperreports/engine/export/ElementKeyExporterFilter.html

     

    You create this exporter filter instance and provide it with the key values of those elements you want to remove.

     

    However, when the elements are removed, you end up with white space gaps in the document, as the other content does not move to take up the space.

     

    If you want the other columns to move and take up the space, you need to vote for some other feature requests that track the creation of a pure table component in JR.

     

    http://jasperforge.org/projects/jasperreports/tracker/view.php?id=2659

     

    I hope this helps.

    Teodor

     

    Link to comment
    Share on other sites


×
×
  • Create New...