13.07.2015 Views

iReport Ultimate Guide - Nimsoft Library

iReport Ultimate Guide - Nimsoft Library

iReport Ultimate Guide - Nimsoft Library

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>iReport</strong> <strong>Ultimate</strong> <strong>Guide</strong>Figure 6-5Query dialog<strong>iReport</strong> does not need you to define a query in order to generate a report. In fact, <strong>iReport</strong> could obtain data records from a datasource that is not defined by a query execution. Regardless, here is where you define it. The language of the query can be oneof those items listed in the combo box on the top of the query dialog. UR supports the most common querylanguages:• SQL• HQL• EJBQL• Xpath• MDX (both the standard and XMLA-encapsulated versions)Let’s focus on SQL. If the selected data source is a JDBC connection, <strong>iReport</strong> will test the access connection to the data sourceas you define the query. This allows <strong>iReport</strong> to identify the fields using the query metadata in the result set. The design toollists the discovered fields in the bottom portion of the window. For each field, <strong>iReport</strong> determines the name and the Java typespecified for that field by the JDBC driver.A query that accesses one or more tables containing a large amount of data may require a long delay while <strong>iReport</strong> scans thedata source to discover field names. You may want to disable the Automatically Retrieve Fields option in order to quicklyfinish your query definition. When you have completed the query, click the Read Fields button in order to start the fieldsdiscovery scan.All fields used in a query must have a unique name. Use alias field names in the query for fields having the samename.In case of an error during the query execution (due to a syntax error or to an unavailable database connection), an errormessage will be displayed instead of the fields list.The field name scan may return a large number of field names if you are working with complex tables. I suggest that youreview the list of discovered names and remove any fields that you are not planning to use in your report, in order to reduceunnecessary complexity.When you click the OK button all the fields in the list will be included in the report design. You canalso remove them later in the outline view, but it’s a good idea at this point in the design process to remove any field namesthat you won’t be using.98

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!