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

lucianc

Members
  • Posts

    5,609
  • Joined

  • Last visited

  • Days Won

    4

 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 lucianc

  1. Check the subreport sample in the JR distribution (or online at http://www.jasperforge.org/images/documentation/jasperreports/samples/MasterReport.jrxml) to see some examples of returning values from subreports. If you want to sum the values returned from the subreport, all you need to do is to specify the calculation type: Code:<returnValue ... calculation="Sum"/> HTH, Lucian
  2. If the subreport and the text field in which you're using the returned value are placed on the same band, you need to set evaluationTime="Band" for the text field. HTH, Lucian
  3. Currently the logged-in user is always saved as the owner of the job. When the job will get executed, the authentication will be performed with respect to the job owner (e.g. if a resource needs to be accessed during the job execution, the job owner is checked to have the permission to read the resource). Therefore the job owner needs to be a user registered in JasperIntelligence. Would this hold for your "user1", or would "jasperAdmin" be the only registered user? Also, in which way are you including the username in the generated report? Is it via the "LoggedInUser" parameter? Regards, Lucian
  4. Your hyperlink expression should be Code:"http://localhost:8080/myapp/subreport?emp_id=" + $F{emp_id} HTH, Lucian
  5. This is a class loading problem in iReport. What happens is that iReport uses one class loader to load the data source provider class and obtain the data source instance and another class loader to fill the report. Because of this, the value of the $P{REPORT_DATA_SOURCE} parameter is an instance of the TestDataSource loaded by the first class loader, and the expression tries to convert it to the TestDataSource class loaded by the second class loader. Hence the ClassCastException. You should follow this up on the iReport forum. I'll also let Giulio know about this. On an unrelated matter, I've noticed this in your report: Code:<dataSourceExpression><![CDATA[$P{REPORT_DATA_SOURCE}]]></dataSourceExpression> This is something that should not be done (unless maybe in really exotic cases). A data source cannot be reused by multiple report execution (and a subreport instantiation is equivalent to a report execution), because the data source is iterated on and the rows it produces get exhausted while the report is executed (you can compare with a java.util.Iterator). You need to create a fresh data source for every subreport instantiation. Regards, Lucian
  6. Are you using the same data to fill the report in iReport and JasperIntelligence? The error is data-related, it's caused by a null key being passed to the pie dataset. What I've also noticed in your report is this: Code:<parametersMapExpression><![CDATA[$P{REPORT_PARAMETERS_MAP}]]></parametersMapExpression> Although I don't think this is related to the error you posted, you should never do this as the parameters map you pass to a subdataset or subreport will be altered and you don't want to do this to the master report's parameters map. HTH, Lucian
  7. This functionality is not present in JasperServer. In which way do you intend to use the exported files? Do you need to access them via the web gui or would the files be accessed only directly on the server file system? Regards, Lucian
  8. Simple recurrence only supports fixed time intervals, and a month is not a fixed interval. You'll need to use calendar recurrence for this. HTH, Lucian
  9. Currently in JR a subreport is simply an independent report which is embedded into another report. This paradigm was chosen when subreport were introduced in the engine so that the maximum amount of existing logic and code would be reused. Binding a report to a subreport element is only done at run/fill time. This allows full flexibility, although in most of the cases the flexibility is not required and the subreports could be statically resolved at compile time. The features you suggest would, indeed, ease the resource management and deployment effort. The feature request list is always open: http://jasperforge.org/sf/tracker/do/listArtifacts/projects.jasperreports/tracker.feature_requests Regards, Lucian
  10. Could you try to perform a JR build without the Javaflow instrumentation? This way we would be able to tell whether the problem is related to the Javaflow code instrumentation. All you need to do is to get the sources, edit build.xml by commenting out the "javaflow" task inside the "compile" target, and run "ant clean jar". You would find the newly built jar under the "dist" folder. Regards, Lucian
  11. Code:<parametersMapExpression><![CDATA[$P{REPORT_PARAMETERS_MAP}]]></parametersMapExpression> Never do this, the map you provide via parametersMapExpression will get altered by the subreport and passing the master report's parameters map this will have unexpected consequences. If you want to pass all the parameters from the master to the subreport, you should do Code:[code]<parametersMapExpression><![CDATA[new HashMap($P{REPORT_PARAMETERS_MAP})]]></parametersMapExpression> HTH, Lucian
  12. Usually this kind of issues are caused by mismatch between Java and PDF fonts. Ideally, the Java font (specified by fontName) and the PDF font (pdfFontName) should resolve to the same physical font. Otherwise, text field heights, which are calculated at fill time using the Java font, would not match the height of the text produced by the PDF exporter. AWT uses a default font when a specific font is not available to the JVM. Is the "Times New Roman" font available in the Linux JVM? HTH, Lucian
  13. If you have two row groups A and B, you can obtain an extra row header that repeats for each B entry in one of the following ways: 1. Create a new group X between A and B having the same bucket expression as B. The header for the Y group would repeat for each entry in the B group. 2. Create a new group Y after B having a constant bucket expression (e.g. a fixed String). Again, the header of the Y group will repeat for each entry in the B group. I'm not able to understand what kind of an alignment problem you have. Can you be more specific? What are the label headers and the data of the row group? Whose width changes and where (HTML export, PDF export, etc)?
  14. Yes, you need subreports to render such master-detail reports. A subdataset can be used to iterate data outside the master dataset, but it can only be connected to a chart or crosstab and not a report-like layout. HTH, Lucian
  15. When you pass a data source to a subreport, the entire data source gets exhausted (i.e. all the rows are consumed), not only the first row in the data source. Your data source is the map vector, therefore the subreport would consume the entire vector, not just the first map. You need to pass a fresh data source each time the subreport gets instantiated. For example, if $P{SubreportData} is a collection of maps, you can create a new data source based on it for each subreport instantiation: <dataSourceExpression>new JRMapCollectionDataSource($P{SubreportData})</dataSourceExpression> The alternative I mentioned was to rewind the data source for the subreport in the scriptlet (that is, if your data source is rewindable). For example, if you provide the data source for the subreport using a parameter named "SubreportDataSource", you can do the following in the report scriptlet's beforePageInit() method: ((JRRewindableDataSource) getParameterValue("SubreportDataSource")).moveFirst(); HTH, Lucian
  16. You can use the header of the second row group to print both the first group label and the second group label (by simply using two text fields). If you want it to look like two separate cells, you can draw a vertical line inside the row header. Another option would be to create a dummy row group with a constant expression and use its header to display the first group label. HTH, Lucian
  17. I see that you want to show the number of crosstab rows and columns outside the crosstab. There is no straightforward way to do this, but it still can be achieved. For example, you can use a java.util.Map object to return these values from the crosstab. More specifically, you can do something like this: - create a java.util.Map variable "CrosstabReturnMap" having calculation="System" and new java.util.HashMap() as initialValueExpression - pass the map to the crosstab as a parameter: <crosstabParameter name="ReturnMap" class="java.util.Map"> <parameterValueExpression><![CDATA[$V{CrosstabReturnMap}]]></parameterValueExpression> </crosstabParameter> - in the crosstab row and group headers, put the current row/column number in the map using a dummy expression: $P{ReturnMap}.put("Rows", $V{ROW_COUNT}) - in the text element, extract the values from the map: $V{CrosstabReturnMap}.get("Rows"). Note that if the text element is placed on the same report band as the crosstab, you'll need to set evaluation="Band" HTH, Lucian
  18. This error usually occurs when you're trying to export an empty report. To avoid it, check the number of pages in the report before exporting. HTH, Lucian
  19. I'm not familiar with all the details regarding POI and JExcel, but I guess you can find a comparison somewhere on the web. There are differences, for instance POI generates Excel 97 spreadsheets while JExcel produces Excel 2000 spreadsheets. Anyway, this is completely irrelevant here, as (if I understood correctly, which I begin to doubt again) you are using JRCsvExporter, which is a simple text exporter and has nothing to do with POI or JExcel.
  20. Unfortunately, there is no such sample. But it is the same principle as for charts, so by looking at the chart sample you can easily adapt it for a crosstab. And again, using subdatasets with groups for crosstabs is not very common since you can do all the grouping and summing inside the crosstab itself. Why do you think you need subdataset groups for your crosstab?
  21. So the JRCsvExporter prints "4/feb" when the report contains a "4-2" text. This is very weird since the CSV exporter does not contain any logic to do such a processing. Are you using the "vanilla" JasperReports library, or a modified one?
  22. Could you check that you only have one JExcel jar on your classpath? Or maybe the common.Assert class is part of another jar in your classpath. HTH, Lucian
  23. If I understood correctly, you're exporting a JR report to XLS and then using an Excel application to export the XLS to CSV. Am I rifht? You message is a little confusing (are you exporting the JR report directy to CSV, or to XLS?). If I'm correct, I think the behaviour is due to the configuration of the Excel client. If you have the same libraries on all the machines, I don't see how the exported XLS files would be different. Also, what happens if you type 4-2 on an empty cell in the exported file and then export to CSV? Regards, Lucian
  24. Could you clarify what are you trying to achieve? More specifically: - What do you mean by "number of rows returned"? I guess it's the number of rows in the crosstab, but does it include total rows or only detail rows? - Where exactly do you want to display this number ("last page of the crosstab report" is too vague)? Is it inside the crosstab (in the grand total row), or outside the crosstab (in the report)? Regards, Lucian
  25. Subdatasets are able to group the rows coming from their data source into groups and compute totals per group. Subdatasets can be used both for crosstabs and for charts. Defining a group in a subdataset makes more sense for charts, as crosstabs can perform bucketing/summing on its own. Also note that in some cases (e.g. SQL query result data sources) you can perform the grouping and summing in the data source of the subdataset, while in other cases (e.g. CSV or bean data sources), you can't (you need to write custom data sources to group and sum the data). You can see a chart using a subdataset in demo/samples/charts/SubDatasetChartReport.jrxml HTH, Lucian
×
×
  • Create New...