Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I need a dynamic solution to produce questionnaires from a database of questions which gets updated from time to time. I thought of LaTeX for set out the layout but the question is whether LaTeX can import specified fields of an Acces or Excel or whatsoever external "database".

I also thought about WORD Macros and .NET programming, but I preferred LaTeX.

share|improve this question
1  
Is there a possibility to export in a plain text format, for example .csv? This is readily handled by TeX (provided the file is not too big!), but direct access to binary structures realistically requires LuaTeX. –  Joseph Wright Sep 10 '12 at 14:24
    
Maybe you can use SQLTeX. Alternatively, you might be interested in the @EASE system which is part of the AcroTeXtools. –  Martin Heller Sep 11 '12 at 20:25

2 Answers 2

If "whatsoever external database" may be a plain text file like this data.dat example:

Mr.
Peter
Smith
Newtown Road, Los Angeles, USA
209 \$


Ms. 
Maria 
Rossi
Regina Elena, 113, Milano, Italy
145 \euro

Where simply the field separators are carriage returns, then you can merge with a LaTeX document with the textmerg package as in this MWE:

\documentclass[12pt]{article}
\usepackage[utf8]{inputenc} 
\usepackage{eurosym}
\usepackage{textmerg} 
\begin{document}

\Fields{\Mr\Name\SurName\Address\Donation} 

{\bf Cots of donations to some good cause:}
\vspace{2ex}

\Merge{data.dat}{

\begin{tabular}{r|l}
Person & {\bf \Mr\ \Name\  \SurName }\\
Address & {\bf \Address }\\
Cost & {\bf \Donation } \\
\end{tabular}
\vspace{2ex}

}
\end{document}
share|improve this answer

Have a look at nlatexdb, I found it very useful.

http://www.ctan.org/pkg/nlatexdb

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.