folks. I'm trying to create a form that sums up how many names there are in a user-filled table. Essentially, find all the non-blank cells (with a certain variable name), and add 1 to the sum each time, then output that sum to a read-only form-fillable hyperref field. What's the best way to execute this?
I was able to figure out how to do basic summation calculations for integers, but haven't figured out how to sum up non-blank cells yet.
Code below:
\documentclass[letterpaper]{article}
\usepackage{hyperref}
\usepackage[left=0.25in, right=0.25in, bottom=0.5in]{geometry}
\usepackage{fontspec}
\usepackage{xcolor}
\usepackage{textcomp}
\usepackage{fancyhdr}
\usepackage{graphicx}
\usepackage{parskip}
\usepackage{eforms}
\definecolor{light-gray}{gray}{0.85}
\newcommand{\no}{\textnumero}
\newcommand{\dimrule}{\color{light-gray}\hrule}
\newcommand{\blank}[2]{
\textField[\BG{0.95 0.95 0.95}\W{0}\Q{1}]{#1}{#2}{1em}
}
\renewcommand{\arraystretch}{1.5}
\pagestyle{fancy}
\fancyhf{}
\rhead{Page \thepage}
\cfoot{}
\begin{document}
\begin{Form}
\begin{center}
\textbf{\large{}List}
\bigskip
\begin{tabular}{ll}
& Name\\
1. & \blank{listName1}{30ex}\\
2. & \blank{listName2}{30ex}\\
3. & \blank{listName3}{30ex}\\
4. & \blank{listName4}{30ex}\\
5. & \blank{listName5}{30ex}\\
6. & \blank{listName6}{30ex}\\
7. & \blank{listName7}{30ex}\\
8. & \blank{listName8}{30ex}\\
9. & \blank{listName9}{30ex}\\
10. & \blank{listName10}{30ex}\\
\end{tabular}
\bigskip
\begin{tabular}{ll}
Total Records Printed: & \TextField[
calculate={
%%%%%%%%%%%%%%%%%%%%%%
},
width=20ex,
readonly=true,
backgroundcolor={0.95 0.95 0.95},
bordercolor=
]{}\\
\end{tabular}
\end{center}
\end{Form}
\end{document}
The calculation that simply has "%%%%%%%%%%%%%%%%%" is where I have tried and failed with a number of different attempts.