Jump to content
Changes to the Jaspersoft community edition download ×

Need Help Please (Urgent)


Recommended Posts

By: Sofiane - sofianito

Need Help Please (Urgent)

2002-11-07 09:43

Hi, here is my situation: I need to generate a report for the clients of a bank, the report contains 3 pages. I started to design the report which looks like this:

 

<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE jasperReport PUBLIC "-//JasperReports//DTD Report Design//EN"

"http://jasperreports.sourceforge.net/dtds/jasperreport.dtd";>

<jasperReport bottomMargin="10" columnCount="1" columnSpacing="0" columnWidth="822"

isSummaryNewPage="false" isTitleNewPage="false" leftMargin="10" name="fondos"

orientation="Landscape" pageHeight="595" pageWidth="842" printOrder="Vertical" rightMargin="10"

topMargin="10" whenNoDataType="BlankPage">

 

<reportFont fontName="Arial" isDefault="true" isPdfEmbedded="false" name="Arial_Normal"

pdfEncoding="Cp1252" pdfFontName="Helvetica" size="12"/>

 

<reportFont fontName="Arial" isBold="true" isDefault="false" isPdfEmbedded="false"

name="Arial_Bold" pdfEncoding="Cp1252" pdfFontName="Helvetica-Bold" size="12"/>

 

<reportFont fontName="Arial" isDefault="false" isItalic="true" isPdfEmbedded="false"

name="Arial_Italic" pdfEncoding="Cp1252" pdfFontName="Helvetica-Oblique" size="12"/>

 

<parameter class="java.lang.String" name="clientId">

<parameterDescription>Id of the client which comes from HTML form</parameterDescription>

</parameter>

 

<parameter class="java.util.Date" name="reportDate">

<parameterDescription>Date of creation of the report</parameterDescription>

</parameter>

 

<queryString><![CDATA[sELECT * FROM clients where clientId=$P{clientId}]]></queryString>

 

<field name="name" class="java.lang.String">

<fieldDescription>Name of the client</fieldDescription>

</field>

.

.

.

 

Well, the main query of the report returns always one row from the database. The first page of my report contains basically the name of the client and the date of the report, til now it seems easy, but then my second page contains one paragraph (1), one chart (2) and one table (3).

(1) the paragraph is a text that is read from a text file which name is file_yyyyMM.txt where yyyyMM are respectively the year and the month extracted from the reportDate parameter.

(2) The chart is a pie that is generated from an sql query (different from the main one)

(3) The table contains one row of six cells and the value of every cell is a query to the database!

 

And finally the third page contains four different graphs, with every graph associated with one query.... !

 

Can u tell me please what would be the best way to resolv these complications?

 

 

Thanks

Sofiane

 

 

By: Martin Phee - mphee

RE: Need Help Please (Urgent)

2002-11-07 10:15

1. Read the contents of the file in and pass it as a string parameters to the report

2. Checkout the chart example in the demos. I've never made a chart.

3. Make it a subreport. What database are you using?

I use oracle. It allows for inline queries which would work for number 3.

 

You can probably use groups to force page breaks, so each item is on a seperate page.

 

What's the output? PDF, HTML....

 

 

By: Martin Phee - mphee

RE: Need Help Please (Urgent)

2002-11-07 11:48

Access? Yuk...

 

I don't think there is a limit with the number of subreports.

 

You should be able to do what your talking about with subreports.

 

 

By: Sofiane - sofianito

RE: Need Help Please (Urgent)

2002-11-07 11:05

I'm using access as database. and the output has to be a pdf. Can use three subreports on the same page? the thing is that our client require that we put the three elements ( paragraph, chart and table ) on the same page!. What could be the best way to do it ( Scriptlet or subreport )?

 

thanks

 

 

By: Teodor Danciu - teodord

RE: Need Help Please (Urgent)

2002-11-07 13:20

 

Hi,

 

You might get to use both of them eventually:

scriptlets and subreports, depending on the

complexity of the report.

But it might also be possible to not use any.

 

Check this also to see how to introduce

page breaks if needed:

 

http://jasperreports.sourceforge.net/tips.tricks.html#largebands

 

I think only you can decide what you need,

but only after fully understanding the library

functionality.

It is much simpler this way, because I'm not

sure you can fully explain what you need to do

to someone who knows the library well.

 

Thank you,

Teodor

Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...