def generate(self, ledgers, report):
        last_entry = None
        for entry in report.generate(ledgers):
            if last_entry and id(last_entry.transaction) == id(entry.transaction):
                for line in self.print_secondary_entry(entry):
                    yield line
            else:
                for line in self.print_entry(entry):
                    yield line
            last_entry = entry