How get cfspreadsheet to return the query dump in Excel?

I read my data as shown in examples, but my data just displays the query dump. If I add cfheader and cfcontent, the query dump just displays in an Excel.
I'm using CF 9.01 and Excel 2007
shell. Here is my  code:
            <cfscript>
                            //Use an absolute path for the files. --->
                            theDir=GetDirectoryFromPath(GetCurrentTemplatePath());
                            theFile=theDir & "TrackEverythingXLS.xls";
                            //Create two empty ColdFusion spreadsheet objects. --->
                            theSheet = SpreadsheetNew("TBI_2009"); 
                            theSheet2 = SpreadsheetNew("TBI_2008");
                            //Populate each object with a query. --->
                             SpreadsheetAddRows(theSheet,QO_getAllData); 
                             SpreadsheetAddRows(theSheet2,QO_getAllData_TBI_2008);
                        </cfscript>                   
                        <!--- Write the sheet --->
                    <cfspreadsheet action="write" filename="#theFile#" overwrite="true"  name="theSheet"
                        sheetname="QO_getAllData"> 
                        <cfspreadsheet action="update" filename="#theFile#"  name="theSheet2" 
                        sheetname="QO_getAllData_TBI_2008">   
                      <cfheader name="Content-Disposition" value="inline; filename=TrackEverythingXLS.xls">
                        <cfcontent type="application/vnd.msexcel"> 
                         <cfspreadsheet action="read" src="#theFile#" sheetname="QO_getAllData"
                        query="spreadsheetData">
                        <cfspreadsheet action="read" src="#theFile#" sheetname="QO_getAllData_TBI_2008"
                        query="spreadsheetData2">
                       <cfdump var="#spreadsheetData#" />
                        <cfdump var="#spreadsheetData2#" />
As you can see, I'm trying to write 2 tabs. That doesn't work either. All the data is dumped into one tab.

My initial problem may start with "Simply create your spreadsheet as usual." How do I do that?
With the code I just tried below, I did get a spreadsheet. So using cfheader and cfcontent is correct?
I did not get 2 sheets though.
    <cfscript>
                            //Use an absolute path for the files. --->
                            theDir=GetDirectoryFromPath(GetCurrentTemplatePath());
                            theFile=theDir & "TrackEverythingXLS.xls";
                            //Create two empty ColdFusion spreadsheet objects. --->
                            theSheet = SpreadsheetNew("TBI_2009"); 
                             SpreadsheetAddRows(theSheet,QO_getAllData);
                                 //Create a new sheet.
                            SpreadsheetCreateSheet (theSheet, "QO_getAllData_TBI_2008"); // 2nd query
                            //Set the sheet as active.
                            SpreadsheetSetActiveSheet (theSheet, "QO_getAllData_TBI_2008");                             
                            //Populate each object with a query. --->                             
                             SpreadsheetAddRows(theSheet,QO_getAllData_TBI_2008);
                        </cfscript>
                        <!--- Write the sheet --->
                    <cfspreadsheet action="write" filename="#theFile#" overwrite="true"  name="theSheet"
                        sheetname="QO_getAllData">
                    <!--- (no formatting) Works best. 8/10/11 2:54 pm  --->    
                    <cfheader name="Content-Disposition" value="inline; filename=TrackEverythingXLS.xls">
                        <cfcontent type="application/vnd.msexcel">
                         <cfspreadsheet action="read" src="#theFile#" sheetname="QO_getAllData"
                        query="spreadsheetData">
                       <cfdump var="#spreadsheetData#" />
Also, will I be able to code to Sort? Right now, I get an error message  saying: "This operation requires the merged cells to be identically  sized. (I had selected a Custom Sort on the entire sheet.) Is this a formatting issue?
Thanks for helping me out.

