Baanboard.com

Go Back   Baanboard.com > Forum > Baan SIGs > Code & Utilities

User login

Frontpage Sponsor

Main

Poll
For ERP LN feature pack upgrade, what method of install are you using?
Installation Wizard into existing VRC
35%
Installation Wizard into new VRC
42%
Manual into existing VRC
3%
Manual into new VRC
19%
Total votes: 31

Baanboard at LinkedIn


Reference Content

Reply
 
Thread Tools Display Modes
  #1  
Old 13th August 2002, 03:11
~Vamsi's Avatar
~Vamsi ~Vamsi is offline
Guru
 
Join Date: Aug 2001
Location: San Diego CA, USA
Posts: 590
~Vamsi will become famous soon enough
Baan: ~*~ - DB: ~*~ - OS: ~*~
Page x of y: Jo Büche's solution.

This solution first appeared on Baanfans on July 19, 1999 at 04:23:11 EST. It works only with Unix print queues and not with BWPrint (either Unix or Windows).

~Vamsi
Mohanavamsi Potluru

<hr>

<h1>"Page of" using Barcode-Functionality</h1>

A completly other way of printing the number of pages is to use Barcode-Functionality.
The Barcode-Feature (Warning : Works only for UNIX-Printers) is in fact a API-Interface for
printing. You can merge everything you want to an existing spool. And the merging ist done
after Baan has createed the whole printing, so Baan also knows the total amount of pages.
<p>
I tried my example with an Easy-SQL and it works really fine.
<p>
In short the example works like that:
<ul>
<li>Before printing I generate a unique Spool number and print it (!!) on the report in
a field, which is connected to a Barcode
<li>At the end of printing I write the unique number and the number of pages to an ASCII-File
<li>In the filter-Program of Baan (which puts the correct Escape-Sequences to a spool) I take the
Barcode-Script (which gets the unique number as parameter) and read the corresponding
number of pages. Instead of a barcode i merge the number of pages in the Spool - Output
<p><center><b>--> there we are !!!!</b></center>
</ul>
<p>
The greatest problem is not getting the Page - number, but managing the unique numbers.
<p>
<h2> How to use the example</h2>
<ul>
<li>Print in the header of your report something like "Page : VVVVVVV of FFFFFFFF",
where FFFFFFFF is the new field
(in my example <i>int.unique.s</i> of type tcmcs.str8 and with Barcode - Type 95)
Dont care of the warning : "Input field not declared" . <b>Do not declare the field as input field</b>
<li>Warning: I think there is an error in the Baan-Barcode-API, because, when the Barcode-Field
is the last field in a line the Printer-Daemon gets mad, so i added a "." (= point) after the
barcode-Field and everything works fine. (Note: a empty field of 1 Byte works also)
<li>paste the code on this site to the report-script
<li>create (once) a subdirectory under your $BSE_TMP-folder named "printing". Make sure, that
everyone has accessrights for this directory.
<li>for each Baan-Printer(device), you have to connect the printer to a Baan- Printer-information-File
(see "technical manual" in the online help). Normally every UNIX-printer is
already connected to a Printer-Driver
<li>for each (unix-)printer you want to work with this feature you have to change
the printer driver file ($BSE/lib/printinf/.....), so that it contains a link to a
barcode-directory (there must be a line "barcodedir=xxxxxxx,"; dont forget the comma)
<li>In the barcode-directory ($BSE/lib/barcode/xxxxxx; xxxxx = name of the barcode-Directory)
create the shellscript (Name type95)
</ul>
<p><p>
<h2>Report-Script :</h2>
Code:
|******************************************************************************
|* tdsqljo07   VRC B40C c4 entw
|* mehrere Seiten und Seite von
|* bj_104_a
|* 15.07.99 [14:05]
|******************************************************************************

declaration:
        long                    int.unique      | unique number (internal)
        domain  tcmcs.str8      int.unique.s

before.program:
        long    fp
        long    ok
        string  number(8)

        | Get unique number
        fp = seq.open(bse.tmp.dir$() & "/printing/unique.dat","r")
        int.unique = 0
        if fp > 0 then
                if seq.gets(number,8,fp) = 0 then
                        int.unique = lval(number)
                endif
                seq.close(fp)
        endif

        | Write new Unique number
        int.unique = int.unique + 1
        fp = seq.open(bse.tmp.dir$() & "/printing/unique.dat","w")
        if fp > 0 then
                seq.puts(edit$(int.unique,"ZZZZZZZ9"),fp)
                seq.close(fp)
        endif

        | Unique Number as string for printing
        int.unique.s = edit$(int.unique,"ZZZZZZZ9")

after.program:
        long fp

        fp = seq.open(bse.tmp.dir$() & "/printing/numbers.dat","a")
        if fp > 0 then
                seq.puts(       edit$(int.unique,"ZZZZZZZ9")&
                                ":" &
                                edit$(lattr.pageno,"ZZZZZ9"),fp)
                seq.close(fp)
        endif

<p><p>
<h2>Shell-Script</h2>
Code:
#!/bin/sh
#******************************************************************************
#
#   File           :      type95
#
#   jb             :      Print "Page of"
#******************************************************************************

# get unique number out of the printing string (8 Bytes)
unique="$1:"

# search the file with unique number for the string "Nr:xxxxxxxx"
tmpdat="`grep $unique $BSE_TMP/printing/numbers.dat`"

# get the column with the number of pages
tmpdat=`echo $tmpdat|cut -f2 -d:|head -1`

# merge the numer of pages in the spool-output
echo "$tmpdat\c"

# exit
exit 0
<hr>
I have to admit : I'm not very strong in shell-Scripting. For my Sun it works fine, but
I suppose for other UNIXES you have to change something on the script. I'm sure someone
could do this script in a better way.
<hr>
Make sure, that the shell-Script is executable !!
<p>
Make sure, that the 2 ASCII-Files in the directory "printing"
(and the directory itself) are accessible (UNIX-rights)
<p>
In case of error : Check the logfile ($BSE/log/log.filter6.1)

<p><hr><p>
The number for uniqueness ist 8 digits long, so I dont think, there will a be
a problem, but feel free to increment the size
<p>
Clear the file with the page numbers every month (or every weekend).
<hr>
<address>
Jo Büche<br>
Baan & Schuler GmbH<br>
jbueche@baan-schuler.com
</address>
Reply With Quote
Sponsored Links
  #2  
Old 6th July 2005, 05:46
Kingsto88 Kingsto88 is offline
Senior Member
 
Join Date: Oct 2004
Posts: 208
Kingsto88 is an unknown quantity at this point
Baan: Baan 4, Baan 5 - DB: SQL server, Informix - OS: Windows 2000, HP Unix
Confused

Hi,

Can you explain how to do this in simpler terms.
If I am using Windows, can i use this method?

Thanks and regards
Reply With Quote
  #3  
Old 6th July 2005, 08:16
norwim's Avatar
norwim norwim is offline
Guru
 
Join Date: Oct 2001
Location: Germany Moenchengladbach
Posts: 450
norwim is on a distinguished road
Baan: some - DB: more - OS: many
Quote:
Originally Posted by ~Vamsi
This solution first appeared on Baanfans on July 19, 1999 at 04:23:11 EST. It works only with Unix print queues and not with BWPrint (either Unix or Windows).
Quote:
Originally Posted by ~Vamsi
The Barcode-Feature (Warning : Works only for UNIX-Printers) is in fact a API-Interface for
printing.
Dear Kingsto88: What remains unclear here?

Vamsi: Very clever solution indeed. I like it *g*

regards

Norbert
__________________
Have a nice day
Reply With Quote
  #4  
Old 26th February 2009, 23:51
garias's Avatar
garias garias is offline
Member
 
Join Date: Feb 2002
Location: Ecuador
Posts: 44
garias is on a distinguished road
Baan: Baan IV b2, c2, c2 mcurr, Baan V ERP, Infor LN - DB: Oracle, Informix, SQL - OS: AIX, Solaris, Windows NT
Hello everybody:

I am researching this topic: "printing page x of y" in Baan ERP LN 6.1
I had reviewed this two important threads about this topic:
a) Vamsi - Kevin Brock's solution. Febrero de 2002
b) Vamsi - Jo Büche's solution. 12th August 2002,

Both oriented a Baan installed in a Unix S.O.
There are good job in these solutions.
Also I saw that these threads are of many years ago.

I want to know if there are an advance or upgrade in a generic o standard solution for this topic useful in windows or unix severs for Baan V or Baan LN.

Regards.

Gerardo
Reply With Quote
  #5  
Old 26th February 2009, 23:53
mark_h's Avatar
mark_h mark_h is offline
Guru
 
Join Date: Sep 2001
Location: Kentucky, USA
Posts: 6,903
mark_h will become famous soon enough
Baan: Baan 4C4 A&D1 - DB: Oracle - OS: Sun Solaris
Sorry to say - not that I am aware of. The best I have heard was there was a forms package that could be installed that would do this. I do not recall what the name was, but I do remember the cost was high.

Also please only post once. Here is the other thread gerardo refered to in the post.

