Query to Excel file

Hello,
I want to output a query into an excel spreadsheet which can
be saved as needed. This is my code
<cfheader name="Content-Disposition"
value="attachment;filename=Leadsdatafile.xls" >
<cfcontent type="application/vnd.ms-excel" >
Then I run my <cfoutput>.. In my development it works
fine, but on the production it gives me an error.
"Internet Explorer was unable to open this site....."
I checked in Google and somone has mentioned about cfheader
having value="no-cache". I do not have that set up. Please help.
Thank you

Hello,
I want to output a query into an excel spreadsheet which can
be saved as needed. This is my code
<cfheader name="Content-Disposition"
value="attachment;filename=Leadsdatafile.xls" >
<cfcontent type="application/vnd.ms-excel" >
Then I run my <cfoutput>.. In my development it works
fine, but on the production it gives me an error.
"Internet Explorer was unable to open this site....."
I checked in Google and somone has mentioned about cfheader
having value="no-cache". I do not have that set up. Please help.
Thank you

Similar Messages

  • Procedure to save the output of a query into excel file or flat file

    Procedure to save the output of a query into excel file or flat file
    I want to store the output of my query into a file and then export it from sql server management studio to a desired location using stored procedure.
    I have run the query --
    DECLARE @cmd VARCHAR(255)
    SET @cmd = 'bcp "select * from dbo.test1" queryout "D:\testing2.xlsx;" -U "user-PC\user" -P "" -c '
    Exec xp_cmdshell @cmd
    error message--
    SQLState = 28000, NativeError = 18456
    Error = [Microsoft][SQL Server Native Client 10.0][SQL Server]Login failed for user 'user-PC\user'.
    NULL
    Goel.Aman

    Hello,
    -T:
    Specifies that the bcp utility connects to SQL Server with a trusted connection using integrated security. The security credentials of the network user,
    login_id, and password are not required. If
    –T is not specified, you need to specify
    –U and –P to successfully log in.
    -U:
    Specifies the login ID used to connect to SQL Server.
    Note: When the bcp utility is connecting to SQL Server with a trusted connection using integrated security, use the
    -T option (trusted connection) instead of the
    user name and password combination
    I would suggest you take a look at the following article:
    bcp Utility: http://technet.microsoft.com/en-us/library/ms162802.aspx
    A similar thread regarding this issue:
    http://social.msdn.microsoft.com/Forums/sqlserver/en-US/b450937f-0ef5-427a-ae3b-115335c0d83c/bcp-connection-error-sqlstate-28000-nativeerror-18456?forum=sqldataaccess
    Regards,
    Elvis Long
    TechNet Community Support

  • Creating Target excel files dynamically in ODI

    Hi,
    I've a urgent requirement in ODI as below.
    I've a query regarding of creation target excel files dynamically as I need to load more than 1 excel file through ODI with source system as Oracle DB.
    Elaborating my query:
    Target excel file say X.xls is not placed in a particular directory neither driver is created. I want to X.xls file to be created through ODI and data to be loaded into the excel file.
    Help would be really appreciated.

    There is no standard code for the same.
    The following thread has the code which will put data into multiple sheets
    Download to multiple sheets in Excel
    Regards,
    Ravi
    Note : Please mark all the helpful answers

  • How to get query result in comma dilimited text or excel file?

    Does anybody know how to get query results in comma delimited
    text file or excel file, I tried spool abc.txt, but the result
    showed some ------ lines
    Thanks

    Try doing this in your sql scripts
    set heading off
    set pagesize 0
    set linesize 4000
    set feedback off
    set verify off
    set trimespace on
    set colsep ","
    spool output.txt
    select * from dual (or whatever you are querying
    spool off
    There may be a couple other set statement that you could add but
    this should get you started in the right direction

  • Export Report to Excel File & query design??? Urgent

    Hi all,
    1) It seems that I cannot use any BEx tools/function afer I export query report to excel file, such as refresh query report,...etc. If I am wrong, please let me know.
    2) I have about 18 free CHARs in my report as my clien request (all variables are optional), now I only can run the query in the specific period, otherwise the report will show error and cannot run it. Why? is there any way I can fix it?
    Thanks.
    J.

    Hi Prvaeen,
    That is what i see in my excel file after exported.
    Here is the error I got from web report:
    The URL http://sdcbwqa03.amcc.com:8100/sap/bw/BEx was not called due to an error.
    Note
    The following error text was processed in the system BWQ : Invalid dynamic line component.
    The error occurred on the application server sdcbwqa03_BWQ_00 and in the work process 0 .
    The termination type was: RABAX_STATE
    The ABAP call stack was:
    Form: COPY_SETXX_LINE of program CL_RSR_REQUEST================CP
    Form: GET_DATA_CELLS of program CL_RSR_REQUEST================CP
    Form: COMPUTE_NOP of program CL_RSR_LIST_CALCULATION=======CP
    Form: COMPUTE_ORDER of program CL_RSR_LIST_CALCULATION=======CP
    Form: COMPUTE of program CL_RSR_LIST_CALCULATION=======CP
    Form: REQUEST_DATA of program CL_RSR_REQUEST================CP
    Form: READ_DATA_INTERNAL of program CL_RSR_REQUEST================CP
    Form: READ_DATA of program CL_RSR_REQUEST================CP
    Form: READ_DATA of program CL_RSR_WWW_VIEW===============CP
    Form: RENDER of program CL_RSR_WWW_ITEM===============CP
    Thanks.
    J.

  • How to save query result on the file server as excel file?

    Hi everyone,
    I need to save the the query result on the file server as excel file.
    Do you have any idees how can I do it?
    Regards
    Erwin

    i dont think you can save as excel file but you can save it as CSV use APD or RSCRM BAPI for this

  • Steps to save a Query/Report as Excel file in Share folder

    Hi,
    I have a requirement where i need to schedule a BI report automatically on a daily basis and save it in a Sharepoint folder as a excel file.  I have gone through the Forums but didnt get a clear idea on how to proceed this with.  I read about RSCRM_BAPI transaction but i hope we need to do this manually to save the file each time.  Also, in Broadcaster there are options only to send Email & save in Portal. 
    So, if anybody have idea on saving a Query/Report as excel file in a Share folder automatically, kindly help me in suggesting the steps to do this activity.
    Regards,
    Murali

    Hi
    1. Create Three Floders in AL11 i.e. in Apllication Server. Eg Name it F1, F2 and F3.
    2. First dump the .csv files into F1. (Name xyz.csv).
    3. Then using UNIX/WINDOWS (depends on your OS) script , first check the file is there are not in F1, if yes then rename the file with date and time or date and transfer the files from F1 to F2 i.e xyz06032010.csv.
    4. Then Create a small ABAP program to check the file in F2, if it is there then Trigger the Event, and using that event you execute teh PC.
    5. Then using UNIX/WINDOWS (depends on your OS) script , transfer the files from F2 to F3 i.e xyz06032010.csv
    6. Next day morning F1 and F2 are empty and F3 is having the backup files.
    So use this method, I used the similar logic and it is working fine.
    Timinings are importent i.e what time you need to dump the fule in F1 and what time you need to run UNIX/WINDOWS (depends on your OS) script , transfer the files from F1 to F2 and what time UNIX/WINDOWS (depends on your OS) script , transfer the files from F2 to F3.
    OR
    1. Create Two Floders in AL11 i.e. in Apllication Server. Eg Name it F1 and F2
    2. First dump the .csv files into F1. (Name xyz.csv)
    3. Then load the data using InfoPackage, through PC.
    4. At the end of the load Attach a simple Program to Move the xyz.csv file from F1 to F2.
    5. So next day the file will come to F1 and the it will load and at the end it will move to F2.
    Else  you can use simple one or two lines of UNIX/WINDOWS (depends on your OS) script to move the file from F1 to F2 , once you load is over.
    While moving the file from F1 to F2 you can append the date at the end of the file and then move to F2, it is use full for future reference.
    See Blogs and Article, similar logic...
    https://wiki.sdn.sap.com/wiki/display/profile/Surendra+Reddy
    How to transfer the Data from SAP-System to Non-SAP system without additional Cost/License
    /people/surendrakumarreddy.koduru/blog/2009/03/11/how-to-transfer-the-data-from-sap-system-to-non-sap-system-without-additional-costlicense
    To Check the Files/Reports in Application Server and Trigger Mail Alerts.
    http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/4096bf2d-bcea-2b10-4ab4-e0683830d9b2&overridelayout=true
    Thanks
    Reddy
    Edited by: Surendra Reddy on Mar 12, 2010 6:41 AM

  • Display the query result in an Excel file??

    hi there..
    am writing one script file that queries my DB and display the query result in an Excel file??
    i.e: if my query is :
    select col1, col2
    from table;
    and i want the results to dispalys in 2 col. in an Excel spreadsheet..
    Appreaciating ur cooperation..
    Mourad

    set colsep to a delimiter that is not normally part of your data like |
    also setup the environment with these other setup commands
    Set Echo Off;
    Set Concat Off;
    Set Pagesize 9999;
    Set Feedback Off;
    Set Verify Off;
    Set Term Off;
    Set Space 0;
    Set Colsep '|'
    Set Underline Off;
    If you wanted to use a comma delimiter the setup would be same but the set colsep='","'
    with the addition of concatenating a " on the first col and last col of the query
    eg.
    -- if first col and last_col are character types then
    SELECT '"'||col1,....,last_col||'"'
    FROM table;
    Otherwise if either is a number they would have to be converted with a TO_CHAR

  • End the result of an sql query by Email as an excel file attachement

    Hi,
    I would like to create a PL/SQL function that send the result of an sql query by Email as an excel file attachement.
    i'm newbie in pl/sql an d i dont know if it's possible to do such task.
    regards,

    i think a regular expression is he way to go in your case...
    Azadi Saryev
    Sabai-dee.com
    http://www.sabai-dee.com

  • Query output transfer to excel file

    hi all,
    how can i query output transfer to excel file ? i am not using any tool. please suggest me. is there any method that i transfer that output to excel file?

    You can create a csv file. See dump_csv function from Tom Kyte.

  • How to load excel files from my SharePoint site to Excel client by using Power Query

    Hello,
    I am using Power Query to import some Excel files from shared documents on SharePoint site. After I type the URL of my SharePoint site into the filed, the expected Excel files do not appear in Power Query. Please provide the method as soon as possible.
    Thanks!

    Could you check if
    this post can help?

  • How to save query result in excel file

    Hi all,
    How to save query result in excel file from sql*plus tool.
    thank you

    Do you really need an Excel file (binary) or a simple CSV?
    If you just need a CSV then search for DUMP_CSV at http://asktom.oracle.com or at this forum
    If you need formatting and/or multiple worksheets then you can use free tools like
    https://xml-spreadsheet.samplecode.oracle.com/ or https://exceldocumenttype.samplecode.oracle.com/
    Regards
    Marcus

  • Sending query results to an excel file

    hai friends,
    Can any one help me out in sending the results of a query to an excel file once i press a button on my jsp.
    I need to display the results of the query and has to send those results to the excel file.
    Thanks and regards,
    ravikiran

    The solution is simple and the trick lies in setting the Content Type of the response and producing the output.
    If we remember, while coding in servlets, one needs to set the content type on the response object. For outputting in Excel format, the content type has to be set as "application/vnd.ms-excel"
    Once this is done, the servlet knows that it has to produce the output in MS Excel Sheet.
    You can query the databsae and loop over your record set and output it in any manner you like.
    eg
    <!-- Printing the Row Headers-->
    out.println("Header1 \t Header 2 \t Header3");
    <!-- printing the actual values from database-->
    while(rs.next()){
    out.println(rs.getString(1) + "\t" + rs.getString(2) + "\t" + rs.getString(3));
    Hopefully this will work for all of you.
    Thanks

  • Need SQL Query which saves query results to an excel file

    Hi,
    I am looking for a sql query which saves/ export results of an query to a excel file
    Thanks,
    Chetan

    I am looking for a sql query which saves/ export results of an query to a excel file
    Thanks,
    Chetan
    Options:
    1) You can use
    BCP command to export result to excel
    2) Insert into excel by using OPENROWSET
    3) Use Import and Export Wizard and provide SQL query as source and Excel as destination
    Please refer:
    http://stackoverflow.com/questions/87735/how-do-you-transfer-or-export-sql-server-2005-data-to-excel
    http://www.codeproject.com/Questions/617527/Export-sql-query-result-in-excel-file
    Cheers,
    Vaibhav Chaudhari
    [MCTS],
    [MCP]

  • Can I link a query with an Excel file without using universe designer?

    Post Author: nicmac3030
    CA Forum: WebIntelligence Reporting
    I have an Excel file that contains a list of 200 seller codes.  The list is updated on a weekly basis.
    I need to create a query in Webi that shows ONLY those records in our main table that match one of the seller codes on the Excel list.
    Is there an easy way of doing this?  I don't really want to hassle our universe designer guy with a new file to import every week.  But if that's the only way to do it, we will have to.
    Back in BO v5 we used an Excel macro to add all the codes into a long text string with commas & pasted that into the query designer.  Unfortunately there are many queries that need to be updated, so hopefully there's a way to automate this.
    Thanks for your help.  Cheers, Nick

    Post Author: jsanzone
    CA Forum: WebIntelligence Reporting
    Nick,
    You don't mention what version of BusinessObjects that you are using.  If you are going to adopt XI 3.0 sometime soon, then you will have a definite capability of doing what you want with a new product included in 3.0 called "Rich Client".  At this moment I can't think of any other way to achieve what you want other than RC.  You can read more about RC at the Business Objects docs web site, here: http://support.businessobjects.com/documentation/product_guides/boexir3/en/xi3_web_intelligence_rich_client_en.pdf

Maybe you are looking for