Hi all (and Hi Henner),
I need help, I cannot print on a jasper-report the current "row" displayed
by dbforms.
I read the documentation (the chapter 25, the taglib) but i cannot do this
thing...
I have a simple dbform that displays an ID (id_Grade), only that attrib
and it's the primary key of the table.
Then I have a very simple report that must display only the current record
of the form.
This is the gotoButton I have in dbform (like in chapter 25) and
in my form I have maxRows="1" and it displays only one record at a time....
<db:gotoButton
caption="print current row"
destTable="tbl_grade"
keyToDestPos="currentRow"
destination="/reports/DataSourceReport" />
</td>
I put in this mail also the xml code of the DataSourceReport (the
jasperreport) and the jsp of the dbform:
Where am I wrong? Can you help me?
Another time thankx
Ivan
------------------------------------ DataSourceReport.xml
--------------------------------------------
<?xml version="1.0" encoding="UTF-8" ?>
<!-- Created with iReport - A designer for JasperReports -->
<!DOCTYPE jasperReport PUBLIC "//JasperReports//DTD Report Design//EN"
"http://jasperreports.sourceforge.net/dtds/jasperreport.dtd">
<jasperReport
name="DataSourceReport"
columnCount="1"
printOrder="Vertical"
orientation="Portrait"
pageWidth="595"
pageHeight="842"
columnWidth="515"
columnSpacing="0"
leftMargin="40"
rightMargin="40"
topMargin="50"
bottomMargin="50"
whenNoDataType="NoPages"
isTitleNewPage="false"
isSummaryNewPage="false">
<reportFont name="Arial_Normal" isDefault="true" fontName="Arial"
size="12" isBold="false" isItalic="false" isUnderline="false"
isStrikeThrough="false" pdfFontName="Helvetica" pdfEncoding="Cp1252"
isPdfEmbedded="false"/>
<reportFont name="Arial_Bold" isDefault="false" fontName="Arial"
size="12" isBold="true" isItalic="false" isUnderline="false"
isStrikeThrough="false" pdfFontName="Helvetica-Bold" pdfEncoding="Cp1252"
isPdfEmbedded="false"/>
<reportFont name="Arial_Italic" isDefault="false" fontName="Arial"
size="12" isBold="false" isItalic="true" isUnderline="false"
isStrikeThrough="false" pdfFontName="Helvetica-Oblique"
pdfEncoding="Cp1252" isPdfEmbedded="false"/>
<field name="id_grade" class="java.lang.String"/>
<background>
<band height="0" isSplitAllowed="true" >
</band>
</background>
<title>
<band height="70" isSplitAllowed="true" >
</band>
</title>
<pageHeader>
<band height="20" isSplitAllowed="true" >
<staticText>
<reportElement
mode="Opaque"
x="0"
y="5"
width="55"
height="15"
forecolor="#000000"
backcolor="#333333"
positionType="FixRelativeToTop"
isPrintRepeatedValues="true"
isRemoveLineWhenBlank="false"
isPrintInFirstWholeBand="false"
isPrintWhenDetailOverflows="false"/>
<textElement textAlignment="Center"
verticalAlignment="Top"
lineSpacing="Single">
<font reportFont="Arial_Bold"/>
</textElement>
<text><![CDATA[id_grade]]></text>
</staticText>
</band>
</pageHeader>
<columnHeader>
<band height="30" isSplitAllowed="true" >
</band>
</columnHeader>
<detail>
<band height="20" isSplitAllowed="true" >
<textField isStretchWithOverflow="false" pattern=""
isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None"
> <reportElement
mode="Opaque"
x="0"
y="4"
width="50"
height="15"
forecolor="#000000"
backcolor="#FFFFFF"
positionType="FixRelativeToTop"
isPrintRepeatedValues="true"
isRemoveLineWhenBlank="false"
isPrintInFirstWholeBand="false"
isPrintWhenDetailOverflows="false"/>
<textElement textAlignment="Right"
verticalAlignment="Top"
lineSpacing="Single">
<font fontName="SansSerif"
pdfFontName="Helvetica" size="12"
isBold="false" isItalic="false" isUnderline="false" isPdfEmbedded
="false" pdfEncoding ="CP1252" isStrikeThrough="false" />
</textElement>
<textFieldExpression
class="java.lang.String"><![CDATA[$F{id_grade}]]></textFieldExpression>
</textField>
</band>
</detail>
<columnFooter>
<band height="30" isSplitAllowed="true" >
</band>
</columnFooter>
<pageFooter>
<band height="40" isSplitAllowed="true" >
</band>
</pageFooter>
<summary>
<band height="60" isSplitAllowed="true" >
</band>
</summary>
</jasperReport>
--------------------------------------------------------------------------------------------------
------------------------------------ TBL_GRADE.JSP [generated with
xsl-devgui]------------------------------
<%@ taglib uri="/WEB-INF/dbforms.tld" prefix="db" %>
<html xmlns:db="http://www.wap-force.com/dbforms">
<head>
<db:base/>
</head>
<body class="clsPageBody">
<table align="center" border="0" width="100%" cellspacing="0"
cellpadding="1" class="clsMainMenuTable">
<tr>
<td>
<table border="0" width="100%" cellspacing="0" cellpadding="3"
class="clsMainMenuTable">
<tr class="clsMainMenuTableRow">
<td class="clsMainMenu" align="right">
<a class="clsMainMenu" href="tbl_grade_list.jsp">[List]</a>
<a class="clsMainMenu" href="menu.jsp">[Menu]</a>
<a class="clsMainMenu" href="logout.jsp">[Log out]</a>
</td>
</tr>
</table>
</td>
</tr>
</table>
<db:dbform multipart="false" autoUpdate="false"
followUp="/business_objects/tbl_grade/tbl_grade_single.jsp" maxRows="1"
tableName="tbl_grade">
<db:header/>
<db:errors/>
<db:body>
<table width="400" align="center" border="0">
<tr class="clsEvenDataTableRow">
<td style="font-weight: bold" align="left">id_grade</td>
<td align="left">
<db:textField styleClass="clsInputStyle" size="10" fieldName="id_grade"/>
</td>
</tr>
</table>
<br/>
<center>
<db:insertButton showAlways="false" styleClass="clsButtonStyle"
caption="Commit data into tbl_grade"/>
</center>
</db:body>
<db:footer>
<table border="0" align="center">
<tr>
<td align="right">
<db:navFirstButton styleClass="clsButtonStyle" style="width:90"
caption="<< First"/>
</td>
<td align="center">
<db:navPrevButton styleClass="clsButtonStyle" style="width:90"
caption="< Previous"/>
</td>
<td align="center">
<db:navNextButton styleClass="clsButtonStyle" style="width:90"
caption="Next >"/>
</td>
<td align="left">
<db:navLastButton styleClass="clsButtonStyle" style="width:90"
caption="Last >>"/>
</td>
<td>
<db:gotoButton
caption="print current row"
destTable="tbl_grade"
keyToDestPos="currentRow"
destination="/reports/DataSourceReport" />
</td>
</tr>
</table>
</db:footer>
</db:dbform>
</body>
</html>
-----------------------------------------------------------------------------------------------------------------
> Hi Ivan,
>
> dbforms support JasperReports directly. Reports will show the same rows of
> data like the calling form.
> Internally a custom datasource is used.
>
> Have a look at chapter 25 in the documentation.
>
> regards,
> Henner
>
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
DbForms Mailing List
http://www.wap-force.net/dbforms