Jump to content
Changes to the Jaspersoft community edition download ×

szaharia

Jaspersoft Staff
  • Posts

    16
  • Joined

  • Last visited

Community Answers

  1. szaharia's post in Can we create group dynamically using JasperReport Library? was marked as the answer   
    You need to create and customize a JRDesignGroup first.
    For instance, see the noxmldesign sample shipped with the JasperReports distro: http://jasperreports.sourceforge.net/sample.reference/noxmldesign/index.html#noxmldesign
  2. szaharia's post in Report based on a temporary table was marked as the answer   
    Properties available in "Connection Properties" tab are driver-specific. For instance, if you're using the OracleDriver class, try to set the 'autoCommit' connection property to false (see attachment).
  3. szaharia's post in How can I solve this problem of continuity of a detail (line) in another page? was marked as the answer   
    The following workaround should help: for each textfield in the detail section place an empty frame with borders, having the same x, y, width and height as the textfield. Set isPrintWhenDetailOverflows="true" for the frame:
    <frame> <reportElement stretchType="ContainerHeight" x="150" y="0" width="100" height="30" isPrintWhenDetailOverflows="true"/> <box> <topPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/> <leftPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/> <bottomPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/> <rightPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/> </box></frame><textField> <reportElement stretchType="ContainerHeight" x="150" y="0" width="100" height="30"/> <box> <topPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/> <leftPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/> <bottomPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/> <rightPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/> </box> <textFieldExpression><![CDATA["text content"]]></textFieldExpression></textField>
    Note that the textfield is placed as standalone and not enclosed into the frame.
    Also, the <box> element in the textfield should be kept for getting accurate results when using grid exporters (Excel, ODS, etc).
     
  4. szaharia's post in In Ireport if we pass map as a parameter from java to ireport how to access map values based on key of ireport field was marked as the answer   
    Try
    ((List)($P{REPORT_PARAMETERS_MAP}.get($F{COUNTRY_NAME}))).get(1)
  5. szaharia's post in Report Book creating multiple reports. was marked as the answer   
    If the master report shares the JDBC connection with those 3 reports, then modify the query in the master report only, to return only a single record from DB. Don't modify the queries in the other 3 reports.
    With a single record in the master report main dataset, the inner reports should be printed only once, each one in its own tab.
  6. szaharia's post in Down Across / Across Down Report was marked as the answer   
    Something similar could be obtained in JasperReports using the 'printOrder' attribute of the report, along with a specific column count setting.
    See for reference:
    https://community.jaspersoft.com/documentation/v64-v640/jasperreports-library-ultimate-guide?page=33
    http://jasperreports.sourceforge.net/sample.reference/horizontal/index.html#horizontal
  7. szaharia's post in Problems with SSL connection was marked as the answer   
    Try https://localhost:8443/jasperserver
  8. szaharia's post in Applying style to non-repeated values (TextFields) was marked as the answer   
    You could place an empty frame in the report that:
    has the same x, y, width and height as the textfield. is 'Opaque' and has a blue backcolor has 'Print repeated values' set to true is placed under the textfield (in the JRXML file the frame is defined before the textfield): <frame> ...</frame><textField> ...</textField>[/code] 
  9. szaharia's post in How to make text field stretch with overflow conditionally? was marked as the answer   
    You could use 2 texfields with the same position within the report: one of them having the Stretch with Overflow attribute set to true, the other having the same attribute set to false. For each textfield use a print when expression that depends on your boolean parameter.
  10. szaharia's post in How to format Date full was marked as the answer   
    It may be a problem with the "dd/mm/yyyy" pattern, since 'mm' usually stands for minutes. Try to use "dd/MM/yyyy" instead.
  11. szaharia's post in How to evaluate variable when there is no data? was marked as the answer   
    Hi,
    In order to be properly evaluated, the variable ReportName should be placed after reportTitleA and reportTitleB. You also need to set the initial value expressions for all variables:
    <variable name="reportTitleA" class="java.lang.String"> <variableExpression><![CDATA["Report A"]]></variableExpression> <initialValueExpression><![CDATA["Report A"]]></initialValueExpression> </variable> <variable name="reportTitleB" class="java.lang.String"> <variableExpression><![CDATA["Report Other"]]></variableExpression> <initialValueExpression><![CDATA["Report Other"]]></initialValueExpression> </variable> <variable name="ReportName" class="java.lang.String"> <variableExpression><![CDATA[$P{ReportType}.equals("A")? $V{reportTitleA}:$V{reportTitleB}]]></variableExpression> <initialValueExpression><![CDATA[$P{ReportType}.equals("A")? $V{reportTitleA}:$V{reportTitleB}]]></initialValueExpression> </variable>[/code] 
  12. szaharia's post in Cut off texts more helpful was marked as the answer   
    Hi,
    to get this behavior, set the net.sf.jasperreports.text.truncate.at.char property to true for your text field.
    See http://jasperreports.sourceforge.net/config.reference.html#net.sf.jasperreports.text.truncate.at.char
  13. szaharia's post in How to solve xls File format and extension mismatch warning? was marked as the answer   
    The JRXlsxExporter provides XLSX output documents that should be saved with the ".xlsx" extension. In your example the Excel document is saved as "test.xls", therefore the ".xls" file extension does not properly match the file content. Try to export it as "test.xlsx" instead:
    resp.setHeader("Content-Disposition", "attachment;filename="test.xlsx"");
  14. szaharia's post in Load Base64 image inside detail band, not showing was marked as the answer   
    In this case keep the <initialValueExpression/> as it is, and set the <valueExpression /> of the variable with the same value as in <initialValueExpression/>.
    The evaluation time of the image element could be left as "Page". Other appropriate values for the evaluation time are "Now" and "Auto".
    Regards,
    Sanda
  15. szaharia's post in Excel print preview - page setup was marked as the answer   
    Hi,
    Take a look at the properties below, maybe you could find them useful in this case:
    net.sf.jasperreports.export.xls.fit.height net.sf.jasperreports.export.xls.fit.width net.sf.jasperreports.export.xls.page.scale I hope this helps,
    Sanda
  16. szaharia's post in А lot of hyperlinks in xlsx document creating by report shedule was marked as the answer   
    The MS Excel format specifications indicate a limitation of hyperlinks number per sheet, indeed.

    To disable all hyperlinks in the Excel document you could use the following property: net.sf.jasperreports.export.xls.ignore.hyperlink = true in your JRXML.
    Altenatively, you can handle each hyperlink separately by using a hyperlink parameter with the same name as the property above, in order to make some of them disabled while the other are enabled. More information about this export property/parameter you can find here: http://jasperreports.sourceforge.net/config.reference.html#net.sf.jasperreports.export.{format}.ignore.hyperlink
    I hope this helps,
    Sanda
  17. szaharia's post in How to fix height of detail band inside table was marked as the answer   
    Hi,
    In case of fixed-height rows you could add other 5 detail bands of the same height in your detail section, each of them populated with empty elements (in order to keep the same layout as in the occupied rows) and each of them having a print when expression (assuming the group name is 'category'):
    $V{category_COUNT} < 1 - for the first band $V{category_COUNT} < 2 - for the second band $V{category_COUNT} < 3 - for the third band and so on This solution cannot be applied for rows with variable height, because we don't know the most appropriate height value for the additional bands. In such a case, making use of table component/subreports for each of 3 tables would represent a better approach.
    I hope this helps,
    Sanda
  18. szaharia's post in Alter a field from a SELECT statement before using on report was marked as the answer   
    Hello,
    At least one of the problems lays within the curly brackets. Expressions like $F{PRODUCTNUM.split("_")[0]} don't represent valid entities in JasperReports. Try to use $F{PRODUCTNUM}.split("_")[0] instead, and see if the issue still occurs.
    Also, make sure the PRODUCTNUM field is of type String in order to apply the split() method.
    And one last thing: make sure the <variable > tag is properly closed (the </variable> closing tag should be also present in your JRXML file after </variableExpression>).
    I hope this helps,
    Sanda
  19. szaharia's post in Hyperlink for one text field to another text field was marked as the answer   
    Hi,
    You need to create a local anchor hyperlink in your report:
    for the element 'B' - set an Anchor Name Expression; make sure this expression is valid (some output formats don't accept spaces, for instance) and generates unique results per report (pay special attention when the element 'B' is placed in a detail band that will repeat itself at runtime) for the element 'A' - set the Hyperlink type attribute to 'LocalAnchor' and choose the same expression for Hyperlink Anchor Expression as in the Anchor Name Expression for the textfield 'B' An example related to hyperlinks in JasperReports is available here.
    I hope this helps,
    Sanda
  20. szaharia's post in Select certain Excel rows as value for line chart was marked as the answer   
    Hi,
    Use a filter expression in your dataset.
    Regards,
    Sanda
  21. szaharia's post in Sub reports repeat several times into main report was marked as the answer   
    Hi,
    If you don't need a detail section to be repeated at runtime, make sure the datasource in the main dataset contains a single record. Try to run the main report using an empty datasource and use subdatasets for your subreports.
    I hope this helps,
    Sanda
  22. szaharia's post in Creating multi tab excel report with summary, groups, and details tabs was marked as the answer   
    Hi,
    First of all, to get multiple tabs in an Excel file, you need to export your report as 'one page per sheet' document. To do so, you have to check the 'One Page per Sheet' export option in JSS, or, if you prefer so, you could set the 'net.sf.jasperreports.export.xls.one.page.per.sheet' property as true in your JRXML main report.
    Now, there are several ways to obtain an output layout like the one you described here. For instance:
    1. For each tab in your report create a related subreport to represent data (therefore a total of 6 subreports for the first report and a total of 2 subreports for the second report). Place them in the same band of the main report (for instance in the summary band), and separe them with <break/> elements. Don't forget about the 'one page per sheet' option that should be set to true. Export the report.
    An example of using subreports can be consulted here.
    2. Another possibility is to generate the report as JasperReports book, based on report parts (similar to subreports, but replacing the usual <band/> structure in a report). Some guidance about using report parts is available here and here. Distinct report parts are by default exported in distinct tabs in Excel.
    I hope this helps,
    Sanda
  23. szaharia's post in When exporting to excel a text field how to force merging of two cells for this field? was marked as the answer   
    Hi,
    It depends on your report design only. If the element is not alone in its band, row and column spans are automatically generated, depending on elements size and relative position.
    If the element is left alone, it usually cannot span multiple rows. But you could obtain such a behavior by placing some additonal empty elements in the same band (see attachment).
    Regards,
    Sanda
     
  24. szaharia's post in How to create multiple reports from Single CSV file. was marked as the answer   
    Hi,
    Getting 200 reports at a time cannot be achieved using Studio only. You need to write some custom Java code in order to initiate a multiple export process.
    Instead, getting a single report with 200 similar pages (or group of pages) can be done in Studio, by using the CSV file as report data source (via data adapter) and the detail band as place for the layout elements.
    Regards,
    Sanda
  25. szaharia's post in Zebra stripping in jasperreports using groups not rows was marked as the answer   
    Hello,
    Try the following:
    Create a variable $V{print} of type java.lang.Integer
    - Variable Expression: Boolean.TRUE
    - Variable calculation: Count
    - Increment type: Group
    - Increment group: Value
    Then create a conditional style with desired background features, and set the following condition expression:
    $V{print}%2 == 1
    Use this style for elements in detail band, instead of printing an overlapping rectangle  with printWhenExpression.
    I hope this helps,
    Sanda
×
×
  • Create New...