From: Charles Millar <millarc@verizon.net>
To: emacs-orgmode@gnu.org
Subject: Re: orgmode and a database
Date: Tue, 05 Apr 2016 16:01:38 -0400 [thread overview]
Message-ID: <570419A2.6090802@verizon.net> (raw)
In-Reply-To: <871t6kl50k.fsf@mat.ucm.es>
[-- Attachment #1: Type: text/plain, Size: 1792 bytes --]
Uwe,
On 04/05/2016 06:32 AM, Uwe Brauer wrote:
> > Hi,
> > On 04/04/2016 03:46 PM, Uwe Brauer wrote:
>
> > I have been using recutils with orgmode for more than year - still
> > learning of course. So far, my experience has been fine. I am still
> > developing some sort of standard databases, e.g. one for contacts,
> > another for finance type of records, etc.
>
> Do you have some example or a pointer or so. I don't know even how to
> start.
>
>
A caveat - I am slowly learning lisp - of any kind - and I have not
programmed in over 45 years (college).
See the attached files - one is a template for entering data into a
recfile and the other is a sample of how I use some of the data in that
recfile. I also have a couple of remote-descriptors so that I don't have
reinvent the wheel for every recfile.
Originally I set up an org capture template and switched modes for
entries into a refile, but this was not a "good" solution. In the
recutils list I mentioned org capture and perhaps it could be modified
to recutils, but I never sent Jose a use case.
> > Have you checked out the two recutils mailing lists? Not very
> > active at the moment. I mentioned in those lists that perhaps some
> > sort of capture much like org-capture might be useful, but have
> > made no further effort in that regards.
>
> > I picked up a excellent pointers as to using recutils to create
> > org-mode tables from Jose Marchesi's and Eric Shulte's ob-rec.el
> > discussion on this list back in 2011. I ultimately export the tables
> > and related text to LaTeXpdf docs.
>
> Could you provide me a link, please?
Here's the thread on Gmane
http://article.gmane.org/gmane.emacs.orgmode/37697/match=ob+rec+el
> Uwe Brauer
Charlie Millar
[-- Attachment #2: cm-estate-recfile-entries.el --]
[-- Type: text/x-emacs-lisp, Size: 1796 bytes --]
(defun cm-estate-rec-entries (Description File &optional Memo AccountDate AccountAmount Shares AccountSchedule1 AccountSchedule2 EstateTaxSchedule FiduciaryTaxSchedule ProceedsDate ProceedsAmount AccountSchedule3 AccountSchedule4 Beneficiary OtherAccount1 &optional CheckDate CheckNumber CheckAmount)
(goto-char (point-max))
(newline)
(interactive "sDescription: \nsFile: \nsMemo: \nsAccountDate: \nsAccountAmount: \nsShares: \nsAccountSchedule: \nsAccountSchedule: \nsEstateTaxSchedule: \nsFiduciaryTaxSchedule: \nsProceedsDate: \nsProceedsAmount: \nsAccountSchedule: \nsAccountSchedule: \nsBeneficiary: \nsOtherAccount: \nsCheckDate: \nsCheckNumber: \nsCheckAmount: ")
(insert "Description: " Description) (newline)
(insert "File: " File) (newline)
(insert "Memo: " Memo) (newline)
(insert "AccountDate: " AccountDate) (newline)
(insert "AccountAmount: " AccountAmount) (newline)
(insert "Shares: " Shares) (newline)
(insert "AccountSchedule: " AccountSchedule1) (newline)
(insert "AccountSchedule: " AccountSchedule2) (newline)
(insert "EstateTaxSchedule: " EstateTaxSchedule) (newline)
(insert "FiduciaryTaxSchedule: " FiduciaryTaxSchedule) (newline)
(insert "ProceedsDate: " ProceedsDate) (newline)
(insert "Proceeds: " ProceedsAmount) (newline)
(insert "AccountSchedule: " AccountSchedule3) (newline)
(insert "AccountSchedule: " AccountSchedule4) (newline)
(insert "Beneficiary: " Beneficiary) (newline)
(insert "OtherAccount: " OtherAccount1)
(if (y-or-n-p "Are those checkbook entries necessary?")
(progn
(newline)
(insert "OtherAccount: Checkbook") (newline)
(insert "CheckDate: " CheckDate) (newline)
(insert "CheckNumber: " CheckNumber) (newline)
(insert "CheckAmount: " CheckAmount) (newline))
(progn
(newline))))
[-- Attachment #3: cm-sample-recutil-latex.org --]
[-- Type: text/plain, Size: 1436 bytes --]
Not sure if this will help, but here is a sample set up for one of my documents that usually have 15 - 20 tables which first are called from a recutils and then passed to a source block for the table. (Please note that I use the numprint package, which does not "like" any text in a number only column, so there is a separate line for the initial row. I am still playing wihtthis)
#+Begin_example
Some text here which is followed by a table
#+LATEX:
\label{SCHEDA}
\begin{center}
\textbf{SCHEDULE A\\PRINCIPAL RECEIVED}
\end{center}
\setlength{\extrarowheight}{8pt}
\vspace{-3.0ex}
\ofoot{Schedule A}
#+NAME: SCHEDAP
#+ATTR_LATEX: :mode table :environment longtable :align p{60pt}p{60pt}p{240pt}p{60pt}
| Date | {{{cmhfill}}} Shares | Description | Inventory {{{cm2space}}} Value |
#+begin_src rec :data foo.rec :type Finance :fields AccountDate,Description,AccountAmount :results silent
(File = 'bar' && AccountSchedule = 'A')
#+end_src
#+RESULTS: SCHEDAP
#+NAME: SCHEDA
#+HEADER: :eval no
#+begin_src emacs-lisp :var table=SCHEDAP :exports results
(setq table (cons 'hline table))
(setq table (append table '(("|Total Schedule A"))))
(setq table (append table '(("\n#+TBLFM: at>$>=vsum(atI$>..at>>$>);%.2f::"))))
table
#+end_src
#+ATTR_LATEX: :mode table :environment longtable :align p{60pt}N{6}{3}p{250pt}N{8}{2}
#+RESULTS: SCHEDA
Some more text here
#+End_example
next prev parent reply other threads:[~2016-04-05 20:02 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-04 19:46 orgmode and a database Uwe Brauer
2016-04-04 20:19 ` Ken Mankoff
2016-04-05 10:31 ` Uwe Brauer
2016-04-05 13:01 ` Russell Adams
2016-04-04 20:27 ` Charles Millar
2016-04-05 10:32 ` Uwe Brauer
2016-04-05 13:12 ` Jose E. Marchesi
2016-04-05 16:37 ` Uwe Brauer
2016-04-05 17:03 ` Jose E. Marchesi
2016-04-05 17:36 ` Uwe Brauer
2016-04-05 21:27 ` Uwe Brauer
2016-04-05 20:01 ` Charles Millar [this message]
2016-04-05 20:32 ` Charles Millar
2016-04-05 10:43 ` Colin Baxter
2016-04-05 11:41 ` Charles Millar
2016-04-05 13:04 ` Colin Baxter
2016-04-05 14:02 ` Charles Millar
2016-04-05 14:03 ` Eric S Fraga
2016-04-05 14:40 ` Jose E. Marchesi
2016-04-05 16:18 ` Eric S Fraga
2016-04-05 13:02 ` Jose E. Marchesi
2016-04-05 13:49 ` Colin Baxter
2016-04-05 13:49 ` Colin Baxter
2016-04-05 14:04 ` Jose E. Marchesi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.orgmode.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=570419A2.6090802@verizon.net \
--to=millarc@verizon.net \
--cc=emacs-orgmode@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).