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

amongalen

Members
  • Posts

    11
  • Joined

  • Last visited

amongalen'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. Lets assume this situation: On my report I have 40 different text fields (some display Fields from query, some are Variables). Those are some prices. Here are some requirements: If given prices is negative I'd like to color it red. For prices I don't really want them to wrap when overflow. Instead, I'd prefer the font size to decrease so the whole number fits in a single line. For simplicity lets say that I change only between 3 different font sizes. Those two requirements result in 6 different cases. What is the best solution in this situation? I know there are conditional styles but from my understanding they can't be really generic, I'd have to write a conditional style for every field I have, resulting in 40 styles with 6 variants each. Other option would be to use markups inside of the text field's expression. However, given how ifs are handles in field expression (you kind of have to use ternary operators), it will get overcomplicated with 6 different cases - even worse if the displayed value itself is something more complicated. What is more, if you use markups you will lose number formatting set on a field (it turns BigDecimals into String) so you would have to add it to the inside of the text field expression as well. Last method I can think of is to multiple version of a given field, one for each formatting option, place them all on each other and display only one. This would result in 240 text fields instead of 40. Both first and third options are kind of viable but at the same time would require a lot of work and will be hard to maintain later on. What is the best approach to this problem? I've seen multiple question on this topic but not a single one with any good solution.
  2. I've created a very simple tabular report. I'd like to use it to export some data to excel/csv. As most users export data to excel just so they can analize them easily it is important to me to be able to create a table in excel using this exported data. To achieve that after exporting data I press ctrl+A to select all and then ctrl+L to create a table. This results in a nice table with options to easily sort and filter data. However, for some reason by default I'm not able to change style of the whole table (in Excel). It looks like all cells have some weird style set that overrides the table style. If I manually set cell style to "normal text" for all cells then table style starts to work. I think I've tried every possible settings configuration possible. Currently I have the following properties set when it comes to xls: <property name="net.sf.jasperreports.export.xls.detect.cell.type" value="true"/> <property name="net.sf.jasperreports.export.xls.font.size.fix.enabled" value="true"/> <property name="net.sf.jasperreports.export.xls.ignore.cell.background" value="true"/> <property name="net.sf.jasperreports.export.xls.white.page.background" value="true"/> Am I missing some setting?
  3. It is a nice option. However, I don't think it provides all the functionality I need. I'd like to remove report/group header/footers while at the same time display some of the data from them for each record. E.g: I have some goods in different warehouses. I want to group it by warehouse ID. While exporting to PDF I want to have warehouse name/ID/address displayed in the group header and for each warehouse display all goods stored in it. Then when I export to XLSX I'd like to have all this information displayed in each row. This way it would be much easier for the user to analize the data, create some charts etc. I can achieve this reasult using CSV metadata exporter (I guess it works the same for XLS one) by simply setting the net.sf.jasperreports.export.csv.column.name and net.sf.jasperreports.export.csv.repeat.value for fields I want to keep. However, some of the users have a lot of data so XLS with its limit isn't enough. Generating CSV and then manually importing it in XLSX isn't an acceptable solution either. A workaround I can think of is to create another report with much simpler layout containing elements I want to export to XLSX only and then switch in runtime which one to generate.
  4. Hello, In my project there is a need to export reports to excel. While standard XLSExporter is really nice, we would like to have plain tables without headers/footers. From what I can tell there is a JRXlsMetadataExporter which would fit perfectly for that. However, based on my tests, it exports to the old Excel format XLS, not the XLSX. The main problem is that it has a row number limit of 65536 which is quite low, while XLSX has a limit of 2^20 (just over 1 million) Sadly I wasn't able to find an equivalent exporter for XLSX. Does this exporter support exporting to XLSX as well? Do I have to set some flag for it to happen? Btw. I'm not sure if it would actually be needed but is there an option to export to multiple files if report doesn't fit into a single XLS/XLSX file?
  5. Interesting... I think I've found another bug. It is not possible to edit data adapter's properties inside of JasperSoft Studio. I mean using "DataAdapter Editor" to be precise. For some reason it doesn't let you save the changes if you haven't changed anything else. What is more, it depends on how you've created the data adapter in the first place. If it is visible in the "project explorer"/workspace it doesn't work. But if it is in the "repository explorer" it seems to work just fine. @shertage I've tried it earlier but for somehow changes weren't applied (because of the above mentioned bug). Now I've made sure the changes are saved and indeed it works. Thanks for help. ps. why there even are "two types" of data adapters? Ones in "project explorer", others in the "repository explorer".
  6. I've done some futher testing. I've tried to run the exact same report using JasperReports Library from Java. When I launch the report with default connection properties it doesn't work (no data). However, setting "AutoCommit" to "false" seems to work. Is it possible to set AutoCommit to false for a data adapter in JasperSoft Studio? When configurating the data adapter there is a "Connection Properties" tab. What are the viable properties? I wasn't able to find any info anywhere.
  7. Here is my situation I got a stored procedure that prepares data for the raport and puts it into a global temporary table. What is important, this temp table is "ON COMMIT DELETE ROWS". Then I got my main procedure that is called from the Jasper report. As a parameter it takes a ref_cursor. First, it calls the other procedure. Immediately after that the cursor is opened for data from my temp table. I've tried to call that exact same procedure in SQL developer and it works just fine. However, when I use it in the Jasper report, there is no data returned. I've done some testing and it seems that changing temp table to "ON COMMIT PRESERVE ROWS" makes it to work. However, I don't want to change the type of the table because some other things could depend on that table. It seems to me that for some reason Jasper performs a commit just after the query (procedure call in this case) and before using data from the cursor so it gets removed from the cursor as well. Is there some other solution? Am I missing something? Maybe the problem is somewhere else?
  8. I got a report that contains a subreport. In the subreport I want to display some footer info including page number and total page count. In the master report I got a group. I'd like the total page count to reset for that group with "isResetPageNumber" attribute. Is it possible to use isResetPageNumber (in the master report) and display total page count in the subreport? The build-in variable master_total_pages doesn't reset for each element of the group. Is there any way to achieve that or do I have to display the page count in the master report?
  9. Hello I've got a Java application that uses JasperReports Library to compile and fill reports. In some of my reports I got some scriptlets I'd like to call. Using them in JasperSoft Studio is rather straightforward. When I try to fill a report containing scriptlets from Java app I get following error: Which is to be expected, because I didn't specify anywhere where the class is located. I've tried to add the scriptlet jar as a library to that Java project and it kinda works. The problem is I'd like to be able to add scriptlet jars at runtime, e.g: load all that are in the xyz folder. In my project I'll have hundreds of reports, many of them will have to use scriptlets. Adding them as a library everytime someone creates a reports isn't an option. Is there some way to load scriptlet class/jar from Java at runtime?
×
×
  • Create New...