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

cmatthews

Members
  • Posts

    57
  • 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 cmatthews

  1. What you are asking about is possible with jasperReports. It's a failry complicated scenario to understand based on the amount of information in your post but it sounds completely doable. Personally I approach this sort of thing with a base report, lets say a report called "REPORT_SELECTOR.jrxml" ... The report selector report will do a base query against your persons and letter type and will call in the appropriate subreport. If you have 5 different letter types then you would have 5 possible subreports that could dynamically be called by the parent report. I will put two samples in the cobe block for you as ideas, the first code block is sample SQL from the "REPORT_SELECTOR.jrxml", the second code block is the subreport object subreport expression. The samples obviously will not fit your need exactly but should give you ideas to do what you need. In my case the parent report has a 1px tall detail section and the only thing on the report is a subreport element. The full page reports are called by the subreport element and I can mix and match reports into a single PDF output. Hope this is good food for thought, Good luck Clark Code: Post Edited by cmatthews at 09/16/2012 17:35
  2. Yes, many ways to do this sort of thing ... Hard to say exactly where you would want this "if" block but a common place for it would be in the band "Print When Expression" ... Something like this... If the value was not equal to zero then the section would be hidden... Your question is very open to many different answers. But I hope this helps.. Code:new Boolean({yourParameter}.intValue() != 0)
  3. I think you need something more like the one of the samples in the code block I provided, Good luck, Code:new Boolean( $F{ELAPSED_MINUTES}.intValue() > 3 && $F{ELAPSED_MINUTES}.intValue() < 5 )Although, this looks more like it may be okay if,new Boolean($F{ELAPSED_MINUTES}.intValue() == 4)However either may work...
  4. A way of doing it... Showing how performing a calc against a variable of one type results in a total of another data type. ($V{SUM_Sales}.equals( new BigDecimal(0))) ? new Double(0) : new java.lang.Double( ($V{SUM_Discount}.doubleValue()) / ( $V{SUM_Sales}.doubleValue()) )
  5. The report element for page/column breaks is "Break", when you put it on the page it will ask you which type you want to use. In older versions, like 3.0, there isn't an element you just need to put the break in the xml yourself.
  6. Hard to tell exectly because I don't have your data sources but when I look into the subreport query I see a couple things that are likely to be the problem. Like this, and CASE WHEN $P{job_number} = 0 THEN j.id > 0 ELSE j.id = $P{job_number} END All the parameters you want used in the query need to be $P!{job_number} ... having the ! (bang) ... I notice you have some with the bang and some without. The ones without are not being replaced with an actual value. Hope this helps, Clark
  7. You should be able to add the [] to the end after you select it as the data type. I'm not sure about the list data type... don't use it much.
  8. One idea on this is to use a multi axis chart and use different subdatasets/queries on the embedded charts. Create your queries in such a way that you create sales ranges for the resulting stores. first chart would have stores sales that range from 0 to 10000, second would be from 10001-20000, etc, etc, ranges based on whatever would produce a good quality chart increment. Each of the charts could have different tick. You could choose to show or not show the tick values to keep it less messy and create your own range legend manually. The chart customizer class property is another approach, but I haven't use it yet. Hope this helps,
  9. Anytime I need entire bands to collapse when no contents I use report groups. You can made the band height 1px and supress when not needed. If you don't know if the band is needed or not you may be able to use subreport return value to determine. Hope this helps,
  10. Can you do it in the query with case statements and/or coalesce? Just collapse it down to the left first then the columns to the right will be the blank ones.
  11. This works as a variable class type java.lang.Integer[] or java.lang.String[]. In the expression you can parse or build out arrays, add to them, use the object.split(",") to populate the array, etc. Hope this helps,
  12. Just as an idea, I have made dynamic column headers using subreports for the column headers.
  13. See this related post, http://community.jaspersoft.com/questions/543494/unwanted-merged-rows-excel-export I have been using Jasper Reports for 5+ years now and haven't found a solid way to directly deal with this, work arounds are your best bet I think.
  14. This is a very standard need .. Not sure what is throwing you off but I have attached a working sample with the output in PDF and the JRXML, hope this helps you. Good luck. Clark Matthews
  15. Don't use if in the select, this "if C6CLIEVT."DATE3" <> NULL" should be more like this "CASE WHEN C6CLIEVT."DATE3" IS NOT NULL " Nested case statements should be fine.
  16. Add "report groups" as bands to your report. Use the group footers for each of your sub report pages. After the first group use the option on the subsequent groups for "Start on a new page" ... The page breaks w/report groups should be able to get you what you need. If you had a sample with dummy selects or some sort of basic sample you upload then I may be able to try and help "fix" it a bit for you so you can have an example. Good luck though.
  17. Yes this is a common difficulty in excel output formats. In my custom reporting platform that uses jasperreports I eventually added CSV as an export type and have users use CSV for any reports that pose a problem in the cell merging. That said, there are a few ways to mitigate the issue. We also support different templates for each export format in our application, so if the user wants to generate the report in CSV/XLS/PDF/HTML each of these formats has it's own internal reference to a different template entirely. In the XLS templates we hide report titles, make sure there isn't even a pixel of space between columns, and no elements which overlap in the headers and footers, if everything lines up perfectly in your template then the XLS output is nice and clean. Otherwise ... as I said ... CSV just works better.
  18. Try this on the field you want to only print conditionally ... In the "Print When Expression" new Boolean($F{myField} != null)
  19. Easy to do this in SQL and just have a subreport with the summary information. If your data source isn't SQL then maybe something like this would help. $V{countOfSP} $V{countOfRJ} Now you have a variable expression where you set the resulting value of the variable to either 0 or 1 based on the rows value. Put this code in the $V{countOfSP} variable and place it on the row (set the print when expression = Boolean.FALSE so it doesn't ever show this on the report) ($F{state}.equals("SP")) ? 1 : 0 Then create a sum variable in the appropriate summary band as needed for each of the countOf##### variables. Should result in a sum represending the count of each type, once you have that you can format it in output however you like. Just for a little more clarification, each one of the variables "countOfSP, countOfRJ" etc should have the appropriate equal check, $V{countOfSP} with expression = ($F{state}.equals("SP")) ? 1 : 0 $V{countOfRJ} with expression = ( $F{state}.equals("RJ")) ? 1 : 0 In the bottom of the report your sum's should be good to just layout howver you like. Hope this helps, Clark
  20. I get what you mean, but would it work if you assigned the parameter $P{FromDate} a default value of an empty string "" and then you know what to expect when it has not been populated or selected. ($P{FromDate}.equals("")) ? "This" : "That" This way you don't need to worry about the default state of the object, you know it will either be an empty string or a date. So long as the paramters that refer to it are defined after it. The sequence/order of parameters and variables in the definition is important. Hope this is helping. Clark
  21. First of all in your query you would need to be using $P!{FromDate} The exclamation is required for the query. I think there are a lot of ways to accomplish what you are trying to do but here is one idea. Make the default value of FromDate be a known date in the future that would not be reported against like "'2199/01/01'", then check in your query if from date is equal to that date, something like this in sql server, If $P!{FromDate} = '2199/01/01' BEGIN SELECT blah,blah,blah FROM blahContainer END ELSE BEGIN SELECT etc,etc,etc FROM etcContainer WHERE dataDate BETWEEN $P!{FromDate} AND $P!{toDate} END
  22. I'm pretty sure you could use the pattern object and a regular expression string.replace() ... If you look up regular expression for groovy or java to do this you should find plenty of options.
  23. Generally speaking, Blue = good position Green = overlap but if you insist it's okay to have that (some output types may not show the field), PDF is okay with overlapping fields but HTML isn't, stuff like this. Red = It will not work This is my own translation but it's relatively accurate.
  24. Couple ways you may be able to solve for this one, The seperator line options support print when group changes option may help if you are using groups. Or simply use the "Print When Expression" and set it to true when you are not on the last line and false when you are on the last line. Something like this in the expression, new Boolean($V{COLUMN_COUNT}.intValue() != $V{REPORT_COUNT}.intValue()) You should be able to do something like this, you may need to use custom variables for the record counting depending on how your report is designed. But this is the right direction to go I believe.
  25. I am attaching some sample code I comonly use to set options for better XLS output support. This is from jasper 3.51 so it may differ a bit in later versions but should guide you in the right direction. Clark Code: parameters.put(JRParameter.IS_IGNORE_PAGINATION, Boolean.TRUE); JasperPrint print = JasperFillManager.fillReport(report, parameters, mrConnection); JRHtmlExporter exporter = new JRHtmlExporter(); exporter.setParameter(JRExporterParameter.IGNORE_PAGE_MARGINS, Boolean.TRUE); exporter.setParameter(JRExporterParameter.JASPER_PRINT, print); exporter.setParameter(JRExporterParameter.OUTPUT_WRITER, out); exporter.setParameter(JRHtmlExporterParameter.IMAGES_MAP, new HashMap() ); exporter.setParameter(JRHtmlExporterParameter.IMAGES_URI,"/jasperImage?image="); exporter.setParameter(JRHtmlExporterParameter.IS_USING_IMAGES_TO_ALIGN,Boolean.FALSE); exporter.setParameter(JRHtmlExporterParameter.IS_REMOVE_EMPTY_SPACE_BETWEEN_ROWS,Boolean.FALSE); exporter.exportReport();
×
×
  • Create New...