Thanks
__________________
Mark

GO Cards!
My latest mantra - make sure you have latest stpapi patches and the latest session object. If on LN then please explore the option of using DAL2 functionality.

Shared Solutions for Baan systems provided free by Baan Board.
Play the Google game and help Baanboard get better rankings. Do your part. Click here to find how.
Reply With Quote
  #6  
Old 27th February 2009, 09:15
garias's Avatar
garias garias is offline
Member
 
Join Date: Feb 2002
Location: Ecuador
Posts: 44
garias is on a distinguished road
Baan: Baan IV b2, c2, c2 mcurr, Baan V ERP, Infor LN - DB: Oracle, Informix, SQL - OS: AIX, Solaris, Windows NT
Thumbs up I got a new solution for this thread!!

Hello Mark thanks for your answer.

Hello Everybody:

I was working yesterday and today in a solution.
- I delevoped a simple DLL with only a external function.
Features:

- You don´t have to pass parameters to this function.
- Only have to put the function in the after.program section of your report script
- And of course to put *GA* in the layout where you want that the total page number appear. As you can see
max a 9999 total pages because *GA* are four characters.
- This solution is for WIndows and Unix Baan Server. No matter in which S.O Server is installed Baan.
- At the present time the solution is for Infor LN 6.1. But I supposed that it could be work in previous versions.
- It function don´t have to process the report two times. only one time.
- You don´t have to put any additional conversion program in the device.
- I have tested it with a Windows printer (BW) and with some customized reports. (I am going to test with more devices..)

If you are interesting I may send you, by now, the DLL object as a "black box" to test it. When I finished it I could put it here.

A more complex case:
When you print a report with a range of documents
And you get some independent documents (e.g. invoices, orders) in
the same report (spooler) , and you have independent page numeration for every
document. And you want to print an independent total page number for every one
document.

The actual version of my dll don´t cover this last case. But I am going to work in this case.


That´s all

Gerardo

Last edited by garias : 2nd March 2009 at 14:37.
Reply With Quote
  #7  
Old 21st July 2009, 06:14
thaykhov thaykhov is offline
Member
 
Join Date: Sep 2007
Posts: 42
thaykhov is on a distinguished road
Baan: 6.1 - DB: MS SQL SERVER - OS: XP
HI Gerardo

Can you post your solution? I am looking for page x of y for my invoices/sales orders

Regards

Thay
Reply With Quote
  #8  
Old 26th November 2009, 20:49
Altrev Altrev is offline
Junior Member
 
Join Date: Oct 2009
Posts: 21
Altrev is on a distinguished road
Baan: BaaB IV c4 - DB: Informix - OS: HP-UX 11
Thumbs up Single pass, page x of y library

Quote:
Originally Posted by garias View Post
Hello Mark thanks for your answer.

Hello Everybody:

I was working yesterday and today in a solution.
- I delevoped a simple DLL with only a external function.
Features:

- You don´t have to pass parameters to this function.
- Only have to put the function in the after.program section of your report script
- And of course to put *GA* in the layout where you want that the total page number appear. As you can see
max a 9999 total pages because *GA* are four characters.
- This solution is for WIndows and Unix Baan Server. No matter in which S.O Server is installed Baan.
- At the present time the solution is for Infor LN 6.1. But I supposed that it could be work in previous versions.
- It function don´t have to process the report two times. only one time.
- You don´t have to put any additional conversion program in the device.
- I have tested it with a Windows printer (BW) and with some customized reports. (I am going to test with more devices..)

If you are interesting I may send you, by now, the DLL object as a "black box" to test it. When I finished it I could put it here.

A more complex case:
When you print a report with a range of documents
And you get some independent documents (e.g. invoices, orders) in
the same report (spooler) , and you have independent page numeration for every
document. And you want to print an independent total page number for every one
document.

The actual version of my dll don´t cover this last case. But I am going to work in this case.


That´s all

Gerardo
Hi Gerardo,

Did you had a chance to post your "Single pass: Page x of y" library?

I think that it will be a great tool.

Thanks.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Page Breaking in Reports vbainbridge Tools Development 8 22nd April 2016 18:14
Page x of y: Kevin Brock's solution. ~Vamsi Code & Utilities 4 5th January 2006 11:08
How to specify report page sizing for a non printer device Jabran Tools Development 1 3rd August 2004 12:39
Herstellkostenberechnung in BaaN 4c Kai's Forum Users Deutsches Forum 4 5th July 1999 00:00


All times are GMT +2. The time now is 18:47.


©2001-2017 - Baanboard.com - Baanforums.com