[GNC] I just need a line feed

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

[GNC] I just need a line feed

Richard Marmor
   On 1/27 I posted the request for help below to which there have been
   no replies.  Is there no one out there who understands .SCM files?
   Help . . .
   -----------------------------------------------------------------------
   ------------------
   In Gnucash 2.6.21, the standard report title for an Income Statement
   appears as:
   [Company Name][Report Title] For Period Covering [start date] to [end
   date]
   all on one long line, which for my purposes is too lengthy.
   In the report's generator file, income-statement.scm, I found this:
   (gnc:html-document-set-title!
    doc (sprintf #f
            (string-append "%s %s "
                     (_ "For Period Covering %s to %s"))
            company-name report-title
                  (gnc-print-date start-date-printable)
                  (gnc-print-date end-date-tp)))
   Can someone please tell me how to modify that to insert a line feed
   so the report title will appear on two lines as:
              [Company Name][Report Title]
               For Period Covering [start date] to [end date]
   I am not a programmer.  I tried reading some of the help information
   among the SCM files, but frankly it was all Greek to me. Help would
   be appreciated.
   Thank you!
_______________________________________________
gnucash-user mailing list
[hidden email]
To update your subscription preferences or to unsubscribe:
https://lists.gnucash.org/mailman/listinfo/gnucash-user
If you are using Nabble or Gmane, please see https://wiki.gnucash.org/wiki/Mailing_Lists for more information.
-----
Please remember to CC this list on all your replies.
You can do this by using Reply-To-List or Reply-All.
Reply | Threaded
Open this post in threaded view
|

Re: [GNC] I just need a line feed

Derek Atkins-3
Hi,

On Thu, February 7, 2019 3:34 pm, Richard Marmor wrote:
[snip]

>    (gnc:html-document-set-title!
>     doc (sprintf #f
>             (string-append "%s %s "   <------ add <br> here
>                      (_ "For Period Covering %s to %s"))
>             company-name report-title
>                   (gnc-print-date start-date-printable)
>                   (gnc-print-date end-date-tp)))
>    Can someone please tell me how to modify that to insert a line feed
>    so the report title will appear on two lines as:
>               [Company Name][Report Title]
>                For Period Covering [start date] to [end date]
>    I am not a programmer.  I tried reading some of the help information
>    among the SCM files, but frankly it was all Greek to me. Help would
>    be appreciated.

Have you tried adding <br> at the end of the "%s %s" above?

>    Thank you!

> Please remember to CC this list on all your replies.
> You can do this by using Reply-To-List or Reply-All.

-derek

--
       Derek Atkins                 617-623-3745
       [hidden email]             www.ihtfp.com
       Computer and Internet Security Consultant

_______________________________________________
gnucash-user mailing list
[hidden email]
To update your subscription preferences or to unsubscribe:
https://lists.gnucash.org/mailman/listinfo/gnucash-user
If you are using Nabble or Gmane, please see https://wiki.gnucash.org/wiki/Mailing_Lists for more information.
-----
Please remember to CC this list on all your replies.
You can do this by using Reply-To-List or Reply-All.
Reply | Threaded
Open this post in threaded view
|

Re: [GNC] I just need a line feed

stevecoh2@gmail.com
In reply to this post by Richard Marmor
I'm not a developer of gnucash so take this with a grain of salt, but
putting a '\n' where you want the line feed might work.  If you're on
windows, you might need to do '\n\r'.  Try it, maybe it's a help to you,
but no guarantees.

On 2/7/19 2:34 PM, Richard Marmor wrote:

