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

Everything posted by C-Box

  1. 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
  2. You could try to increase the DPI from default 72dpi to something higher... but I doubt if this will work. The label printer normally interpretes data in ther given printer language (like zebra or something like that)... when sending labels from a JasperReport it's passed as a 2D PrintJob (so like an image)... that's why the quality is mostly much worse than before. So my experiences over the last years in several customer projects. Sometimes it helps to change the fonts to some of the native supported by the printer. hth + regards C-Box
  3. It seems that you have set IGNORE PAGINATION somewherere? Normally if a SubReport is larger than the parent PageHeight of MasterReport then it breaks the parent report and a new page is generated. So take a look at the MasterReport properties. hth + regards C-Box
  4. You could create a (dummy)group per each subReport with a static groupexpression "Sr1", "Sr2", "Sr3"... and so on with the flag "StartOnNewPage" to let each SubReport start on a new Page. Then put your SubReport into the groupheader bands instead of the detail (where you have probably placed it now) Not tried, but should actually work. Otherwise a PageBreakElement after each of the first 4 consecutive SubReports in detail band could also help ;-) (but if the last subreport doesn't render any data, you will have an empty page probably, that isn't wanted, correct - also if some between won't render data) Alternativly you can pass a "hidden" SubReportParameter "DoPageBreakBecauseOfMasterCall" with value Boolean.TRUE" to each SubReport and in each SubReport you place a PageBreak Element into the Summary with PrintWhenExpression $P{DoPageBreakBecauseOfMasterCall}. So many ways are leading to Rome ;-) hth + regards C-Box
  5. Looks that you are using a VARIABLE.... this could have another calculation time... so if you use it in header bands they are probably null. Try to change the EVALUATION_TIME at your Textfield to something other than NOW.... e.g. to REPORT..... (depends on what your variables are doing) But also caution: The PrintWhenExpression at the TextField is always interpreted ADHOC (so now).... so be aware when using variables in PrintWhenExpressions... especially in PAGE_HEADER / GROUP_HEADER bands! hth + regards C-Box
  6. if you use some BigDecimal types for your measures you must be aware of the RoundingMode and the expected scale. ... eg following divides by 3 and rounds half up and set the scale to 2 digits after the decimal separator: $V{CORN1_MEASURE}.divide(new BigDecimal(3), 2, BigDecimal.ROUND_HALF_UP);[/code]Be aware that your measure isn't null.... otherwise make a simple If-Then-Else Check before: $V{CORN1_MEASURE} == null ? BigDecimal.ZERO : $V{CORN1_MEASURE}.divide(new BigDecimal(3), 2, BigDecimal.ROUND_HALF_UP);[/code]hth + regards C-Box
  7. You're welcome - fine that it is working now! regards + have a nice day! C-Box
  8. Hmmm something you are doing wrong... I just created a test with the EXACT suggested expressions by my first post: Works like a charm: see JRXML attached. hth + regards C-Box
  9. The javaflow version is IMHO (!) just needed when you can't use threads (e.g. in some J2EE environments or wherever it's forbidden to create new threads). So if you are not in such an environment you actually could use the normal JasperReports.jar.-... But I doubt that this is the solution... I think the problem is somewhere else in your designs... I guess there are some forbidden SubReport calls on bands that can't overflow or some wrong stretching types, print-repeated stuff or even some recursive usage of wrong subreports?!?! You should investigate some more time to track down the causing error. hth + regards C-Box
  10. Well sometimes I also needed some results from the generated report back in my calling (java)application. So there are several ways to do that. First you can create a scriptlet class where you implenent the different methods to collect some values in your scriptlet class. (e.g. some sums or some averages from total summary band or whatever). After the report is finished with the fill process you can reuse the scriptlet object to do some further work. Second approach I've sometimes done is to parse the generated JRPrintObject (you can iterate through all pages, through all elements) and can get some values from special fields or whatever -> just mark them with unique keys or url anchor expressions or whatever else). So this is also quite a simple way to get something back from your report. Of course you can also use some Exporters (CSV/EXCEL/TXT/....) to get the data back in a programmatically way to interprete them further. So nothing is impossible... the limit is the sky ;-) hth + regards C-Box
  11. All subreports should have position type set to float and be placed below each other. Than it will automatically break pages. Hth + regards C-BOX
  12. If you use the query as report query than don't put the table in detail band but instead into the summary band. If you use a subdataset than also be aware what you are using as report query and where you place that table component. The detail band is rendered per main query result record. Hth +regards C-Box
  13. Do you use the table component or do you just "simulate" a table with normal labels and textfields in detail band? Regards C-Box
  14. You won't need any external library nor a scriptlet or tools class..... Here an quick and dirty solution 1. Create a report variable e.g. named "DayAsInt" that just returns the day of the month as Integer with that as variable expression (just to shorten the next step a bit): Integer.parseInt(new SimpleDateFormat("d").format(new java.util.Date()))[/code]2. Create a second String variable e.g named "OrdDay" with that as variable expression (looks complex but is just a simple If-Then-Else concat way): $V{DayAsInt} == 1 || $V{DayAsInt} ==21 || $V{DayAsInt} == 31? $V{DayAsInt}+"st" : $V{DayAsInt} == 2 || $V{DayAsInt} == 22 ? $V{DayAsInt}+"nd" : $V{DayAsInt} == 3 || $V{DayAsInt} == 23 ? $V{DayAsInt}+"rd" : $V{DayAsInt} + "th"[/code]In your textfields you can now use that second concated String variable $V{OrdDay} of course the charme of a tools class would be easier for reuse that logic in multiple reports without defining those two variables again... but for a first quick-and-dirty way it probably works :-) Hth + regards C-Box
  15. you mean to get the number of your resulting String??? .... something like Integer.parseInt(new SimpleDateFormat("d").format(new java.util.Date()))[/code]?? regards C-Box
  16. Well it depends where your get the information from... so from a global parameter at report runtime or from a field at record level.... So my first idea would be to make your FormatterTools doing the work (just pseudocode here:) /** * returns just a pattern depending on the currency */public static String getPatternByAnySpecialCondition(String yourCurrency){ if ("€".equals(yourCurrency)){ return "###,###.## €"; // Euro } else if ("¥".equals(yourCurrency)){ return "###,### ¥"; // Japanese else{ return "###,###.## "; // Default }}[/code]and at your Pattern Expression you can call that method e.g. YourSpecialCurrencyFormatter.getPatternByAnySpecialCondition($P{YourGlobalCurrencySymbolSetAtReportLevel})[/code]or at field level YourSpecialCurrencyFormatter.getPatternByAnySpecialCondition($F{YourCurrencyFromAFieldInResultSetOfCurrentRecord})[/code]of course you could also create a method to convert your whole BigDecimal field according to correct symbols and currency as well using the correct locale and so on ( http://tutorials.jenkov.com/java-internationalization/decimalformat.html ) ... so just give it a try what fits best your needs. hth + regards C-Box
  17. You can use any expression for the pattern.. either a fix one or also a pattern-expression that could be dynamic. With a small scriplet or a static ToolsClass you can even create something like this as a static method call: YourSpecialCurrencyFormatter.getPatternByAnySpecialCondition(...) [/code]that just returns a String for the currency pattern. (e.g to include some static string into the pattern like this "###,##0.## €") Also the textfield (expression) itself can so changed dynamically depending on some other fields/variables/parameters or whatever, without using the textfield pattern. hth + regards C-Box
  18. Out of the ScreenShots I can't see the problem... perhaps you can post the jrxml itself, so that I can see the attributes of all (other) elements inside the band. regards C-Box
  19. StretchWithOverflow is the correct way... but you shouldn't set any other StretchType... a common mistake is, that people set this to something like "RelativeToTallestObject" or something like that... so this could cause strange behaviours with self stretching textfields. So all fields below that "StretchWithOverflow-TextField" should also have PositionType set to float to not overlap each other. They will then moved forwards so that the stretching text will displayed correctly. hth again + regards C-Box
  20. What about using the month numbers as category and just use an expression for the category labels? (e.g. new SimpleDateFormat("MMMM").format(java.sql.Date.valueOf(LocalDate.of(2019,$F{YourMonthNumberField},1))) [/code]So this will probably sort chronological but render the month names. ;-) hth + regards C-Box
  21. What about using wildcards in your cp parameter? https://stackoverflow.com/questions/219585/including-all-the-jars-in-a-directory-within-the-java-classpath I would put all needed jasper and external library jars into one subfolder "lib" and just use the wildcard syntax to include them. Which jars really needed depends on what you are doing... if you want to export to excel you would need apache-poi libs as well... if you want to export to pdf you will need itext... so it isn't really defined ... a minimal set of libs are listed here for example: https://stackoverflow.com/questions/25069522/jars-needed-for-jasperreports hth + regards C-Box
  22. Well, the problem is, that PageFooter Bands are STATIC bands... so they can't stretch itself depending on some content. So this is a normal behaviour and not a bug. Imagine a dynamic pagefooter could cause an infinity loop, when the content causes the pagefooter to increase to a height larger than the page height itself... so you shouldn't use PageFooter Bands for your purpose. Once defined as (e.g.) 100pixel in height, the page footer will use this space at each page and the usage height for other bands is PageHeight -100px. You could use some some (dummy) group footer bands and use their footer position type (e.g. stack at bottom). Just put your first "dynamic" frame into GroupFooterBand1 (you should set the PrintWhenExpression then to the whole GroupFooterBand) and the second element/frame into GroupFooterBand2 (or if that element should always appear, then you could use of course the normal static page footer band for the second element as well) Should work (as I've done something similiar some years ago in a customer project, but can't access the sources/jrxmls unfortunately) hth + regards C-Box
  23. Perhaps you should try to translate your question to english... when I use GoogleTranslate from your (probably) Portugese to (my) German language it's quite hard to understand what your real problem is, as even in 2019 the automatic google translation isn't really made for such technical content! :-O regards C-Box
  24. Ok... so "SUBTIRID" it is on SubReportParameters... and what about the ReportParameter in the SubReport (the sub jrxml) itself? There it must have the SAME name (caseSensitive!) as in the parent SubReportParametersMap..... is this so? Otherwise you could perhaps attach your jrxmls regards C-Box
  25. Uiii to lay fields above each other and to print it on different printWhenExpression scenarios is one ... but IMHO the last solution that I would suggest. The more complex a report is/becomes, so more difficult it will become to maintain it with overlayed fields..so my experience! So using a style is actually a good Idea... the conditional expression can also be on a parameter and not only on a field or a variable. There you are quite flexible. What happes if you add a new style? You said "crashing" ... Why can't you update to the latest JasperSoftStudio (and set the compatibility to 6.3.1 if needed explicitly)? hth + regards C-Box
×
×
  • Create New...