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. Have you already tried to toggle the special export property at report level: net.sf.jasperreports.export.pdf.force.linebreak.policy[/code] perhaps that helps!? hth + regards C-Box
  2. You will have to pass the connection or the (custom) datasource by your own if you run the report from withing your own application. The JasperStudio is just a designer tool with preview mode to design and test your report against a database/datasource. It's not made for "end-usage" by a customer or some "stupid/simple" report user. So just create a sql connection with ip/port/user/pw and pass this to the fillmanager in your calling app and pass it to the FillManager. hth + regards C-Box
  3. Be aware that each field that should disappear does not overlap any other field AND that nothing else is on the same line!!! So these are the most common mistakes by using RemoveLineWhenBlank scenarios with "wasted" space. hth + regards C-Box
  4. Where did you set the values? In JasperSoftStudio/iReport Designer options or within your design or in the local properies config-file for jasperreports? If first you can also place the properties into the design (jrxml) file. AFAIK these properties should overwrite the default ones from the jasperreports.properties file in classpath. hth + regards C-Box
  5. If you have a SubDataSet for your chart object you could either: put that chartobject into an own SubReport and use the currently sub query for the chart there as main query. So if that query doesn't return result there is no rendering at all for the SubReport, so also no emtpy Chart will be displayed. ( don't forget to set "WhenNoDataType" to "NoPages" for the SubReport) Otherwise just create a SubSelect (like exists or select count >0) and integrate this into your main query, so that you know in advance if there are some data for the charts subquery. The result of the SubSelect is then usable for the PrintWhenExpression of the chart-element (e.g. $F{SubSelectCountResult4Chart} >0) The disadvantage of that second approach is, that you must define the query twice and that the SubSelect runs for each record of the main query results also. So don't know the query of course but it could be an performance issue. So I would prefer number one with the own SubReport :-) just my two cents hth + regards C-Box
  6. It isn't hard... I started also ~16 years ago from "a green field" and learned step by step with running the sample provided within the full JasperReportsProject zip that is also free for download. The problem nowadays is - don't take it personally - that everbody just want to get full working code instead of developing it by yourself... so remember what "develop" means... not take ready src + compile + run + be happy... it's a process that takes time and is kind of learning by doing ... adapt ideas from other sample code to your own code, read the manual + forum entries... so this is much more efficient to understand how JasperReports is working ... so my personal opinion. So perhaps in few steps : include your report designs (jrxml) in your swing-app-jar or load them dynamically from a file system folder (depends on how you want to deploy your app and if the designs should be changeable at runtime)load your designs with the JRLoader and compile them via the JRCompileManager to a so called JasperReport Object (tip: if the designs are fix, you could also load the .jasper files directly into a JasperReport Object without compiling the designs (*.jrxml))Fill the Report with the JRFillmanager by passing the filled parameters map and the prepared (my)sql-connection (so the connection object must be created before!) to the fill method. You will get an (filled) JRPrintObject from the result of the fill process (or even an empty one, if the query inside doesn't returned results). So you could now open that filled JRPrint object with the built.in JRViewer or you could also export it to a PDF-file or whatever with the JRExportManagerso finally #5: don't give up - I know you wanted sample code... it's at home on my local pc and I think you will manage it also by viewing into the samples provided by JasperSoft also! hth + regards C-Box
  7. Have you set the correct import at report level in jrxml? (e.g. "com.yourpackage.YourToolsOwnerClass" ) When I use my own custom functions within expressions and so on I always had to setup the import within the report design correctly. (but I've never used it within the main query ...unfortunately, so not sure, whether the import could solve your problem) Perhaps it helps regards C-Box
  8. Well imagine you have a main query that iterates through your customer table and collects all customers for the last sales in a year. Now you group the main query by customer name and place a tiny pie chart into the group footer band to display the top10 sold items with an subquery. Then you could do something like this as SubTitle-Expression: "Top10 items for " + $F{customerName}[/code]and then you have an usecase where it makes sense to use the (parent) main-query fields within SubTitleExpression. But you can't use any of the SubDataSet fields from the SubItemsQuery per each customers... as this are probably 10 different ones. So not sure ... but perhaps it's easier just to create an subSelect for your "OneAndOnlyResult" ? hth + regards C-Box
  9. As far as I know the color attributes are just static ones.... so you can't set these to a dynamic value concerning at a parameter or even a field expression. I created a java "PreProcessor" when loading the jrxml (per JasperAPI) and changed the style colors per JRDesignAPI (so e.g. each month could have another color defined by the user. so I created 12 styles per API and set the style background-color to the database value, afterwards I recompile the (changed) design and pass this to the normal fill manager. Works fine for my purose. :-) Perhaps just an idea for your solution (if you also call your reports from a java application) hth + regards C-Box
  10. Hi Dan, I would use a group for the "outer" sales rep and set the flag "StartOnNewPage" to true. So each new grouping expression value will automatically create a pagebreak. For "inner" records you could then use a SubDataSet for a table component or even a subReport. So this is - so my opinion - the easiest way for separating pages depending on a changed value. When I remember right, the table component uses an own dataset, as it iterates itself through the records. You can't mix it with the main query, because then two elements would step through your records. You can use the main dataset in the title/summary band to use it within a table component, so that the dataset will iterate just once. But using it in detail or at group level will cause conflicts while stepping from one record to the next one. hth + regards C-Box
  11. For the total columns you can adjust this at crosstab properties. When I remember right the good old iReport had an assistant for creating crosstabs and also asked whether the total columns should be generated or not. (So I guess also the newer JasperSoftStudio has such an assistant) For hiding a whole data-column it could become complicated. You could changed the bucket expression to an if-then-else expression to ignore certain values for incrementing/count/sums ... but then you would have a "other" columns for the ignored values when I remember right. Perhaps you can define such a "other" column and set the witdth to 0 pixel. But not really sure if this will work - just give it a try. So perhaps another crosstab guru will answer your question hth + regards C-Box
  12. What exact record from the SubQuery should be used for rendering the SubTitle... Imagine you have Top10 Orders by customers in a PieChart... what exact customer name should appear in the SubTitle? The first, the second... all of them concatenated?!??! I guess therefore the SubTitle isn't made and so it uses just the fields by the MAIN Query and not by the SubDataSet-Query. So if you need some of the Results you could perhaps create a ChartCustomizerClass and use the API for manipulating the SubTitle. hth + regards C-Box
  13. I guess you should do so... the htmlcomponent is very very BETA and can't render content that is structured. (or the result is such ugly, that you won't use it) So as far as I know! hth + regards C-Box
  14. Where is the problem - don't understand what the real problem is? If you create a query from a database let's say SELECT id, date, customerno FROM orders and you place each field $F{id}, $F{date} and $F{customerno} into the DETAIL BAND of your jrxmal, then the report will render per record one detail. Let's say 20 records will fit to one page and you have 100 records.... well then 5 pages will be rendered! So this is normal JasperReports is working. If you need some static stuff you can use several "DummyGroupsBands" (a group without any expression)... there it is possible to define x-GroupHeaderBands that are let's say 802 pixel in height (so A4 = 842 - 2x20px for top/bottom margins) there you could place some static stuff independently of your query results. So assume you need 2 full sized pages you could create to groupheader bands (each 802px in height) and place your static stuff inside. (by default the sum of all default band heigths are not allowed to be larger than the page height itself - EXCEPT group headers/footers!) That's the trick! hth + regards C-Box
  15. Why do you add a linebreak "+n" within your TextFieldExpression?? This is causing an empty line after each filled textfield because it increases the actual textfield height. So just remove this unnecessary break and you will be happy. :-) hth + regards C-Box
  16. No problem, nice that it works now! :-) regards from sunny Dresden/Germany C-Box
  17. as this is a boolean flag the default value is probably false.... http://jasperreports.sourceforge.net/api/net/sf/jasperreports/engine/JRElement.html#isPrintWhenDetailOverflows-- I guess this feature is rarely used/wanted and must be explicit set to true by the user ;-) hth + regards C-Box
  18. There is a JRCsvExporter that converts the report result into a CSV. So after filling the Report you could call the Exporter to transform the result into a csv file (be aware to align the fields correctly each other!) I guess this was also available in such an antique iReport version 3.0.0 ;-) hth + regards C-Box
  19. Uii.... the google translate plugin tells me something "strange" about tables and breaking to the right content!?!? The table component stretches itsef from top to down... so not sure if you used it or if you just use some simple lines for "simulate" a table and your fill direction is set to horizontal perhaps!?!? So I have no idea what the real problem is... could you try to ask in english perhaps...I doubt, if there are so many Portugese guys here. ;-) regards from Germany C-Box
  20. I guess you mean the group property where to adjust whether each groupheader band should be repeated at each page? So I guess (!) this is just a simple boolean and by default it is set to "false" !?!? :-) so the default behaviour for groups is, not to print the header at each page... so by default it appears just once at the beginning of a (new) group. Do you want to "predefine" that value to "true" in your designer (JaspersoftStudio/iReport) or why this question? hth + regards C-Box
  21. Can't see any stacktrace from opening a jrxml.... does iReport standalone open (so just run the ireport.exe from the bin directory without opening a jrxml) ?? Do you really need such a old java 1.6? For iReport I always keep an 1.7er Runtime. so need more info to track down the problem regards from sunny Germany C-Box
  22. Don't know your pattern requirement but why it should be 10x so much like before?!?!? So in Germany we have a decimal separator (the comma ",") and a thousands separator (the dot ".") - so vice versa as in java/english countries by default. The number "one thousand" (1000) is represented as string "1.000,00" when I use this as pattern;: "###,###.00" So not sure what you actually want - just take a look here. (https://docs.oracle.com/javase/tutorial/i18n/format/decimalFormat.html) and be aware that your textfield is also passed as BigDecimal/double value from your database query and not as casted string. hth + regards C-Box
  23. Not sure what you exactly want to reach,... but the built-in variable $V{REPORT_COUNT} will always return the current number of "consumed" records of the current report. So if you place this variable into page footer band and set the evaluation time to "NOW" it will return the current number of records (e.g. 10 fits to one page so will get "10" at 1. page... "20" at 2. page and so on. (although there is also a built in variable $V{PAGE_COUNT} when I remember right that does similar counts) If you set the evaluation time to "REPORT" you will have the TOTAL numbers of records even in the first page footer because this textfield will be overriden when the report is finish and the current (=total) numbers of records will be set to these textfields in each page footer. Otherwise you could also create a dummy group (without any expression) and just use the group-footer band... this will be printed just after the last detail (and there you could place any final content with the $V{REPORT_COUNT} variable or whatever you want. The summary could also be used to do some final stuff... there is also a flag to print pageheader and pagefooter with the summary or to appear on a new page as well. hth + regards C-Box
  24. You can define a "MinHeightToStartNewPage" attribute at GroupLevel that could be defined with the pixel height of the group header height itself + at least one detail band height. So the Header wouldn't be printed at the very end of current page, but tranfered to the next page instead. Perhaps this could help you - just give it a try hth + regards C-Box
  25. I you could use a crosstab .... then the crosstab component will create a column per day automatically (but when I remember right, just if you have also a record for each day in your result set), if your query does not return a record for each day you could try to create a CTE table like described here: https://community.jaspersoft.com/questions/541652/example-calculating-holidays-vs-business-days-date-range-not-question hth + regards C-Box
×
×
  • Create New...