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

tmagalhaes

Members
  • Posts

    14
  • Joined

  • Last visited

tmagalhaes's Achievements

Apprentice

Apprentice (3/14)

  • Week One Done
  • One Month Later
  • One Year In
  • First Post Rare
  • Collaborator Rare

Recent Badges

0

Reputation

  1. Ok, ended up being able to work around the issue. Since I know the 3 fields will be unique for each bucket I want to print, instead of bucketing on a single field I defined the group expression as String.valueOf($F{CODE_ASDF}) + "~" + String.valueOf($F{DESC_ASDF}) + "~" + String.valueOf($F{CALC_ASDF}) and in each of the fields where I wanted to use a value $V{GROUP}.split("~")[0] for CODE_ASDF $V{GROUP}.split("~")[1] for DESC_ASDF $V{GROUP}.split("~")[2] for CALC_ASDF I actually put helper methods to do this stuff in my Scriptlet, but this is the basic idea. A little ugly and not very readable, but it works...
  2. Hello everyone, I'm trying to put together a crosstab report and have to display 3 fields in my row header, a number code, the description corresponding to the code and a second string calculated form the code by the database. The row is bucketed along the code query field and that value I can show in my row header simply referring the bucket name variable. The other two values are the problem. I can't simply display $F{FIELD_NAME} inside the row header since the query fields are not visible in that context. I tried creating Measures pointing to the fields I want with a Nothing calculator, but that simply displays null in every row, instead of the correct values. So, is there any way to produce with the following data table CODE_ASDF DESC_ASDF CALC_ASDF OTHER_QUERY_COLUMNS... 1 ABC FOO 1 ABC FOO 1 ABC FOO 24 X BAR 24 X BAR A report with row headers like this: 1 ABC FOO Crosstab detail cell data goes here 24 X BAR Crosstab detail cell data goes here ? Thanks in advance
  3. I was too quick to post this. Just discovered there is something called isStyleText that should do exactly what I need. Investigating atm. =)
  4. Is there any way to apply multiple text styles to different parts of a textFieldExpression? We have a report with a long Text Field. The textFieldExpression used to calculate the contents of the field uses several different fields to form the complete expression. It's something like "Total number of" + $F{ITEM_NAME} + " is " + $F{ITEM_COUNT} + ".". Since the length of ITEM_NAME can vary greatly and we want it to look like a single sentence we see no better way to lay things out than this. The thing is, we want ITEM_COUNT to be drawn with a bold typeface and the rest of the line without. Is there any way to achieve this with special control characters for example?
  5. We have a bunch of reports with subreports. In the parameter list we are also passing $P{REPORT_SCRIPTLET} as a parameter named REPORT_SCRIPTLET because we want the asme instance of the scriptlet to be used by both the report and subreport. This part is working fine, but we encountered a problem. When setData is called on the scriptlet the first time, the variable/field/parameter maps are set to those of the main report. And also, every time the subreport is ran, setData is called to set those maps to the subreport maps. The problem is that when a subreport returns back to the main report, the maps are not restored to the main report ones. We could code around this if there was any way for a scriptlet to detect that the report finished running. Is there a good way to do this that does not involve adding items to the summary band that evaluate scriptlet methods?
  6. Thanks for the reply. Even if it's not the reply I would prefer getting, it's always nice to have an idea of where things stand. =) Consider this post feedback then. Keep up the good work guys. ;)
  7. A calculation="Percentage" would be somthing very handy to us. Many times we don't want to simply display percentages in the reports but also use the values of those percentages as a base for other calculations. Took a look at the Jasper source code and I see all the supported calculations calculate their result line by line and don't require values that will only be available at the reset time of the variable. And as such it looks like it's not possible to do a calculation Last or Percentage. Is this model something that you might change? With the way calculations work now, the api to implement new incrementers ends up feeling a bit limited. Something else that would solve this kind of situation would be to add a Evaluation Time property to variables much like the Text Field's. But looking at the source for the JRFillVariable, adding something like this is far from simple, the infrastucture to support this just doesn't seem to be there. So my question ends up being, do you see a good way to promote Percentage calculations to first class citizens in Jasper Reports? When dealing with a vast number of reports, the workarounds needed to properly show and use percentage calculations are quite a pain that we want to try and solve with code.
  8. Thanks, just tried it, and that did indeed produce the correct result. I had ended up moving this calculation to the database, but this is a much better solution, even if a little tricky.
  9. Im trying to migrate a report to Jasper Report. There is one issue I'm having with this migration. The attached picture illustrates the problem. I have 3 columns: The first total is a reference to a field in my query. The second total is the percentage of the first field's value over the sum of all values in that field. I got this second column working by using a report field with Evaluation time = Auto and dividing the field value by the variable used to show the gross total. The expression ended up something like ($F{"Foo"} / $V{"SumOfFoo"}) Now comes the problem, that 3rd column. This column shows the running sum of the calculated percentages. Since these kind of Percentages can't be done at the "data model level" in Jasper and must be deferred to the "presentation level" I can't do a Sum of the calculated percentages. I though about calculating this new column without depending on the values on the middle column, but expression would be something like ($V{"SumOfFoo"} / $V{"SumOfFoo"} with the first having evaluation time now and the second evaluation time group. But of course, I can't set different evaluation times for each part of the expression. Setting it to Auto would of course always give me 100%. So, is this even possible? Thanks for your time in reading this.
  10. Is it possible to get the value of parameters from the filled JasperPrint object? I could look at the JasperReport.getParameters, but that only gives me the default values passed into the report. Our reports have some parameters that get their values from the underlying scriptlet and the optimal solution to our problem would be to peek the parameter value when the report finishes running. An alternative would be to get the JasperPrint object to expose the scriptlet instance. Any ideas?
  11. Hello everyone, We are evaluating JasperServer and wanted to know how feasible it would be to extend the AdHoc editor and AdHoc Metadata format to support the functionality of importing existing (simple) reports into JasperServer and manipulate them like AdHoc reports. The biggest thing we wanted to do with this is to allow the data order to be changed after the report has been exported to JasperServer from iReports. What kind of development effort would we be looking at? How barebones is the metadata? Does it keep any kind of format information at the moment or is it just a report style, query and field mappings? Thanks for your time
  12. Thanks for the replies. Yes, it ended up being pretty simple to do. It was one of those things where I'm used to thinking in different terms. All that was needed was to add a Text Field for each measure in the detail cell, reposition them to sit side by side instead of one above the other and style them with borders to look like "subcells". Same thing for the summaries. Problem solved.
  13. There really isn't a source atm, just assorted tests. My most pressing problem in this case is achieving the table structure showed in the mockup attached to the first post. Yes, will have to do some work with the variables and expressions to get the calculations working, but that is not a part im too worried about right now. Spliting the detail cells and having several summary rows/columns is the issue that I'm finding harder to solve.
  14. We are migrating several reports to Jasper but some issues have come up. If you look the attached file you'll see a mockup of a report we are trying to convert. (The numeric values are not correct, several rows have been omited) My question is simply if such a report can be done in Jasper. It's a crosstab report featuring more than one cell for each detail and it uses more than one cell for each summary, both rowwise and columnwise. A detailed explanation of the report: The detail cell is actually 2 cells, each with a different value. The row summary for each detail is further split also into 2 cells. The first detail column is a simple sum of the row values and the second column is the percentage that row represents in the field's total. (81 is 0.44% of the column's total: 18380 for example) This row summary is the same for both cell details. The column summary is very similar, the row labeled Total is a simple sum and the bottom row is percentage of the column summary into the report grand total. Is this kind of structure possible? If so, how can I achieve this kind of elaborate crosstab? Been trying to figure something out but the Jasper Crosstab component seems very constricting. Any help would be greatly apreciated.
×
×
  • Create New...