Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7458863
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T13:30:57+00:00 2026-05-29T13:30:57+00:00

In try to create a spreadsheet that is generated from multiple queries, the following

  • 0

In try to create a spreadsheet that is generated from multiple queries, the following code only generates one row of data and not the entire spreadsheet:

<cfset filenametouse = 'Usage_Report' />
<cfset theDir = GetDirectoryFromPath(GetCurrentTemplatePath()) /> 
<cfset theFile = theDir & filenametouse & ".xls" /> 

<cflock name="fileActionSentItems" type="exclusive" timeout="30" throwontimeout="true">
     <cfset SpreadsheetObj = spreadsheetNew()>
     <cfset fcol = {}>
     <cfset fcol.dataformat = "@">

     <cfset SpreadsheetAddRow(SpreadsheetObj, "Part Number, Description, Allocated, On Hand, Pending Receipt, Job Count, Qty Needed, Qty Issued, Order Count, Qty Ordered, Qty Shipped")>

     <cfoutput>
          <cfset SpreadsheetAddRows(SpreadsheetObj,"#getParts.partnum#, #getParts.partdescription#, #getParts.allocated#, #getParts.onhand#, #receiptdata.recqty#, #jobdata.JobCount#, #jobdata.QtyNeeded#, #jobdata.qtySent#, #orderdata.ordercount#, #orderdata.ordered#, #orderdata.shipqty#")>
     </cfoutput>

     <cfset SpreadsheetFormatColumn(SpreadsheetObj,fcol,11)>
     <cfspreadsheet action="write" filename="#theFile#" name="SpreadsheetObj" sheetname="Sheet1" overwrite="true" />
</cflock>

The spreadsheetAddRows isn’t creating the data to populate the rows. What am I not doing correctly?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T13:30:58+00:00Added an answer on May 29, 2026 at 1:30 pm

    You need to pass in the query object instead of a single row of data.

    <cfset SpreadsheetAddRows(SpreadsheetObj, getParts) >
    

    As an aside, you probably do not need to lock that whole section. If the lock is intended to prevent concurrent file access, you only need to lock the code writing the sheet to disk. (Depending on your needs, you might also use a more granular name. But that is just a guess.)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I try to create a form that can save a person's form data so
snippet from The Server code : public void run() { try { // Create
I have the following code: try { //Create connection SQLiteConnection conn = DBConnection.OpenDB(); //Verify
I did the following things: I have a spreadsheet with data. One of the
I try to create some li elements in my XUL Application. Theres only the
I am following this tutorial . All is going well until I try create
Take a gander at the following code. Basically, this is a function that gets
I try create custom format for maven assembly plugin. I use following instruction how
I have a spreadsheet that I am importing that contains some test data for
I'm using the following code to import a simple excel spreadsheet into a dataset

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.