Skip to main content
Inspiring
January 9, 2023
Question

Format part of a cell with CFSpreadSheet

  • January 9, 2023
  • 3 replies
  • 1327 views

I would like to be able to format part of a cell so that the output looks like:

Updated for SSEWG: Yes Date: 8/31/2022

instead of having to put each section into a different cell like:

Updated for SSEWG:YesDate:31-Aug-2022                
    This topic has been closed for replies.

    3 replies

    Inspiring
    January 9, 2023

    Using ColdFusion CFSpreadSheet to format part of a cell.

    Charlie Arehart
    Community Expert
    Community Expert
    January 9, 2023

    Robert, you can help us help you by showing what sort of code first puts those values into those cells. 

     

    For instance, if it's using SpreadSheetAddRows(), which puts query results into a sheet, you could control a single column being comprised of text (formatted) and data by way of the sql SELECT statement.

     

    Or if you have no such control over how the sheet is populated, note that there's a function to merge cells, spreadsheet merge cells.

     

    Or perhaps in seeing your code, we may have still other suggestions.

    /Charlie (troubleshooter, carehart. org)
    Inspiring
    January 9, 2023

    The problem is that I want to put all the values into one cell and have part of it bold and part not bold.  Currently the only way I found to do this, is to put each field into a different cell and format each cell separatly.  If you merge the cells, you lose the data from the other cells:

    <cfset SpreadsheetAddRow(xl,"Log Number:")>
    <cfset SpreadsheetFormatCell(xl,{font="Verdana",bold="true",fontsize="8"},#xl.rowcount#,1)>
    <cfset SpreadsheetSetCellValue(xl,"#Details.LogNumber#",#xl.rowcount#,2,"string")>
    <cfset SpreadsheetFormatCell(xl,{font="Verdana",fontsize="8"},#xl.rowcount#,2)>
    <cfset SpreadsheetSetCellValue(xl,"Status:",#xl.rowcount#,3)>
    <cfset SpreadsheetFormatCell(xl,{font="Verdana",bold="true",fontsize="8"},#xl.rowcount#,3)>

    produces the output:

    Log Number: 2022-008-0001 Status: Active

    I want to put the values into one cell like:

    Log Number: 2022-008-0001 Status:  Active
    kglad
    Community Expert
    Community Expert
    January 9, 2023

    in the future, to find the best place to post your message, use the list here, https://community.adobe.com/

     

    p.s. i don't think the adobe website, and forums in particular, are easy to navigate, so don't spend a lot of time searching that forum list. do your best and we'll move the post if it helps you get responses.

     

    <moved from using the community>

    Peru Bob
    Community Expert
    Community Expert
    January 9, 2023

    This is the Using the Community forum (which is the forum for issues using the forums).
    Please tell us what Adobe application you are using so that this can be moved to the proper forum for help.