Location: PHPKode > projects > FiForms Framework > FiForms/apps/books/reports/print_collection.xml
<?xml version="1.0"?>
<!DOCTYPE reportdef PUBLIC "-//FIFORMS//DTD FIREPORTDEF 1.1//EN" "http://xml.fiforms.org/dtd/11/FiReportDef.dtd">
<reportdef xmlns="http://xml.fiforms.org/FiForms/" version="1.1">
<title>Book Collection Printout</title>
<summary>A little demo of the reporting capabilities of FiForms</summary>
<connect db="fiforms_sample" id="1" server="localhost" type="MySQL"/>
<stylesheet caption="Library Books Summary Report" default="default" href="libraryreport.xsl"/>
<query connectid="1" output="yes" resultname="Book Collection">
<sql>
SELECT BOOK_ID, 
BOOK_TITLE,
CONCAT(AUTHOR_FIRSTNAME,&apos; &apos;,AUTHOR_LASTNAME) as AUTHOR_NAME,
BOOK_ISBN, 
BOOK_CALLNUM,
BOOK_COPYRIGHT,
PUB_NAME, PUB_CITY, PUB_STATE
FROM books
JOIN authors ON (books.AUTHOR_ID = authors.AUTHOR_ID)
LEFT JOIN publishers ON (books.PUB_ID = publishers.PUB_ID)
ORDER BY AUTHOR_LASTNAME, AUTHOR_FIRSTNAME, BOOK_TITLE
</sql>
<query connectid="1" output="yes" resultname="Categories">
<sql>
SELECT 
concat(if(c.cat_title is null,&apos;&apos;,concat(c.cat_title,&apos;--&apos;)),if(b.cat_title is null,&apos;&apos;,concat(b.cat_title,&apos;--&apos;)),a.CAT_TITLE) as CATEGORY

from bookcats 
JOIN categories a ON (bookcats.CAT_ID = a.CAT_ID) 
left join categories b on a.CAT_PARENT_ID = b.CAT_ID 
left JOIN categories c ON b.CAT_PARENT_ID = c.CAT_ID

WHERE BOOK_ID = &apos;%BOOK_ID%&apos;
</sql>
</query>
</query>
</reportdef>
Return current item: FiForms Framework