>     On 1/27 I posted the request for help below to which there have been
>     no replies.  Is there no one out there who understands .SCM files?
>     Help . . .
>     -----------------------------------------------------------------------
>     ------------------
>     In Gnucash 2.6.21, the standard report title for an Income Statement
>     appears as:
>     [Company Name][Report Title] For Period Covering [start date] to [end
>     date]
>     all on one long line, which for my purposes is too lengthy.
>     In the report's generator file, income-statement.scm, I found this:
>     (gnc:html-document-set-title!
>      doc (sprintf #f
>              (string-append "%s %s "
>                       (_ "For Period Covering %s to %s"))
>              company-name report-title
>                    (gnc-print-date start-date-printable)
>                    (gnc-print-date end-date-tp)))
>     Can someone please tell me how to modify that to insert a line feed
>     so the report title will appear on two lines as:
>                [Company Name][Report Title]
>                 For Period Covering [start date] to [end date]
>     I am not a programmer.  I tried reading some of the help information
>     among the SCM files, but frankly it was all Greek to me. Help would
>     be appreciated.
>     Thank you!
> _______________________________________________
> gnucash-user mailing list
> [hidden email]
> To update your subscription preferences or to unsubscribe:
> https://lists.gnucash.org/mailman/listinfo/gnucash-user
> If you are using Nabble or Gmane, please see https://wiki.gnucash.org/wiki/Mailing_Lists for more information.
> -----
> Please remember to CC this list on all your replies.
> You can do this by using Reply-To-List or Reply-All.
>

_______________________________________________
gnucash-user mailing list
[hidden email]
To update your subscription preferences or to unsubscribe:
https://lists.gnucash.org/mailman/listinfo/gnucash-user
If you are using Nabble or Gmane, please see https://wiki.gnucash.org/wiki/Mailing_Lists for more information.
-----
Please remember to CC this list on all your replies.
You can do this by using Reply-To-List or Reply-All.
Reply | Threaded
Open this post in threaded view
|

Re: [GNC] I just need a line feed

Stephen M. Butler
In reply to this post by Richard Marmor
On 2/7/19 12:34 PM, Richard Marmor wrote:

>    On 1/27 I posted the request for help below to which there have been
>    no replies.  Is there no one out there who understands .SCM files?
>    Help . . .
>    -----------------------------------------------------------------------
>    ------------------
>    In Gnucash 2.6.21, the standard report title for an Income Statement
>    appears as:
>    [Company Name][Report Title] For Period Covering [start date] to [end
>    date]
>    all on one long line, which for my purposes is too lengthy.
>    In the report's generator file, income-statement.scm, I found this:
>    (gnc:html-document-set-title!
>     doc (sprintf #f
>             (string-append "%s %s "
>                      (_ "For Period Covering %s to %s"))
>             company-name report-title
>                   (gnc-print-date start-date-printable)
>                   (gnc-print-date end-date-tp)))
>    Can someone please tell me how to modify that to insert a line feed
>    so the report title will appear on two lines as:
>               [Company Name][Report Title]
>                For Period Covering [start date] to [end date]
>    I am not a programmer.  I tried reading some of the help information
>    among the SCM files, but frankly it was all Greek to me. Help would
>    be appreciated.
>    Thank you!
> _


I'm slowly learning Scheme.  I general a <LF> is a decimal 10 or 0x0A in
the ASCII collating sequence.  In the Nix world you can use an \n to
represent it.

Try changing:  "For Period Covering %s to %s"

               To:  "\nFor Period Covering %s to %s"


Or do a search for "linefeed in Scheme".  Scheme may need a way for you
to escape the escape sequence.  Don't know.

--
Stephen M Butler, PMP, PSM
[hidden email]
[hidden email]
253-350-0166
-------------------------------------------
GnuPG Fingerprint:  8A25 9726 D439 758D D846 E5D4 282A 5477 0385 81D8

_______________________________________________
gnucash-user mailing list
[hidden email]
To update your subscription preferences or to unsubscribe:
https://lists.gnucash.org/mailman/listinfo/gnucash-user
If you are using Nabble or Gmane, please see https://wiki.gnucash.org/wiki/Mailing_Lists for more information.
-----
Please remember to CC this list on all your replies.
You can do this by using Reply-To-List or Reply-All.
Reply | Threaded
Open this post in threaded view
|

Re: [GNC] I just need a line feed

Derek Atkins-3
In reply to this post by stevecoh2@gmail.com
Hi,

On Thu, February 7, 2019 3:47 pm, Steve Cohen wrote:
> I'm not a developer of gnucash so take this with a grain of salt, but
> putting a '\n' where you want the line feed might work.  If you're on
> windows, you might need to do '\n\r'.  Try it, maybe it's a help to you,
> but no guarantees.

Nope, that's very unlikely to do what you want, because it's processed by
an HTML parser and \n means nothing to that.

> Please remember to CC this list on all your replies.
> You can do this by using Reply-To-List or Reply-All.

-derek

--
       Derek Atkins                 617-623-3745
       [hidden email]             www.ihtfp.com
       Computer and Internet Security Consultant

_______________________________________________
gnucash-user mailing list
[hidden email]
To update your subscription preferences or to unsubscribe:
https://lists.gnucash.org/mailman/listinfo/gnucash-user
If you are using Nabble or Gmane, please see https://wiki.gnucash.org/wiki/Mailing_Lists for more information.
-----
Please remember to CC this list on all your replies.
You can do this by using Reply-To-List or Reply-All.
Reply | Threaded
Open this post in threaded view
|

Re: [GNC] I just need a line feed

Derek Atkins-3
In reply to this post by Stephen M. Butler
Hi,

On Thu, February 7, 2019 3:51 pm, Stephen M. Butler wrote:
>
> I'm slowly learning Scheme.  I general a <LF> is a decimal 10 or 0x0A in
> the ASCII collating sequence.  In the Nix world you can use an \n to
> represent it.

This wont help because it's being parsed by an HTML parser.

> Try changing:  "For Period Covering %s to %s"
>
>                To:  "\nFor Period Covering %s to %s"

This will break the translation.  You don't want to modify a (_ ...) string.

> Please remember to CC this list on all your replies.
> You can do this by using Reply-To-List or Reply-All.

-derek

--
       Derek Atkins                 617-623-3745
       [hidden email]             www.ihtfp.com
       Computer and Internet Security Consultant

_______________________________________________
gnucash-user mailing list
[hidden email]
To update your subscription preferences or to unsubscribe:
https://lists.gnucash.org/mailman/listinfo/gnucash-user
If you are using Nabble or Gmane, please see https://wiki.gnucash.org/wiki/Mailing_Lists for more information.
-----
Please remember to CC this list on all your replies.
You can do this by using Reply-To-List or Reply-All.
Reply | Threaded
Open this post in threaded view
|

Re: [GNC] I just need a line feed

David Carlson-4
I am faced with inserting linefeeds into OFX files at certain critical
locations to make them more palatable to libofx.  In that context I have
found that I can open them with LibreOffice, turn on Formatting Marks (Ctrl
F10) then place the curser wherever I want a linefeed and press
Shift-Enter.  Last, I need to be sure to save the file with a modified
filename but the original suffix in text-only format.

That is working for me.  Of course the linefeeds do need to be correctly
placed for the application.

David Carlson

On Thu, Feb 7, 2019 at 3:06 PM Derek Atkins <[hidden email]> wrote:

> Hi,
>
> On Thu, February 7, 2019 3:51 pm, Stephen M. Butler wrote:
> >
> > I'm slowly learning Scheme.  I general a <LF> is a decimal 10 or 0x0A in
> > the ASCII collating sequence.  In the Nix world you can use an \n to
> > represent it.
>
> This wont help because it's being parsed by an HTML parser.
>
> > Try changing:  "For Period Covering %s to %s"
> >
> >                To:  "\nFor Period Covering %s to %s"
>
> This will break the translation.  You don't want to modify a (_ ...)
> string.
>
> > Please remember to CC this list on all your replies.
> > You can do this by using Reply-To-List or Reply-All.
>
> -derek
>
> --
>        Derek Atkins                 617-623-3745
>        [hidden email]             www.ihtfp.com
>        Computer and Internet Security Consultant
>
> _______________________________________________
> gnucash-user mailing list
> [hidden email]
> To update your subscription preferences or to unsubscribe:
> https://lists.gnucash.org/mailman/listinfo/gnucash-user
> If you are using Nabble or Gmane, please see
> https://wiki.gnucash.org/wiki/Mailing_Lists for more information.
> -----
> Please remember to CC this list on all your replies.
> You can do this by using Reply-To-List or Reply-All.
>
_______________________________________________
gnucash-user mailing list
[hidden email]
To update your subscription preferences or to unsubscribe:
https://lists.gnucash.org/mailman/listinfo/gnucash-user
If you are using Nabble or Gmane, please see https://wiki.gnucash.org/wiki/Mailing_Lists for more information.
-----
Please remember to CC this list on all your replies.
You can do this by using Reply-To-List or Reply-All.
Reply | Threaded
Open this post in threaded view
|

Re: [GNC] I just need a line feed

Richard Marmor
In reply to this post by Derek Atkins-3
   Thank you for the prompt reply!
   It worked!
   After a couple of failed tries, I found that it works if the <br> is
   inserted inside of the closing quotes:
       (string-append "%s %s <br>"
   Much appreciated.
   At 01:45 PM Thursday, Derek Atkins wrote:

     Content-Transfer-Encoding: 8bit
     Hi,
     On Thu, February 7, 2019 3:34 pm, Richard Marmor wrote:
     [snip]
     >    (gnc:html-document-set-title!
     >     doc (sprintf #f
     >             (string-append "%s %s "   <------ add <br> here
     >                      (_ "For Period Covering %s to %s"))
     >             company-name report-title
     >                   (gnc-print-date start-date-printable)
     >                   (gnc-print-date end-date-tp)))
     >    Can someone please tell me how to modify that to insert a line
     feed
     >    so the report title will appear on two lines as:
     >               [Company Name][Report Title]
     >                For Period Covering [start date] to [end date]
     >    I am not a programmer.  I tried reading some of the help
     information
     >    among the SCM files, but frankly it was all Greek to me. Help
     would
     >    be appreciated.
     Have you tried adding <br> at the end of the "%s %s" above?
     >    Thank you!
     > Please remember to CC this list on all your replies.
     > You can do this by using Reply-To-List or Reply-All.
     -derek
     --
            Derek Atkins                 617-623-3745
            [hidden email]             [1]www.ihtfp.com
            Computer and Internet Security Consultant

References

   1. http://www.ihtfp.com/
_______________________________________________
gnucash-user mailing list
[hidden email]
To update your subscription preferences or to unsubscribe:
https://lists.gnucash.org/mailman/listinfo/gnucash-user
If you are using Nabble or Gmane, please see https://wiki.gnucash.org/wiki/Mailing_Lists for more information.
-----
Please remember to CC this list on all your replies.
You can do this by using Reply-To-List or Reply-All.
Reply | Threaded
Open this post in threaded view
|

Re: [GNC] I just need a line feed

Geert Janssens-4
In reply to this post by David Carlson-4
Op donderdag 7 februari 2019 23:15:18 CET schreef David Carlson:
> I am faced with inserting linefeeds into OFX files at certain critical
> locations to make them more palatable to libofx.  In that context I have
> found that I can open them with LibreOffice, turn on Formatting Marks (Ctrl
> F10) then place the curser wherever I want a linefeed and press
> Shift-Enter.  Last, I need to be sure to save the file with a modified
> filename but the original suffix in text-only format.
>
> That is working for me.  Of course the linefeeds do need to be correctly
> placed for the application.

That's a completely different story :)

The OFX parser is not an html parser, though both are based on SGML in one way
or another. And the OFX parser has a bug causing it to misinterpret certain
tags. By sheer luck the bug is not triggered if that tag is on a line of its
own.

However the html parser has no bug. Html be definition ignores newlines in
textual data. The "\n" people refer to here is just a coder's representation
of that newline. So the html parser will ignore it.

In this case Derek offered the proper solution: use <br> instead.

Regards,

Geert


_______________________________________________
gnucash-user mailing list
[hidden email]
To update your subscription preferences or to unsubscribe:
https://lists.gnucash.org/mailman/listinfo/gnucash-user
If you are using Nabble or Gmane, please see https://wiki.gnucash.org/wiki/Mailing_Lists for more information.
-----
Please remember to CC this list on all your replies.
You can do this by using Reply-To-List or Reply-All.