Problem with report export to Excel when using column styles

(7 posts) (3 voices)
  1. synchoid, Member

    We're experiencing a problem since the newest update when exporting directly to Excel. We have column styles, ex: \$%.2f, that show up just fine within the browser. However, when exporting to Excel, the data now exports as $8,365$%.2f. The problem is verified in Excel 2007 and Excel 2003.

    Please advise. Thanks!

  2. myDBR Team, Key Master

    Hi,
    We've made some improvements to exports after some trouble with formatted reports. The improvements are rolled into newer builds that can be obtained by automatic updater. Latest is 2.2.1, build 831, which should work better with export formats.

    To obtain the latest build go to About->Update Now and make an update. The version number is kept same since we are working on the next releses with new functionality and we're trying keep the required update cycle reasonable.

    --
    myDBR Team

  3. brad@foreverybody, Blocked

    I have problem with formated columns that may be related.

    I am trying to prepend a $ to a format where text is green for positive black for 0 and red for negative, but putting the $ anywhere in the style definition makes the text all black. here is my format string: [color: green;]$%.2f;$%.2f;[color: red;]$%.2f. I did try escaping the $ with a \ but that just output \$.

    I was going to work around the issue using a :before selector and the CSS content property to do it but myDBR doesnt assign the column any attribute based off my style definition. If fixing the format string is too difficult/impossible could you guys make myDBR assign the table cell an additional class named after the style?

    like OP i have noticed odd things when exporting to Excel the one that was not mentioned was when a style format sting contains a literal % (ie %.2f%%) then excel shows 2 % signs. not a big deal, but I though it was worth mentioning.

  4. myDBR Team, Key Master

    Hi,
    we'll fix both of these (prefix issue and %% formatting) in the next update. If we'll make an extra build, we'll make a post to this thread. Thanks for reporting this.

    If fixing the format string is too difficult/impossible could you guys make myDBR assign the table cell an additional class named after the style?

    Not quite sure if you meant this but, you can add own classes to columns (dbr.colclass), rows (dbr.rowclass) and the whole result set (dbr.resultclass). See:
    Applying styles

    --
    myDBR Team

  5. brad@foreverybody, Blocked

    Perfect. dbr.colclass was the answer; somehow i missed that in the docs before. Cheers!

    Edit: guess I may as well share my solution in case anybody else likes $ prepended to their monetary table cells.

    in your report sql use "select 'dbr.colclass', col#, 'dollars';"

    then in your userstyle.css file put this:

    .dollars:before{
    content:'$';
    }

  6. myDBR Team, Key Master

    Hi,
    dbr.*class commands were added in last update in purpose of moving the formatting out of the reports and trying to keep the priciple "less is more". While support for CSS (especially CSS3) improves on browsers this will be a powerful way of applying formats.

    We did put a newer build into downloads that fixes the problems with formatting. You can use the autoupdater to get it.

    --
    myDBR Team

  7. brad@foreverybody, Blocked

    Yes I totally agree that formatting should be done with CSS whenever possible. Ill check out that new build. Thanks guys!


Reply

You must log in to post.