Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QXlsx and column format

QXlsx and column format

Scheduled Pinned Locked Moved Solved General and Desktop
2 Posts 2 Posters 824 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • mrdebugM Offline
    mrdebugM Offline
    mrdebug
    wrote on last edited by
    #1

    Hi, I need to set the type of a column to string. Now if I use the method
    write(1, 1, "001");
    I obtain the first top left cell as string with the value "001" correctly.
    I need that the empty cells of the same column can accept the value "001" as string but, after an user have inserted "001", excel change the value to "1".

    Need programmers to hire?
    www.labcsp.com
    www.denisgottardello.it
    GMT+1
    Skype: mrdebug

    1 Reply Last reply
    0
    • VRoninV Offline
      VRoninV Offline
      VRonin
      wrote on last edited by
      #2
          QXlsx::Document xlsx;
          QXlsx::Format textFormat;
          textFormat.setNumberFormat(QStringLiteral("@"));
          xlsx.setColumnFormat(1, textFormat);
          xlsx.write(1, 1, QStringLiteral("001"));
          xlsx.setColumnWidth(1,8.43);
          qDebug()<< QStandardPaths::writableLocation(QStandardPaths::TempLocation);
          xlsx.saveAs(QStandardPaths::writableLocation(QStandardPaths::TempLocation)+ QLatin1String("/rowcolumn.xlsx"));
      

      "La mort n'est rien, mais vivre vaincu et sans gloire, c'est mourir tous les jours"
      ~Napoleon Bonaparte

      On a crusade to banish setIndexWidget() from the holy land of Qt

      1 Reply Last reply
      2

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved