Skip to main content
August 2, 2013
Answered

Applying formatting to query values using CFSPREADSHEET

  • August 2, 2013
  • 1 reply
  • 606 views

I'm trying to figure out how to properly apply my custom border line formatting to my query values only on an automated report. Currently, I have it where it is hard coded, but long term it would not work since new values will be added to the database and the report query values would be generated without the border line formatting, unless I manually change the row numbers everytime.

Here's the formatting I'm using:

    format4.topborder="thin";

    format4.topbordercolor="grey_40_percent";

    format4.bottomborder="thin";

    format4.bottombordercolor="grey_40_percent";

    format4.leftborder="thin";

    format4.leftbordercolor="grey_40_percent";

    format4.rightborder="thin";

    format4.rightbordercolor="grey_40_percent";

    SpreadsheetFormatCellRange(report,format4, 2,1,26,8);

    This topic has been closed for replies.
    Correct answer Donald Baert

    Have you tried setting a variable equal to the number of records you are pulling from the database?  I have done that in several cfspreadsheets and it works as good as setting a counter counting the number off loops through the data.

    1 reply

    Donald BaertCorrect answer
    Inspiring
    August 5, 2013

    Have you tried setting a variable equal to the number of records you are pulling from the database?  I have done that in several cfspreadsheets and it works as good as setting a counter counting the number off loops through the data.

    August 6, 2013

    Excellent Suggestion! Here's what I ended up doing:

    <cfset custCount ="#getCustinfo.recordcount#" + 1 />

        format4.topborder="thin";

        format4.topbordercolor="grey_40_percent";

        format4.bottomborder="thin";

        format4.bottombordercolor="grey_40_percent";

        format4.leftborder="thin";

        format4.leftbordercolor="grey_40_percent";

        format4.rightborder="thin";

        format4.rightbordercolor="grey_40_percent";

        SpreadsheetFormatCellRange(report,format4, 2,1,"#custCount#",8);

    Thanks a bunch!