Index: pykota/trunk/pykota/reporters/html.py
===================================================================
--- pykota/trunk/pykota/reporters/html.py (revision 3561)
+++ pykota/trunk/pykota/reporters/html.py (revision 3568)
@@ -38,40 +38,42 @@
             prefix = "User"
         for printer in self.printers :
-            phistoryurl = { "printername" : printer.Name, "history" : 1 }
-            self.report.append('<a href="%s?%s"><h2 class="printername">%s</h2></a>' % (os.environ.get("SCRIPT_NAME", ""), urllib.urlencode(phistoryurl), self.getPrinterTitle(printer)))
-            self.report.append('<h3 class="printergracedelay">%s</h3>' % self.getPrinterGraceDelay(printer))
-            (pjob, ppage) = self.getPrinterPrices(printer)
-            self.report.append('<h4 class="priceperjob">%s</h4>' % pjob)
-            self.report.append('<h4 class="priceperpage">%s</h4>' % ppage)
-            total = 0
-            totalmoney = 0.0
-            self.report.append('<table class="pykotatable" border="1">')
-            headers = self.getReportHeader().split()
-            headers.insert(1, "LimitBy")
-            self.report.append('<tr class="pykotacolsheader">%s</tr>' % "".join(["<th>%s</th>" % h for h in headers]))
-            oddeven = 0
-            for (entry, entrypquota) in getattr(self.tool.storage, "getPrinter%ssAndQuotas" % prefix)(printer, self.ugnames) :
-                oddeven += 1
-                if oddeven % 2 :
-                    oddevenclass = "odd"
-                else :
-                    oddevenclass = "even"
-                (pages, money, name, reached, pagecounter, soft, hard, balance, datelimit, lifepagecounter, lifetimepaid, overcharge, warncount) = self.getQuota(entry, entrypquota)
-                if datelimit :
-                    if datelimit == "DENY" :
-                        oddevenclass = "deny"
+            entries = getattr(self.tool.storage, "getPrinter%ssAndQuotas" % prefix)(printer, self.ugnames)
+            if entries :
+                phistoryurl = { "printername" : printer.Name, "history" : 1 }
+                self.report.append('<a href="%s?%s"><h2 class="printername">%s</h2></a>' % (os.environ.get("SCRIPT_NAME", ""), urllib.urlencode(phistoryurl), self.getPrinterTitle(printer)))
+                self.report.append('<h3 class="printergracedelay">%s</h3>' % self.getPrinterGraceDelay(printer))
+                (pjob, ppage) = self.getPrinterPrices(printer)
+                self.report.append('<h4 class="priceperjob">%s</h4>' % pjob)
+                self.report.append('<h4 class="priceperpage">%s</h4>' % ppage)
+                total = 0
+                totalmoney = 0.0
+                self.report.append('<table class="pykotatable" border="1">')
+                headers = self.getReportHeader().split()
+                headers.insert(1, "LimitBy")
+                self.report.append('<tr class="pykotacolsheader">%s</tr>' % "".join(["<th>%s</th>" % h for h in headers]))
+                oddeven = 0
+                for (entry, entrypquota) in entries :
+                    oddeven += 1
+                    if oddeven % 2 :
+                        oddevenclass = "odd"
                     else :
-                        oddevenclass = "warn"
-                if (not self.tool.config.getDisableHistory()) and (not self.isgroup) :
-                    name = '<a href="%s?username=%s&printername=%s&history=1">%s</a>' % (os.environ.get("SCRIPT_NAME", ""), name, printer.Name, name)
-                self.report.append('<tr class="%s">%s</tr>' % (oddevenclass, "".join(["<td>%s</td>" % h for h in (name, reached, overcharge, pagecounter, soft, hard, balance, datelimit or "&nbsp;", lifepagecounter, lifetimepaid, warncount)])))
-                total += pages
-                totalmoney += money
+                        oddevenclass = "even"
+                    (pages, money, name, reached, pagecounter, soft, hard, balance, datelimit, lifepagecounter, lifetimepaid, overcharge, warncount) = self.getQuota(entry, entrypquota)
+                    if datelimit :
+                        if datelimit == "DENY" :
+                            oddevenclass = "deny"
+                        else :
+                            oddevenclass = "warn"
+                    if (not self.tool.config.getDisableHistory()) and (not self.isgroup) :
+                        name = '<a href="%s?username=%s&printername=%s&history=1">%s</a>' % (os.environ.get("SCRIPT_NAME", ""), name, printer.Name, name)
+                    self.report.append('<tr class="%s">%s</tr>' % (oddevenclass, "".join(["<td>%s</td>" % h for h in (name, reached, overcharge, pagecounter, soft, hard, balance, datelimit or "&nbsp;", lifepagecounter, lifetimepaid, warncount)])))
+                    total += pages
+                    totalmoney += money
 
