How to write code for serial number in report service

  • Hi.

    Does anybody can teach me how to write a VB code on report that print out serial number on continue paper.

    For example: I need print out our pallet paper, total I have 10 pallet, and I need print out 10

    sheet. the first sheet is 1 of 10 and 2nd sheet is 2 of 10 , 3rd sheet is 3 of 10.....till 10 of 10.

    Thanks [Smile]

  • Are you just looking for the page number? I.e. Page 1 of 10 tgo be printed somewhere on the page? This can be done using the Globals Collection... Drag a text box wherever you want that information to be displayed... The header and/or Footer are the only places this will work

    Then all you need to do is use =Globals!PageNumber & " of " & Globals!TotalPages

    -Luke.

    To help us help you read this[/url]For better help with performance problems please read this[/url]

  • Luke,

    I know how to use page number, but I need print out the serial number on "Body".

    for example; I print out the pallet pager and this pallet paper include 1 of 10, 2 of 10 ...in Body area.

    Thanks:-)

  • ok, are the numbers 1,2,3 etc references in your dataset? If so, you already have half of the data you need. Then you could look at the rowcount function for the number of rows in the current scope, if that won't work due to grouping aggregations etc, you could also look at the countdistinct function.

    The syntax might not be 100% correct here but it would look something like:

    =fields!serialNo.value & " of " & rowcount

    OR

    =fields!serialNo.value & " of " & countdistinct(fields!serialNo)

    Or if you don't have the serial Number as part of the dataset, you could add a column which will bring back the number 1 in an extra column. Then you could use the runningvalues and count functions to get your x of n.

    -Luke.

    To help us help you read this[/url]For better help with performance problems please read this[/url]

  • Luke,

    appricate your help, like you said, I don't have number in dataset, I have 1 record to get pallet total amount. Do I need write a code for repeat

    or I add a new column and in this column, I use iif function ? can you let me know more information ?

    Thanks:-)

  • perhaps I'm not understanding. Are you just trying to generate a report with 1 of 10 and nothing else on the page? There's no data to drive the operation, nothing else to include on it? OR am I again misinterpreting what you are trying to do? Perhaps you could give me some sample data or a screenshot of what you report looks like now and what you want it to look like?

    -Luke.

    To help us help you read this[/url]For better help with performance problems please read this[/url]

  • Luke,

    Appreciate your reply, from attached file, you will find our the pallet paper has dispaly total are 7 pallet. but I hope you can let me know

    how to print out 7 page from "Pallets : 1 of 7" , "Pallet : 2 of 7" to "Pallet 7 of 7". now I print out this page and let employee copy to 7 sheet and wrote 1 ~ 7 for this 7 sheet. on attached #2, you can see every product has 1 record for this sales order.

    Thanks

  • OK so on your pallet paper report how do you figure out that there will be x of 7 pallets?

    Really the only way to do this would be to create a group that breaks after the group and has a running aggregate to do the x.

    If you need some example code, I'd need a bit of sample data.

    -Luke.

    To help us help you read this[/url]For better help with performance problems please read this[/url]

  • Hi

    try this =ROWNUMBER(Nothing)\10 puting it in group

    thanks

    v@su

  • I will try, thanks a lot

Viewing 10 posts - 1 through 9 (of 9 total)

You must be logged in to reply to this topic. Login to reply