You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

BI Publisher中如何通过限制表格每页行数实现空白支票打印?

Solution for BI Publisher RTF Template: Void Checks Scenario for PDF Check Printing

Hey there, let's walk through how to build this RTF template for your void checks requirement in BI Publisher. I’ve worked on similar check printing workflows before, so here’s a practical, step-by-step breakdown that aligns with your rules:

First, Let’s Confirm the Requirements

  • Every page must include both an invoice detail table and a check section.
  • If your invoice count exceeds 38:
    1. The first page will display exactly 38 invoices in the table.
    2. Below that table, print a void check showing the total amount of those 38 invoices.
    3. Carry over remaining invoices to the next page, repeating the same rule.
  • For the final page (with fewer than 38 invoices), the check will be your regular non-void version (adjust the condition if you need it void too).

Step 1: Set Up the Base RTF Template

Start with a blank Word document and set page dimensions to match your physical check stock (this is critical for proper alignment later). Then define two core sections:

  1. Invoice Detail Table: For listing invoice numbers, amounts, and other relevant details.
  2. Check Section: Design your check layout here—include fields for payee, amount, date, and space for the "VOID" watermark.

Step 2: Group Invoices into Chunks of 38

Use BI Publisher’s for-each-group function to split your invoice data into groups of max 38. Insert this tag right before your invoice table:

<?for-each-group:INVOICE;ceil(position() div 38)?>

Replace INVOICE with your actual data group name from your XML source. This will automatically group invoices into blocks of 38 (or fewer for the final group).

Step 3: Build the Invoice Table & Calculate Group Total

Inside the group tag, create your invoice table. For each row, pull in invoice details using BI Publisher fields (e.g., <?INVOICE_NUMBER?>, <?INVOICE_AMOUNT?>).

Add a total row at the bottom of the table to sum the amounts for the current group:

Total: <?sum(current-group()/INVOICE_AMOUNT)?>

This dynamically calculates the total for the 38 (or fewer) invoices on the page.

Step 4: Ensure Table & Check Stay on the Same Page

To prevent the table from splitting across pages and keep the check paired with its invoice table:

  1. Select the entire block (invoice table + check section).
  2. Right-click > Paragraph > Go to the Line and Page Breaks tab.
  3. Check both Keep lines together and Keep with next.
    This forces Word (and BI Publisher) to keep the entire block on one page.

Step 5: Add Void Check Logic

In your check section, show the "VOID" text/watermark only if there are more invoices after the current group:

<?if:position() != last()?>
  <!-- Insert your VOID text or watermark here -->
  <textbox style="font-size:72pt; color:#cccccc; text-align:center;">VOID</textbox>
<?end if?>

For the amount field on the check, use the same group total we calculated earlier: <?sum(current-group()/INVOICE_AMOUNT)?>. For currency formatting, use:

<?format-number(sum(current-group()/INVOICE_AMOUNT), '$#,##0.00')?>

Step 6: Add Page Breaks Between Groups

After each check section, insert a page break to start the next group of invoices on a new page:

<?split-by-page-break:?>

Place this tag right after the closing <?end for-each-group?> tag (or immediately after the check section).

Step 7: Test & Tweak

  • Use BI Publisher’s Template Builder for Word to preview your template with sample XML data. Test with 38, 39, and 76 invoices to verify:
    1. Groups split correctly.
    2. Totals are accurate.
    3. Void checks appear only on pages with 38 invoices (and more remaining).
    4. The table and check stay paired on the same page.
  • Adjust margins, check positioning, and font sizes to match your physical check stock—this may take a few iterations to get perfect.

Quick Pro Tips

  • For the VOID watermark, use a semi-transparent light gray color so it’s visible but doesn’t obscure check details.
  • Ensure your XML data is properly structured with all required fields (invoice number, amount, etc.) for grouping and totaling.

内容的提问来源于stack exchange,提问作者Bhavna

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.21 07:28:29