-            if total or totalmoney :
-                (tpage, tmoney) = self.getTotals(total, totalmoney)
-                self.report.append('<tr class="totals"><td colspan="8">&nbsp;</td><td align="right">%s</td><td align="right">%s</td><td>&nbsp;</td></tr>' % (tpage, tmoney))
-            self.report.append('<tr class="realpagecounter"><td colspan="8">&nbsp;</td><td align="right">%s</td><td>&nbsp;</td></tr>' % self.getPrinterRealPageCounter(printer))
-            self.report.append('</table>')
+                if total or totalmoney :
+                    (tpage, tmoney) = self.getTotals(total, totalmoney)
+                    self.report.append('<tr class="totals"><td colspan="8">&nbsp;</td><td align="right">%s</td><td align="right">%s</td><td>&nbsp;</td></tr>' % (tpage, tmoney))
+                self.report.append('<tr class="realpagecounter"><td colspan="8">&nbsp;</td><td align="right">%s</td><td>&nbsp;</td></tr>' % self.getPrinterRealPageCounter(printer))
+                self.report.append('</table>')
         if self.isgroup :
             self.report.append('<p class="warning">%s</p>' % _("Totals may be inaccurate if some users are members of several groups."))
Index: pykota/trunk/pykota/reporters/text.py
===================================================================
--- pykota/trunk/pykota/reporters/text.py (revision 3561)
+++ pykota/trunk/pykota/reporters/text.py (revision 3568)
@@ -35,26 +35,28 @@
             prefix = "User"
         for printer in self.printers :
-            self.report.append(self.getPrinterTitle(printer))
-            self.report.append(self.getPrinterGraceDelay(printer))
-            (pjob, ppage) = self.getPrinterPrices(printer)
-            self.report.append(pjob)
-            self.report.append(ppage)
+            entries = getattr(self.tool.storage, "getPrinter%ssAndQuotas" % prefix)(printer, self.ugnames)
+            if entries :
+                self.report.append(self.getPrinterTitle(printer))
+                self.report.append(self.getPrinterGraceDelay(printer))
+                (pjob, ppage) = self.getPrinterPrices(printer)
+                self.report.append(pjob)
+                self.report.append(ppage)
 
-            total = 0
-            totalmoney = 0.0
-            header = self.getReportHeader()
-            self.report.append(header)
-            self.report.append('-' * len(header))
-            for (entry, entrypquota) in getattr(self.tool.storage, "getPrinter%ssAndQuotas" % prefix)(printer, self.ugnames) :
-                (pages, money, name, reached, pagecounter, soft, hard, balance, datelimit, lifepagecounter, lifetimepaid, overcharge, warncount) = self.getQuota(entry, entrypquota)
-                self.report.append("%-15.15s %s %5s %7i %7s %7s %10s %-10.10s %8i %10s %4s" % (name, reached, overcharge, pagecounter, soft, hard, balance, datelimit, lifepagecounter, lifetimepaid, warncount))
-                total += pages
-                totalmoney += money
+                total = 0
+                totalmoney = 0.0
+                header = self.getReportHeader()
+                self.report.append(header)
+                self.report.append('-' * len(header))
+                for (entry, entrypquota) in entries :
+                    (pages, money, name, reached, pagecounter, soft, hard, balance, datelimit, lifepagecounter, lifetimepaid, overcharge, warncount) = self.getQuota(entry, entrypquota)
+                    self.report.append("%-15.15s %s %5s %7i %7s %7s %10s %-10.10s %8i %10s %4s" % (name, reached, overcharge, pagecounter, soft, hard, balance, datelimit, lifepagecounter, lifetimepaid, warncount))
+                    total += pages
+                    totalmoney += money
 
-            if total or totalmoney :
-                (tpage, tmoney) = self.getTotals(total, totalmoney)
-                self.report.append((" " * 62) + tpage + tmoney)
-            self.report.append((" " * 63) + self.getPrinterRealPageCounter(printer))
-            self.report.append("")
+                if total or totalmoney :
+                    (tpage, tmoney) = self.getTotals(total, totalmoney)
+                    self.report.append((" " * 62) + tpage + tmoney)
+                self.report.append((" " * 63) + self.getPrinterRealPageCounter(printer))
+                self.report.append("")
         if self.isgroup :
             self.report.append(_("Totals may be inaccurate if some users are members of several groups."))
