[texhax] Need to store a value to be later called.

leggeb at aciworldwide.com leggeb at aciworldwide.com
Thu Aug 11 19:58:02 CEST 2005


Hello all,

I am using longtable to create a document that is data driven where I need 
to capture the last known balance in a transaction so it can be used in 
the head and foot.
I have tried using \newcounter, \newsavebox and \sbox, \savebox and 
\setcounter to store the value for later retrieval but I'm not getting the 
value I think I have set. 

I want to be able to set a value in memory (+ or  -  999,99) and update it 
every time a transaction is created.  When a page break occurs I want to 
retrieve that value
with in a command {\continuehead and \continuefoot).

What should I be using to accomplish this?

Here is a sample of what I am trying to do.


 \begin{longtable}{l}
       %% : Transaction Header
       \transactionheader\\
       \transactionstartbalance{+8926,12}
       \endfirsthead

       %% : Transaction Page Break Header
       \transactionheader\\
       \continuehead\\
       \endhead

       %% : Transaction Page Break Footer
       \continuefoot\\
       \endfoot
       %% : Transaction Turnover
       \transactionturnover{-7708,47}{+0,00}\\
       %% : Account Footer
       \accountfoot{+1217,65}\\
       \endlastfoot
 
 
   \transactiondata{2005/02/13}{2005/02/13}{PRZELEW OBCI¡¯ENIOWY} 
{F.NR.26/04-2437;37 F.NR.24/04-2390; 00  FIRMA US£UGOWA MARIUSZ BARCZYÑSKI 
MARIUSZ BARCZYÑSKI UL.£OWISKOWA 31 85-436 BYDGOSZCZ65 1020 1475 0000 8202 
0074 8566 PKOBP O/2 Bydgoszcz}{-4827,37}{+4098,75}\\

% : continues for multiple transactions that break the page boundary.
\end{longtable}

The commands that in question are as follows:

% : FUNCTION: TRANSACTIONDATA
\newcommand{\transactiondata}[6]{
%  \sffamily\fontseries{m}\fontshape{n}\selectfont
  \fontfamily{phv}\fontseries{m}\fontshape{n}\selectfont
  \small
  \parbox[t]{18.2cm}{
    \vskip.5pt
    \hskip.2cm\parbox[t]{2cm}{#1\hfil}
    \parbox[t]{2cm}{#2\hfil}
    \parbox[t]{8.5cm}{\parbox[t]{8cm}{#3\hfill} \linebreak #4\hfill}
    \parbox[t]{3cm}{\hfil\numprint{#5}}
    \parbox[t]{2cm}{\hfill\numprint{#6}}

% : Save the current transaction balance for later use.
%%%    \setcounter{transactionbalance}{#6}
%%%    \sbox{\transactionbalance}{#6}
    \vskip6pt\rule{18.2cm}{0.25pt}
  }
 
}

% : FUNCTION: CONTINUEHEAD
\newcommand{\continuehead}{
 
  \parbox{18.2cm}{
    \vskip2pt
    \small
    \hskip1cm\parbox{14cm}{\hfill Saldo z przeniesienia z popzednij 
strony}%
    \parbox{0.5cm}{~}%
% : Retrieve the last transaction balance
    \parbox{3.5cm}{\thetransactionbalance}
%    \vskip-3pt \rule{19.5cm}{0.25pt}
  }
}

% : FUNCTION: CONTINUEFOOT
\newcommand{\continuefoot}{
 
  \parbox{18.2cm}{
    \vskip2pt
    \small
    \hskip1cm\parbox{14cm}{\hfill Saldo do przeniesienia na 
nast\c{e}pn\c{a} stron\c{e}}%
    \parbox{0.5cm}{~}%
% : Retrieve the last transaction balance
    \parbox{3.5cm}{\thetransactionbalance}
  }
}




Brent Legge - Technical Lead
Professional Services - ACI Worldwide (MessagingDirect) 
email: leggeb at aciworldwide.com
I'm a prisoner of Lotus Notes, please excuse any email transgressions.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://tug.org/pipermail/texhax/attachments/20050811/10cf05a1/attachment.htm


More information about the texhax mailing list