From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?utf-8?Q?S=C3=A9bastien_Vauban?= Subject: Automate the writing of proposals (by using dynamic blocks) Date: Wed, 08 Sep 2010 16:42:06 +0200 Message-ID: <87mxrsthz5.fsf@mundaneum.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org-mXXj517/zsQ@public.gmane.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org-mXXj517/zsQ@public.gmane.org To: emacs-orgmode-mXXj517/zsQ@public.gmane.org Hello, I'm trying to automate the writing of proposals. Just a couple of tasks to describe, to evaluate, and then put a price on the total amount. That's abo= ut it. Though, I have some problems making that dream a full reality yet, even if = Org already makes me go really far! The following is an minimal example of what I try to achieve, and of the different problems and questions related to it. Thanks for helping. --8<---------------cut here---------------start------------->8--- #+TITLE: Using columnview dynamic blocks #+AUTHOR: Seb Vauban #+DATE: 2010-09-08 #+LANGUAGE: en_US * Context ** Current implementation This is what I understood. ** Objectives This is what should be done. ** Tasks to do :PROPERTIES: :COLUMNS: %40ITEM(Task) %6Effort(Estim.){+} :Effort_ALL: 0.25 0.50 1.00 1.50 2.00 3.00 4.00 5.00 7.00 10.00 :ID: ddfb9674-ce79-4ecc-8699-da5af2c12f6b :END: *** Analyze the steps :PROPERTIES: :Effort: 0.25 :END: *** Implement the full chain :PROPERTIES: :Effort: 1.50 :END: *** Test the whole lot :PROPERTIES: :Effort: 3.00 :END: * Proposal ** Work Generated dynamic block: #+BEGIN: columnview :hlines 2 :id "ddfb9674-ce79-4ecc-8699-da5af2c12f6b" | Task | Estim. | |------------------------------+--------| | ** Tasks to do | 4.75 | | *** Analyze the steps | 0.25 | | *** Implement the full chain | 1.50 | | *** Test the whole lot | 3.00 | #+END: Though, I would like to get it more like this: #+TBLNAME: prestations | | \textbf{Task} | \textbf{Description} | \textbf{p.j} | |---+---------------+--------------------------+--------------| | | Task 1 | Analyze the steps | 0.25 | | | Task 2 | Implement the full chain | 1.50 | | | Task 3 | Test the whole lot | 3.00 | |---+---------------+--------------------------+--------------| | # | | \textbf{Total} | 4.75 | | ^ | | | total | #+TBLFM: $total=3Dvsum(@-I..@-II);%.2f Wait a minute! I did not say it must be exactly like that, but I would like, for example, to get rid of the multiple stars, and have an =3Dhline=3D sepa= rating the total from the individual components of the sum. ** Finance Then, from the above, we can compute the cost to write in the proposal, lik= e: | Total of prestations (in man days) | 4.75 | m.d | | Daily rate | 400.00 | \EUR | | Total price | 1900.00 | \EUR | #+TBLFM: @1$2=3Dremote(prestations,$total);%.2f::@3$2=3D@1$2*@2$2;%.2f * Problems, comments and questions <<< <<< <<< 5 topics: ** Table column names in bold I would like (my boss, to be honest) to see the headings of the table in bo= ld. Wait, this is minor, but I discovered something special when trying to do s= o. I put =3D*=3D around the word =3DTask=3D in the =3D:COLUMNS:=3D specificati= on of the tasks subtree: #+begin_src org ,:COLUMNS: %40ITEM(Task) %6Effort(Estim.){+} #+end_src That automatically inserts an extra =3Dhline=3D above the table. Quite weir= d, but OK. #+BEGIN: columnview :hlines 2 :id "ddfb9674-ce79-4ecc-8699-da5af2c12f6b" |------------------------------+--------| | *Task* | Estim. | |------------------------------+--------| | ** Tasks to do | 4.75 | | *** Analyze the steps | 0.25 | | *** Implement the full chain | 1.50 | | *** Test the whole lot | 3.00 | #+END: ** Use two-decimal floats in cells I needs amounts such as =3D0.25=3D, =3D0.50=3D and =3D1.50=3D as efforts. *** Writing them in Effort\_ALL with 2 decimals Writing the figures with 2 decimals in =3DEffort_ALL=3D has no impact on the presentation in the table... What you see in the table comes "verbatim" from the =3DEffort=3D property i= tself: if you get there 2 decimals, then you'll have 2 decimals in the table outpu= t. Though, having a 2-decimal in the property =3DEffort=3D gives troubles to t= he table editor: - Write =3D:Effort: 3.00=3D, then =3DS-right=3D that value: it begins back = from =3D0.25=3D... - Write =3D:Effort: 3.0=3D, then =3DS-right=3D that value: it goes on to = =3D4.0=3D. *** Using formatting of decimals Trying to declare how many decimals I want. For the sake of clarity, ask for 4=C2=A0decimals: #+begin_src org ,:COLUMNS: %40ITEM(Task) %6Effort(Estim.){+;%.4f} #+end_src It only works for the total, though... Not applied to the column itself. #+BEGIN: columnview :hlines 2 :id "ddfb9674-ce79-4ecc-8699-da5af2c12f6b" | Task | Estim. | |------------------------------+--------| | ** Tasks to do | 4.7500 | | *** Analyze the steps | 0.25 | | *** Implement the full chain | 1.50 | | *** Test the whole lot | 3.0 | #+END: ** Have an hline between individual tasks and total To get something like this: #+BEGIN: columnview :hlines HOW? :id "ddfb9674-ce79-4ecc-8699-da5af2c12f6b" | Task | Estim. | |------------------------------+--------| | ** Tasks to do | 4.75 | |------------------------------+--------| | *** Analyze the steps | 0.25 | | *** Implement the full chain | 1.50 | | *** Test the whole lot | 3.00 | #+END: I guess the implementation must be changed, as neither 2 nor 3 are right values for such a thing. The definition says: =3D:hlines=3D When t, insert an hline after every line. When a number N, insert an hl= ine before each headline with level <=3D N. Here, I would wanna change it to: "insert an hline before *and after* each level=C2=A0N headline". In fact, that would become clearer if the only distinction between the leve= ls was not limited to the number of stars before the name of the task. The table I showed above is *not* the only way to make the difference betwe= en totals and cells explicit. It's just an example... ** Get rid of stars? Is there a way to get rid of the common amount of stars? I mean: if the top headline is at level 3, get rid of 2 stars everywhere in the table. ** Use the total number of days? As you see in my manual block, I give a name to the cell containing the tot= al, so that I can use that figure for computing how much the work will cost. How can we do such a thing with the dynamic block? --8<---------------cut here---------------end--------------->8--- Best regards, Seb --=20 S=C3=A9bastien Vauban _______________________________________________ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode-mXXj517/zsQ@public.gmane.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode