Manipulating the Column name in the Header of the Grid table

(4 posts) (2 voices)

Tags:

  1. shem, Member

    In plain MySQL if I have the statement
    select 1 as "Account\nNumber";
    with a backslash n between the two words,
    then it outputs the Word Account ON TOP of the word Number.

    This is something I would like to happen in the output of my myDBR report, because while the data of the Account number is a two digit number which takes up only two characters, nevertheless the column name "Account Number" takes up 15 characters.
    However, when I tried it in my report, I found that it displayed in the table header "Account Number" on the same line
    This causes a problem when I have many columns and I export to PDF.
    Any suggestions?
    I have already tried a bunch of things, so if you know of something that works, I would appreciate if you could please give me a very explicit answer, instead of referring me to somewhere in the documentation.
    Thank you in advance.

  2. myDBR Team, Key Master

    MySQL xommand line is different from HTML report that myDBR produces.

    To have a linebreak in HTML you can use < br>. For security reasons myDBR encodes HTML code. You can bypass this by explicitly telling myDBR not to encode HTML via dbr.html:-command.

    To show Account Number in two lines, you can use:

    select AccountNumber as 'dbr.html:Account< br>Number'

    Note: remove the space between < and br. The forum software does not like HTML code.

    --
    myDBR Team

  3. shem, Member

    Thank you it worked.

    Just curious if an entire select can be put in a dbr.html statement.
    Something like
    select 'dbr.html', column1, colum2 As Account
    Number, column3 As Customer
    Number from Table 1;
    ?

  4. myDBR Team, Key Master

    The dbr.html is a separate command for passing the query result as HTML. The dbr.html: as text prefix will treat the individual string as HTML code. See the documentation.

    --
    myDBR Team


Reply

You must log in to post.