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

C-Box

Members
  • Posts

    910
  • Joined

  • Last visited

 Content Type 

Profiles

Forum

Events

Featured Visualizations

Knowledge Base

Documentation (PDF Downloads)

Blog

Documentation (Test Area)

Documentation

Dr. Jaspersoft Webinar Series

Downloads

Posts posted by C-Box

  1. As the PrintWhenExpression should be evaluated always at NOW you can't hide it via a PrintWhenExpression BUT you could give that FooterTextField an EvaluationTime at "Report" (so if you are working with the DummySubReport) and try to use an "inline" IfThenElse TextExpression alá:

    $V{COLUMN_COUNT} >1?"continued in next page":""[/code]

    (not sure if it was column or report count, just try)

    Just give it a try... it's quite some years ago, when I made it. But I know it can work.

    regards from snowy Dresden/Germany

    C-Box

     

  2. Have you already checked, if one of the fields is NULL??

    Try to change the order of the expression to: (not sure whether your ZIP is plain int or Integer or String, that's why my convert to String):

    "NEW YORK".equalsIgnoreCase($F{city}) && ("10001").equals(String.valueOf($F{city_zip})) ? $F{sales_amount}:0 

    by default, Jasper is not null-safe... so you should be aware of correct order for equals-comparisons

    hth + regards

    C-Box

  3. Have you tried this also when you simulate being in January? So I doubt, that just subtracting 1 from current month will automatically switch to december and then also decrements the year to the past one!?!?  Just give it a try and post your result.... would be interessting. 

    regards from rainy Dresden/Germany

    C-Box

  4. First it seems that your SubReport has the wrong page format (full size letter/A4 ??) but when you use it within a "surrounding" main report, (as shown in your screenshot)  you can't use the full page width as the SubReportElement itself is just a part of the calling main report. So either shrink the SubReport width to the calling element width or enlarge the SubReport-Element width to full page-with of MainReport.

    Second it seems that you forgot to pass the (query) parameter (ID?) and/or the ReportConnection for the query from MainReport to SubReport, isn't it?
    That would explain, why your subreport returns values when is executed standalone but doesn't show values when executed from MainReport.
    just check the SubReport-Parameter at the SubReport-Element in your MainReport.

     

    hth + regards

    C-Box

  5. Do you mean with "footer" a static band like PAGE-FOOTER or a dynamic band like GROUP-FOOTER?

    In a static band there is no chance to dynamically shrink the band height, as the defined band heights in jrxml are fixed.

    In a dynamic band (e.g. detail, group-headers/footers) you just have to set "RemoveLineWhenBlank" to true at each textfield that you want to hide with PrintWhenExpression.

    And be sure, that your textfields are not overlapping each other and also that no other element is using the same vertical space (e.g. a surrounding rectangle or vertical line)... otherwise RemoveLineWhenBlank WON'T work.

    hth + regards

    C-Box

  6. As far as I know Jasper still doesn't support full html source/tags within textfields. Just the simple ones like for example <b> <i> <u> <font> <sup> are supported. It's quite difficult to implement a (inner) content changing layout within a simple textfield that is part of a JasperReport (outer) design as well. So imagine a <table> within a textfield that is part of a table component in Jasper also?!? 

    So I guess that's why there won't be any FULL html support in JasperReports.

    There was a HTML Component (look into the tracker for former discussions with Teodor) that actually should do that, but this isn't working as expected.

    So the only way I know is to render the content with e.g. the JEditorPane or any other "html2image" component to an image object and print that in your reports.... but then you have to live with the limitations of scaling, resolution and breaking pages. So a very ugly solution.

    Sorry but perhaps anyone knows it better!??!

    regards

    C-Box

  7. Sounds as you just forgot to set the Flag "StretchWithOverflow" at your TextField to true. Be aware that each element below such a stretching textfield should have PositionType set to "Float" instead the default "FixRelativeToTop"

    The width of a textfield can't be modified at runtime, as TextFields can just stretch to bottom and not to the right (when I understood your question right, you have asked for any way to do something like that, isn't it?)

    hth + regards

    C-Box

  8. There are newly (not sure what JasperVersion.. something bigger that 6.x I guess) introduced variables for much easier usage of PageNumbering with SubReports and so on

    Just take a look into the built-in variables MASTER_CURRENT_PAGE  and MASTER_TOTAL_PAGES.

    BTW: Also you could use the "LastPageFooter-Band" as well to explicitly set your EOC flag differently without any complicated expression

    hth + regards

    C-Box

  9. IMHO actually the BeatDatasources uses reflection with invoking getter-Calls of the Bean - not sure whether newer versions of JasperReports do still so, as reflection will be forbidden in future java releases when I understood right.  

    When I remember right, you could use the description at the Fields in jrxml to "wrap" it to something other in the class names.

    But you said, that you can't modify the jrxmls actually... so the only (dirty) idea I have, just rename the fields in your class to "Capitalized" names (not nice, as in Java actually fields are starting in lowercase starting, but working nevertheless)

    so somthing like

    private String Start = "initialFieldValueForStart";[/code]

    just give it a try.... 

    otherwise try to refactor the jrxmls

    hth + regards

    C-Box

  10. Well I tried your design... and  just "colored" a bit: :-)

    Is causing this:

    When shrinking the outer (red) frame to this:

     

    The outer space is of course smaller:

     

    So not sure why you "wasted so much space and why you use a frame within a frame at all... but the inner frame  doesn't cause the outer frame to shrink... even when RemoveLinenWhenBlank is set to both frames, there is nothing inside the frame, that could moved upwards so the frame distances till their end will be kept.

    hth + regards

    C-Box

  11. Well I'm not so familiar with the JasperReportsServer as I normally just use the default JasperReports Library within "normal" JavaApps. Sorry!

    But I could imagine something like this:

    Report1 is just responsible to get the parameters from User

    a ReportScriplet for Report1 is responsible to pass the parameter to your JavaApp that fills the data synchronous by the passed through parameters into the database (so report1 will take a while e.g. AtReportStarted-EntryPoint ( beforeReportInit() ) of scriplet until the JavaApp finished the preparation of data

    Report1 contains a SubReport( so this is Report2) that actually just  collects these Data from the currently filled Scriplet class (you could return a different Connection or perhaps a (Custom)JRDataSource instance if needed) and returns the results to the User

    So just an idea.... but perhaps you can do something other with built-in features in JasperReportsServer that I don't know. Looks also a bit of "AdHoc ETL" !? :-)

    Perhaps a Staff member or a JasperReportsServer PowerUser will answer this topic also??!??

    hth + regards

    C-Box

  12. Not sure what you actually want to get back from your generated report to your calling java app???

    So of course you can also use some webscrapers (I've no experiences with such tools) and extract content from generated (html) content. Also the CustomDataSource that wraps your ResultSet/Data could be an approach... so that's why I wrote nothing is impossible... it depends what exactly you want to do?

    Like I said: for just getting some calculated sums from JasperVariables in some bands the scriplet or parsing the JasperPrintObject way would be the easiest was (IMHO)

    regards

    C-Box

  13. You will have to implement a custom ChartCustomizer for that. I've done something similar several years ago when I had too much dates overlapping on x-axis and I just wanted to display some of them (e.g.) weekly but without loosing the tick marks itself.

    So the blog entries from MDahlmann could probabely help! :-)

    https://mdahlman.wordpress.com/2011/04/17/chart-customizers-2/  or https://mdahlman.wordpress.com/2010/08/18/chart-customizers-1/

    hth + regards

    C-Box

  14. Have you passed the correct report connection? Are all parameters passed correctly to the report query with the correct data types?

    It's a different when just running the query within the designer (database test) and when starting the real fill process (print/export/preview.) 

    So here some more input is required.

    hth + regards

    C-Box

  15. You could use the simple HTML Syntax for that purpose.

    just concat both fields like this: 

    $F{FieldA} + "<b><i>" + $F{FieldB} + "</i></b>"[/code]

    then set the Markup-language property at the textfield to HTML and check the preview. (be aware that there is no bold settings at the textfield itself.... otherwise FieldA would be bold as well of course ;-)

    hth + regards

    C-Box

×
×
  • Create New...