Similar Messages

  • How to get the Query output to Excel

    Hi ,
    Can you tell me how to get the Query output to excel with out using any third party tool?
    Can you tell me how to write the code in Webservice and call it..
    Please explain it Elaboartly..
    Thanks in Advance!!!
    Mini

    whats your source system?
    you can use Live office, or query as a webservice if you are getting data from universe
    if you're getting data from SAP BI query and you have a java stack on your netweaver then you can get the data directly using sap bi connector in xcelsius.
    good luck

  • After I run a query can I get it to return the number of files matched and each individual file name?

    After I run a query can I get it to return the number of files matched and each individual file name?  I am trying to do a data mining routine and this would be helpful. 
    BBANACKI

    Hi bbanacki,
    Please have a look at the following code:
    Define your queries and then:
    oAdvancedQuery.ReturnType=eSearchFile
    oMyDataFinder.Results.MaxCount = iMaxNumberOfReturndElements
    Call oMyDataFinder.Search(oAdvancedQuery)
    Set oMyResults  = oMyDataFinder.Results
    If oMyResults.IsIncomplete Then
      msgbox "The first " & str(oMyResults.Count) & " files found"
    Else
      msgbox str(oMyResults.Count) & "  files found"
    End If
    for iLoop = 1 to oMyResults.Count
      Cell.Text = oMyResults(iLoop).Properties("Name").Value
      Cell.Text = oMyResults(iLoop).Properties("fullpath").Value
    next
    Greetings
    Walter

  • How to put distinct in the query

    Hi all,
    How to put distinct in the query.I checked in RPD , Distinct supported is already available. I marked the distinct check box in advance option still then i'm not getting distinct in the query.
    any idea , please help...

    In the RPD i have join between base table and view .i'm selecting 2 columns one from base table and other from view . which gives cartesian product . to avoid that i want to put distinct . I'm not using any measure . I'm taking direct columns.
    I'm getting distinct keyword if i'm accessing the report directly . but when i'm accessing it from dashboard in the back end while preparing the query it's writing distinct but the actual query which is sending to db does not have distinct.
    ==================================================
    RqList distinct
    VW_SCNR_114000074_TA_DATA.Match Identifier as c1 GB,
    VW_SCNR_114000074_TA_DATA.Tot Trans Amt as c2 GB,
    VW_SCNR_114000074_TA_DATA.Tot Trans Ct as c3 GB,
    case when VW_SCNR_114000074_TA_DATA.Alert Quality Code = '1' then 'Productive' when VW_SCNR_114000074_TA_DATA.Alert Quality Code = '2' then 'Non Productive' else 'Indeterminate' end as c4 GB,
    VW_SCNR_114000074_TA_DATA.Batch Identifier as c5 GB
    DetailFilter: Alert TA Data.Run Id > 0 and Alert Scenarios.Scenario Name = 'ScnroName' and Alert TA Data.Batch Id > 0
    OrderBy: c4 desc
    =================================================
    -------------------- Sending query to database named KYC1.1DEV-179 (id: <<16315>>):
    select T353.BATCH_ID as c1,
    case when T353.QLTY_RTG_CD = '1' then 'Productive' when T353.QLTY_RTG_CD = '2' then 'Non Productive' else 'Indeterminate' end as c2,
    T353.TOT_TRXN_CT as c3,
    T353.TOT_TRXN_AM as c4,
    T353.BREAK_ID as c5,
    T117.SCNRO_NM as c6
    from
    KDD_SCNRO T117,
    KDD_TA_DATA T130,
    KDD_TSHLD_SET T171,
    VW_SCNR_114000074_TA_DATA T353
    where ( T117.SCNRO_ID = T130.SCNRO_ID and T117.SCNRO_ID = T171.SCNRO_ID and T130.SCNRO_ID = T171.SCNRO_ID and T130.SCNRO_ID = T353.SCNRO_ID and T130.TSHLD_SET_ID = T171.TSHLD_SET_ID and T171.SCNRO_ID = T353.SCNRO_ID and T171.TSHLD_SET_ID = T353.TSHLD_SET_ID and 0 < T130.BATCH_ID and 0 < T130.RUN_ID )

  • How many optional allowed in the query?

    Hi,
    Data base is getting disconnected while running the below sparql query (Query with 9 optional conditions).
    I tested the query with 5 optional its working fine but, its not working for more than 5 optional.
    How many optional allowed in the query?
    Please advice me to solve this problem.
    Error Detail: ORA-03113: end-of-file on communication channel
    SELECT bi, OWNER,name,usage,notes,icto,app,ssd,ssdname,ssdid,sdname,sdarchitect,schedule
    FROM TABLE (sem_match('{
    ?bi rdf:type di:Bulk_Interface .
    ?bi di:hasBulkInterfaceItOwner ?OWNER .
    ?bi di:hasBulkInterfaceName ?name .
    ?bi di:hasBulkInterfaceRecipientApplicationArea ?usage .
    ?bi di:hasBulkInterfaceRecipientFeederType ?notes .
    ?bi di:hasBulkInterfaceSupplierApplicationId ?icto .
    ?app ds:hasConceptualSourceApplicationIctoId ?icto .
    ?ssd ds:hasConceptualSourceApplication ?app .
    ?ssd ds:hasConceptualSourceSubdomainName ?ssdname .
    ?ssd ds:hasConceptualSourceSubdomainIctoId ?ssdid .
    ?sd ds:hasConceptualSourceSubdomain ?ssd .
    ?sd ds:hasConceptualSourceDomainName ?sdname .
    ?sd ds:hasConceptualSourceDomainArchitect ?sdarchitect .
    ?bi di:hasBulkInterfaceDeliverySchedule ?schedule
    optional {?bi di:hasBulkInterfaceRecSet1AverageStorageRequirements ?avgsize}
    optional {?bi di:hasBulkInterfaceWorstStorageRequirements ?maxsize}
    optional {?bi di:hasBulkInterfaceRecSet1AverageNumberOfRecords ?avgrec}
    optional {?bi di:hasBulkInterfaceAverageNumberOfRecords ?avgrec}
    optional {?bi di:hasBulkInterfaceRecSet1WorstNumberOfRecords ?maxrec}
    optional {?bi di:hasBulkInterfaceWorstNumberOfRecords ?maxrec}
    optional {?bi di:hasBulkInterfaceTransferMethodJob ?job}
    optional {?bi di:hasBulkInterfaceDataFileAvailability ?post}
    optional {?bi di:hasBulkInterfaceBusinessDescription ?descr}
    sem_models ('IFM_CURR', 'SRC_CURR'),
    SEM_Rulebases('OWLPRIME'),
    sem_aliases(SEM_ALIAS('di','http://www.cse.com/sbip/dwh/mdm/data_interface#'),
    SEM_ALIAS('ds','http://www.cse.com/sbip/dwh/mdm/data_sources#'))
    , NULL));
    Let me know if you need any other details.
    Regards,
    Kavitha.
    Edited by: 789259 on Aug 3, 2011 2:01 AM

    If possible, I would suggest that you upgrade to the latest release: 11.2.0.2.0. It has many bugfixes and enhancements.
    There is no limit on the number of optionals per query. I suspect that the use of the same new variables (?avgrec and ?maxrec) in the parallel optional clauses is the reason you are seeing the error in this particular case. If you use different variable names does the error go away? If needed, you can use a coalesce in the outer SQL SELECT to get the same behavior as before (e.g. COALESCE(avgrec1, avgrec2) as avgrec).
    Thanks,
    Matt

  • How can i display all the query items to a table?

    how can i display all the query items to a table in a jsp file?
    i always have an out of memory error..

    any body??any idea?
    is it possible thru configuration or i have to write a program by the abaper??
    Biswa

  • How to pass parameter to the Query String of the Named Queries'SQL

    Firstly to say sorry,I'm a beginner and my English is very little.
    Now I want to know
    How to pass parameter to the Query String of the Named Queries'SQL in the Map editor.
    Thanks.

    benzi,
    Not sure if this is on target for your question, but see #5 in the link below for some web screencasts that show how to pass an input text form field value to the bind variable of a view object. If you're looking for something different, maybe provide some more details such as what you are trying to accomplish and what technology stack you are using - for example, ADF BC, JSF, etc.
    http://radio.weblogs.com/0118231/stories/2005/06/24/jdeveloperAdfScreencasts.html
    Also see section 5.9 and chapter 18 in the developer's guide.
    thanks

  • HTTP-Post/Get method of calling the query service allows us to build URL

    Hi,
    I am new to webservices.i have requirement that, using a HTTP-Post/Get method of calling the query service that allows us to build an URL and if we call that url it wil populate XML object.i need query LDAP server for getting users manager details ,in request query we wil pass user details.thanks in advance..

    check same issue in java forum and this link:
    http://jakarta.apache.org/commons/httpclient/methods/post.html

  • How can I get Numbers to return the first row in a group of VLOOKUP query results instead of last one?

    I'm trying to query from one table (call it Table1) a batch of rows in another table (Table2) using VLOOKUP on a date specified in the first table (Table1). My problem is it's returning the last incident in Table2 of the requested date instead of the first incident. This really breaks the OFFSET scheme I'd like to use to collect the rest of the items for that date. Is there some way to compel VLOOKUP to return the first row of query results, not the last?
    NOTE: I see I've asked this before, but forgot to go back and look at responses given. It's been a while and I've limped along until now with the way things were. I'm actually trying to delete this questions, so if you see it, ignore it. I suppose if someone can tell me real quick how to delete a stupid question, that might be helpful.

    you cannot delete a post yourself.  You can flag the post an request a moderator remove.

  • How-to Generate Script from the export dump file

    Hi all,
    Software : Oracle 10gR2/Windows 2003
    =============================
    Has anyone generated a Script from a export dump file ( exported via data pump export). I know it is possible to generate script from the regular export.
    I want to know how to generate the script for various objects or is it possible to get the counts of types of objects in the dump file and / or generate the script from the export dump file exported via data pump utility on Oracle 10g.
    Thanks,
    SS

    I want to know how to generate the script for various objects.what do you mean by scripts? Assuming the metadata definitions of various objects.
    First of all, you can generate the metadata definitions using import.
    Use, Impdp with SQLFILE parameter to generate the SQL file for the metadata definitions.
    Refer to
    http://download-uk.oracle.com/docs/cd/B19306_01/server.102/b14215/dp_overview.htm

  • How to display attributes in the query

    Hi frnds,
    I want to show the attributes of material ( mat group , mat type ), vendor ( Sort field ) in the report.
    We loaded master data for material and vendor.
    I dragged the char and the relevant attributes in the query designer and executed the query. But in the output the attributes values are not displayed.
    What could the reason ?
    Regards,
    V N.

    Hi all,
    Thanks for the reply.
    "Display attributes will also get displayed if you include the infoobject for which they are attributes."
    Suppose for 0vendor the attr is 0sortl. By defualt it is display attr. I dragged in the query the 0vendor and its attr 0sortl  and executed. It didnot displayed any values for this 0sortl
    I changed it to Nav Attr. And rerun the query, it is displaying values.
    In the first case i included Display attr and the infoobject for which it is attr in the query. Please explain me why it didnot displayed the values.
    And after changing it to Nav attr it displayed the values.
    Please explain me what happened actually.
    Regards,
    V N.

  • Where() clause returning "The query specified in the URI is not valid..."

    I have a .Net mobile service.
    Calling this:
    https://qserv.azure-mobile.net/tables/items?$filter=(company%20eq%20%27987af3f9-8d44-4a9d-8be2-7e0567287106%27)
    Returns:
    {"message":"The query specified in the URI is not valid. Could not find a property named 'company' on type 'Default.<>f__AnonymousType2_3OfString_String_Double'."}
    The field name in the "items" entity model is "company" and on the database is "company_Id", neither will work.Using http://ajax.aspnetcdn.com/ajax/mobileservices/MobileServices.Web-1.2.5.min.jsWhat is wrong?
    Regards

    I see. Now works. So it would be like doing "SELECT ITEM,CATEGORY,COUNTRY, FROM TABLE WHERE CATEGORY='toy' AND COUNTRY='US'"
    All rows will contain the "CATEGORY" and "COUNTRY" fields (or more), which is kind of redundant and bandwidth consuming.
    Hope MS can change this.
    Regards

  • How to left trim in the query designer?

    Hi all,
    I have a sceanario like zcust_details contains   abcde/1000276  where 1000276 is the customer code (sold to party) how do i truncate this in the query and then reference this field to solto party.
    The issue is when the user run the query abcde/1000276   is been displayed but users wants 1000276 text to be displayed which is not been captured in bw system.
    so how to truncate and reference the same with 0customer master and display the text values from 0customer text.
    thanks

    Hi Pooja,
    It would be easier to achieve this on bachend. You can truncate and store the result in another Object and then display it in your Query.
    Deepika

  • How to identify nor recover the query created on the production??

    Hi all,
    i have created a query directly on the productions server. And someone has deleted the query on the production server direclty.
    is there any way that can i get back the query on the production nor identify who has deleted the query on the production.
    thanks
    pooja

    answered

  • How to find name of the Query in SE09

    Hi Experts,
    Can anyone tell me how do find the name of the Query which is not released.
    Like for example:
    When I try to open the modified requests of all the users It displays me the names of the Tables, WEB templates etc. But for Query it only shows the Elements of Query Builder only some junk data.
    Please help me understand which query request that is.
    Thanks

    Do you have the TR no. which is released for the query.
    if you go there and check in SE09, it would show you the query name i guess which are the objects included in the request.
    Try this and hope this would  help you.

Maybe you are looking for