Print different text on every label, depending on row number / page number
Hi everyone,
I'm working on a project where I need to print different text on each page of a document based on the row number from a database. Here's what I'm aiming for:
-
Row 1 should print Text 1
-
Row 2 should print Text 2
I attempted to solve this using VBScript by reading the page number and changing the text accordingly. However, my script only reads the page number for the first page and subsequently prints the same text on all pages. Here's a simplified version of what I've tried:
create a field pageno with content page number (works correctly)
create second field pagetext with VB content:
if CStr(Format.Objects("pageno").Value) = "2"
then value="text1"
else
value="text2"
end if
The Problem: This only works for the first page. It seems like the pageNumber variable doesn't update for each subsequent page.
Question: How can I correctly update the pageNumber for each page so that different text is printed based on the current row from the database? Changing the code isn't straightforward for me, so any guidance or examples would be greatly appreciated.
Thank you!
0
-
You could add a sequential field, that resets each print job, off the edge of the label (ie outside the printable area) and use/reference that if it were the page number in your VB
0
Bitte melden Sie sich an, um einen Kommentar zu hinterlassen.
Kommentare
1 Kommentar