Print "label X Of Y" Based On Record Count From Sql
I am trying to utilize the "Label X of Y" serialization sample component. I am polling data from my SQL database, and need to be able to use the total record count for my 'Y' value in the 'X of Y' expression. Has anyone done this successfully? I have read many posts on counting total records from .TXT files, but have come across nothing that fits my scenario.
0
-
[quote name='Austin Mathis' timestamp='1336425451' post='2367']
I am trying to utilize the "Label X of Y" serialization sample component. I am polling data from my SQL database, and need to be able to use the total record count for my 'Y' value in the 'X of Y' expression. Has anyone done this successfully? I have read many posts on counting total records from .TXT files, but have come across nothing that fits my scenario.
[/quote]
Do you have a sequence count on each record you are printing? I've written seq 0001, 0002, 0003 to the records and am using the following vbscript to help create 1 of 3, etc.
set con=createobject("ADODB.Connection")
con.open "ODBC database name","userid","password"
set rst=con.execute("Select count(Terminal) as WBC from V_BI_BIN_LABELS Where Terminal = '"+Field("V_BI_BIN_LABELS.TERMINAL") + "' and Report_ID = '" + Field("V_BI_BIN_LABELS.REPORT_ID")+"'")
sLblCount=cstr(rst("WBC"))
rst.close
con.close
set rst=nothing
set con=nothing
Value =cstr(clng(Field("V_BI_BIN_LABELS.SEQUENCE")))+" of "+sLblCount0
Please sign in to leave a comment.
Comments
1 comment