Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

unique number from database on each row of crystal report

  • 28-02-2012 1:17am
    #1
    Registered Users, Registered Users 2 Posts: 208 ✭✭


    I have a crystal report which is populated by a view on a SQL Server DB. On the report, I would like to put a barcode containing a unique ref number on each row of the report. The unique number would be derived from a number held on a table in the database and incremented for each row. The table is needed to ensure unique and sequential numbers, plus I may need to format the numbers for the report.

    My initial thought was to use a function call as a column within the view, but you cannot update the database (seed number) from a function. For every other way I have come up with for this, the number wil not be incremented and returned for each line in the dataset.

    Would anyone have any ideas on how this could be done? Any help/pointers would be appreciated.

    Whitey


Comments

  • Registered Users, Registered Users 2 Posts: 11,989 ✭✭✭✭Giblet


    Don't know anything about Crystal, in SQL you would do this, if it's any help. (Although just using ROW_NUMBER instead of id + ROW_NUMBER might server the same function
    select *,id + ROW_NUMBER() OVER(ORDER BY id asc)  from myTable
    


Advertisement