Count the total number of times a report has been printed

robinho81
Member Posts: 48
Hello,
For creating a SSCC barcode we need to count the total number of times a report has been printed. I would like to see that the report remembers how many times it has been printed. So everytime it prints I would like the barcodenumber be raised with '1'.
Is it possible for a report to remember a value? Or do I have place the number it has been printed somewhere in a field in a table? And if it has to be placed in a field, where, which field?
Thank you!
For creating a SSCC barcode we need to count the total number of times a report has been printed. I would like to see that the report remembers how many times it has been printed. So everytime it prints I would like the barcodenumber be raised with '1'.
Is it possible for a report to remember a value? Or do I have place the number it has been printed somewhere in a field in a table? And if it has to be placed in a field, where, which field?
Thank you!
0
Comments
-
Technically a report can remember a value. It's stored in the zup file. But that is for individual users and if the zup file is ever corrupted or deleted your value goes away. So not recommended for what you want.
You'll need to store your value in a custom field somewhere.
You could use a number series for this. Just like orders are assigned a number from a series, your barcode could be also.0 -
Thank you... When I have created a starting and ending value in the series, how can I use this in my report?0
-
robinho81 wrote:Thank you... When I have created a starting and ending value in the series, how can I use this in my report?
see in posted invoice form, you'll see field "no. printed" in the header. just take a look at the report being printed from the print button...basically you just have to put
myfield := myfield + 1; in the report...0 -
Yes I understand, but I need this report at random. Not in one loop for one specific sales order. Whenever I run this report the barcodenumber must be 1 higher than the one before..0
-
I was just saying you could use a number series if you didn't want to create a custom field.
Take a look at the insert functions for sales header or purchase header to understand how number series are initialized and used.
Or just create a custom field and increment it.0 -
look at codeunit NoSeriesManagement (396)
there you will see a function called GetNextNo with these parameters:
NoSeriesCode (Code)
SeriesDate (Date)
ModifySeries (Boolean)
so pass in the number series code that you have created, today's date, and TRUE for Modify Series. If you pass in false it will return the next number but not update the series0 -
call this function from your report. probably best at the end onPostReport. and you will have to check whether or not the user is just previewing the report:
IF NOT CurrReport.PREVIEW THEN
noSeriesMgnt.getNextNo(...)
This means that the user will no longer be able to print from the preview window however.0 -
Thank you for your answers. I've solved it by creating a new table with one value. And in the report I rename the value to +1.0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions