majaa majaa wrote:
> Hello
> I don't understand the main idea... (Jasper, iReports) and sorry for my

Sorry for delay! I'm now working full time as DBA and have little time
read mail list.

First, you need understand that what we use here is the japerresports
api and iReports is the designing tool for it. And you can use other
tool as well as edit the jxml file manually.
> english
Don't worry! I'm from Brazil, hehe!

> When someone knows something thanks!!
> majaa
> 
> I have a file jrxml:
> <queryString><![CDATA[select username, first_name, last_name, email from
> user where username=$P{AAA}]]></queryString>
> where AAA is
> <parameter name="AAA" isForPrompting="true" class="java.lang.String">
>         <defaultValueExpression
>><![CDATA["zzzz"]]></defaultValueExpression>

Something you must understand (hehe) here is that the jasperreports api
aspects some data source types:
    JRAbstractBeanDataSource, JRBeanArrayDataSource,
JRBeanCollectionDataSource, JRCsvDataSource, JREmptyDataSource,
JRHibernateAbstractDataSource, JRHibernateIterateDataSource,
JRHibernateListDataSource, JRHibernateScrollDataSource, JRJpaDataSource,
JRMapArrayDataSource, JRMapCollectionDataSource, JRMondrianDataSource,
JROlapDataSource, JRResultSetDataSource, JRSortableDataSource,
JRTableModelDataSource, JRXmlDataSource

This is from
http://jasperreports.sourceforge.net/api/net/sf/jasperreports/engine/JRDataSource.html.

And that springframework provides a integration point
(http://www.springframework.org/docs/reference/view.html#view-jasper-reports),
where you don't need to load, compile, fill and export a report like
Thomas did with JSF tutorial part.

In order to render your report correctly, you must supply Spring with
all of the data needed to populate your report. This means you must pass
in all report parameters along with the report datasource and those
parameters are simple name/value pairs and can be added to the Map model
as you would add any name/value pair.
The spring docs is very clear and important to read!

One thing I do when designing my reports on iReports is, do it like sql
report. I mean, I use it to test my reports connecting the database
(just sql). After that I setup the fields accordingly to my app services
datasource (JRBeanArrayDataSource, JRBeanCollectionDataSource,
JRCsvDataSource, JREmptyDataSource, etc.). So, if I use a
list(JRBeanCollectionDataSource) of pojos and that a pojo can has a
instance field, I must create the correspondent fields on the report (I
mean, if I want to show user.address.name field).

Hth,

Gilberto

> </parameter>
> action-servlet.xml is the same as in the tutorial
> UserReportController.java:
>         model.put("AAA", "bbb");
>         model.put("format", format);
>         model.put("WEBDIR", reportResourcePath);
>         model.put("dataSource", userManager.getUsers(new User()));
>         return new ModelAndView("userMultiFormatReport", model);
> 1. In iReports editor all is ok! But later.. Is there something wrong?
> perhaps with parameter AAA?
> 2. When I define dataSource as all  users,  I get  all users..
> Is it another way? no to define dataSource? I want to have many reports
> and I don't know all reports query! Ok I can read it from xml but must I?
> 3. Can I define query (ireports) like:
> select $P{ETW}, count(*) from bbb group by $P{ETW}
> 4. How can I define such a query :
> select ... where ccc in  {'a', 'b', 'c'}
> with ireport where 'a','b','c'  are changeable.. so one parameter eg
> $P{E} for more als one string..
> how to define parameter E?
> //I'm using Appfuse 1.9.3, ireports 1.3.0
> thanks for any help!

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to