How to approach for downloading a CSV file?

I'm running the following query and  QoQ . Could you tell me how should I proceed for the "Download  CSV" file option?
    <!--- QoQ for FIRSTCONN --->
    <cfquery datasource = "XX.XX.X.XX" name="master1">
         SELECT STR_TO_DATE(date_format(Timedetail,'%m-%d-%Y'),'%m-%d-%Y') as FIRSTCONN
                , COUNT(Timedetail) as FIRSTOccurances
                , EVENTS
         FROM  MyDatabase
         WHERE EVENTS = "FIRST"
         GROUP BY FIRSTCONN ;
    </cfquery>
    <!--- Detail Query --->
    <cfquery dbtype="query" name="detail1">
        SELECT  *
        FROM master1
        WHERE FIRSTCONN  >= <cfqueryparam value="#form.startdate#" cfsqltype="cf_sql_varchar">
        AND   FIRSTCONN  <  <cfqueryparam value="#dateAdd('d', 1,form.enddate)#" cfsqltype="cf_sql_varchar">;
    </cfquery> 
    <!--- QoQ for SECONDCONN --->
    <cfquery datasource = "XX.XX.X.XX" name="master2">
        SELECT STR_TO_DATE(date_format(Timedetail,'%m-%d-%Y'),'%m-%d-%Y') as SECONDCONN
               , COUNT(Timedetail) as SECONDOccurances
               , EVENTS
        FROM  MyDatabase
        WHERE EVENTS = "SECOND"
        GROUP BY SECONDCONN ;
    </cfquery>
    <cfquery dbtype="query" name="detail2">
        SELECT  *
        FROM   master2
        WHERE  SECONDCONN  >= <cfqueryparam value="#form.startdate#" cfsqltype="cf_sql_varchar">
        AND    SECONDCONN  <  <cfqueryparam value="#dateAdd('d', 1,form.enddate)#" cfsqltype="cf_sql_varchar">;
    </cfquery> 
    <cfchart format="flash"  chartwidth="1000" chartheight="500" scalefrom="0" scaleto="50000" xAxisTitle="Dates" yaxistitle="Number of Connections">
         <cfchartseries  query="detail1" type="line" itemColumn="FIRSTCONN" valueColumn="FIRSTOccurances" >
         <cfchartseries  query="detail2" type="line" itemColumn="SECONDCONN" valueColumn="SECONDOccurances" >
         </cfchartseries>
    </cfchart>
The cfform code I'm using is as follows:
<cfform format="flash" preloader ="false">
<cfformgroup type="horizontal">
  <cfinput type="dateField" name="startdate" label="Start Date" width="100" value="#form.startdate#">
  <cfinput type="dateField" name="enddate" label="End Date" width="100" value="#form.enddate#">
  <cfinput name="submitApply" type="submit" value = "Apply">
  <cfinput name="cancel" type="submit" value="Download CSV">
</cfformgroup>
Desired Output:
I have attached the image for the output below. Please find it attached.
Basically, if a date range is 21June to 21 July. The output must be as shown in the image. (I have omitted THIRDCONN etc for the sake of simplicity in my code).
Please let me know how should I go about this problem and let me know if I can answer more questions.

It's not built into the language. Your best bet is probably to put the CSV-Reading logic into its own class.
Or find one of the thousands of classes that already implement such a thing.

Similar Messages

  • How to get fixed field length when download a CSV  file ?

    hi all ,
        I had downloaded a CSV file from an ALV list which created by myself. the current layout of the CSV file is :
    aaa;bbbbbbbbbb;cc;                
                                                         for example . but what i want is :
    aaa         ;bbbbbbbbbbb            ;cc     ; 
    it means these three fields are all with fixed length don't ommitting spaces when you preview the CSV file. how should i do this ?
    best regards
    Kevin

    i got the solution.

  • Downloading a .csv file as excel sheet

    hi,
    does anyone know how to ensure that when downloading a csv file, it will be opened with excel only. The browser is downloading it as a text file and not excel. how can this be prevented.
    please let me know if you have any ideas since i've been pondering over it for far too long and need help...
    thanks
    jeena

    Yes, you need to set the content type to "application/vnd.ms-excel". Of course there is no guarantee that your clients will interpret that to mean "Open with Excel", or that they will even have Excel installed on their system, but there's not much you can do about that.

  • Download to csv file

    Hi,
    Working with Download to csv file feature I realized that for one of my reports that contains an icon (with a link) in one of the columns, is not getting any value for this column in the csv file.
    This behaviour is logical due to the fact that we have an image, not a string.
    But, is there a way I can edit or force the Download to assign a string value for every icon I have in my report, so when I click in Download, the icon will be represented as a string in the new csv file?
    Thanks
    Ivo

    i'd bet the easiest way to approach this would be to select both your icon and your "string value" columns out of the database and to then use column conditions to determine which columns should be rendered in which output format. so say you had a report that just showed images in one col and a description in the next. i'd write your report to select something like...
    select '<img src="'||m.image_path||'">' my_image, m.image_name name, m.image_description
    from my_image_table m
    ...and then i'd a put condition of type "PL/SQL Expression" like...
    not htmldb_application.g_excel_format
    ...on your my_image column. i'd also put a "PL/SQL Expression" condition on your Name column like...
    htmldb_application.g_excel_format
    ...we talked about this a bit in...
    Excel Report
    ...but basically htmldb_application.g_excel_format is just a function that returns a boolean telling you whether or not the HTML DB engine is in the mode of show your page in csv format. anyhow, give it a shot and let us know if you need further assistance.
    regards,
    raj

  • How to load the data from .csv file to oracle table???

    Hi,
    I am using oracle 10g , plsql developer. Can anyone help me in how to load the data from .csv file to oracle table. The table is already created with the required columns. The .csv file is having about 10lakh records. Is it possible to load 10lakh records. can any one please tell me how to proceed.
    Thanks in advance

    981145 wrote:
    Can you tell more about sql * loader??? how to know that utility is available for me or not??? I am using oracle 10g database and plsql developer???SQL*Loader is part of the Oracle client. If you have a developer installation you should normally have it on your client.
    the command is
    sqlldrType it and see if you have it installed.
    Have a look also at the FAQ link posted by Marwin.
    There are plenty of examples also on the web.
    Regards.
    Al

  • How to display data from local csv files (in a folder on my desktop) in my flex air application using a datagrid?

    Hello, I am very new to flex and don't have a programming background. I am trying to create an air app with flex that looks at a folder on the users desktop where csv files will be dropped by the user. In the air app the user will be able to browse and look for a specific csv file in a list container, once selected the information from that file should be displayed in a datagrid bellow. Finally i will be using Alive PDF to create a pdf from the information in this datagrid laid out in an invoice format. Bellow is the source code for my app as a visual refference, it only has the containers with no working code. I have also attached a sample csv file so you can see what i am working with. Can this be done? How do i do this? Please help.
    <?xml version="1.0" encoding="utf-8"?>
    <mx:WindowedApplication xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" width="794" height="666">
        <mx:Label x="280" y="19" text="1. Select Purchase Order"/>
        <mx:List y="45" width="232" horizontalCenter="0"></mx:List>
        <mx:Label x="158" y="242" text="2. Verify Information"/>
        <mx:DataGrid y="268" height="297" horizontalCenter="0" width="476">
            <mx:columns>
                <mx:DataGridColumn headerText="Column 1" dataField="col1"/>
                <mx:DataGridColumn headerText="Column 2" dataField="col2"/>
                <mx:DataGridColumn headerText="Column 3" dataField="col3"/>
            </mx:columns>
        </mx:DataGrid>
        <mx:Label x="355" y="606" text="3. Generated PDF"/>
        <mx:Button label="Click Here" horizontalCenter="0" verticalCenter="311"/>
    </mx:WindowedApplication>

    Open the file, parse it, populate an ArrayCollection or XMLListCollection, and make the collection the DataGrid dataProvider:
    http://livedocs.adobe.com/flex/3/html/help.html?content=Filesystem_08.html
    http://livedocs.adobe.com/flex/3/html/help.html?content=12_Using_Regular_Expressions_01.ht ml
    http://livedocs.adobe.com/flex/3/html/help.html?content=dpcontrols_6.html
    http://livedocs.adobe.com/flex/3/langref/mx/collections/ArrayCollection.html
    http://livedocs.adobe.com/flex/3/langref/mx/collections/XMLListCollection.html
    If this post answered your question or helped, please mark it as such.

  • When downloading a .csv file in Safari, it adds .xls, making the file filename.cvs.xls

    When downloading a .csv file in Safari, it adds .xls, making the file filename.cvs.xls
    If I rename the file, it opens just fine, if I don't it opens all in one column.
    I had found a fix on my old macbook, but just got a new MBP and it's happening again.
    Can't remember or find where the fix is.
    Thanks!

    Safari: Downloaded file's filename may have an additional extension
    http://support.apple.com/kb/TA24293
    That's from June 11, 2007!
    Working from my defective memory, this happened to me, but stopped if I unchecked 'Open safe files after downloading' in Safari Preferences/General.
    At least I think that's how I stopped it - it hasn't happened since!

  • How can we a validate a CSV file in SSIS and log the error details in another CSV File by using Sript Task.

    How can we a  validate a CSV file in SSIS and log the error details in another CSV File by using Sript Task.

    Please see:
    http://www.bidn.com/blogs/DevinKnight/ssis/76/does-file-exist-check-in-ssis
    http://social.msdn.microsoft.com/Forums/en-US/01ce7e4b-5a33-454b-8056-d48341da5eb2/vb-script-to-write-variables-to-text-file

  • Letting users download a CSV file

    I need to add a link to some html code generated by a servlet that will allow users to download a csv file. The problem is that the only other link I have seen function like that was in a static html page and it simply used a href tag to identify the csv file and the user was automatically asked whether to open it or save it to their PC. When I use such a link in the servlet, the servlet displays the contents of the file in a browser window instead of giving the user the option to save it to their PC. Can someone please help me?

    Are you generating the CSV file with a servlet? If so, try this:
    response.setContentType("text/x-csv");
    response.setHeader("Content-disposition", "inline;filename=MyOutputFile.csv");

  • How to download a CSV file to a shared network folder ?

    Hi Experts,
    I have created a report which exports a CSV file on application server using scheduled background job. I have used the OPEN DATASET feature to download the file on a location on the application server which is working fine.
    But my requirement is that I have to download this file to a shared folder which is situated on another location and is shared in my application server as 'N' drive. But when I give the path of this N drive in my report, its giving runtime error that the <filename> is not open.
    So pls help me how to give path to such shared network folder to download the file?
    Thanks,
    Vishal .

    Hi Guys,
    I tried alot but it didnt work.
    SO I decided to export the file on the application server only.
    I created a background job that runs periodically and exports the file to C drive of the application server.
    The job run sucessfully only the first time but gets cancelled after that.
    I ran the job for an hour but not a single time it finished successfully. Every time it was cancel with dump error shown below.
    +++++++++++++++++++++++++++++++++++++++++++
    Category               ABAP Programming Error
    Runtime Errors         DATASET_NOT_OPEN
    Except.                CX_SY_FILE_OPEN_MODE
    ABAP Program           ZBATCHSTOCK
    Application Component  Not Assigned
    Date and Time          01.08.2014 18:52:13
    Short text
         File "C:\GOOGLE_SAP\BATCH_DETAILS.CSV" is not open.
    What happened?
         Error in the ABAP Application Program
         The current ABAP program "ZBATCHSTOCK" had to be terminated because it has
         come across a statement that unfortunately cannot be executed.
    What can you do?
         Note down which actions and inputs caused the error.
         To process the problem further, contact you SAP system
         administrator.
         Using Transaction ST22 for ABAP Dump Analysis, you can look
         at and manage termination messages, and you can also
         keep them for a long time.
    ++++++++++++++++++++++++++++++++++++++++++++++++++++++
    And the same background job runs properly on development server without any cancelled job.
    So pls help me what should be the problem ??
    Thanks,
    Vishal

  • I am try to download a CSV file and have it directly open in excel. It only opens in new page and not in excel. how do I get it to do that.

    In internet explorer I use to be able to click on a download link to have a csv file open in excel. I have never been able to open this download file before with Firefox. It turns out that I can no longer do it with Explorer either. I have sent this same question to them for help as I require this information. It is being downloaded from a secure site and is used for registration information.
    I need help as soon as possible.
    Thank you
    Rob

    See:
    *Firefox/Tools > Options > Advanced > General : Accessibility : [ ] "Warn me when web sites try to redirect or reload the page"
    The setting in "Tools > Options > Advanced > General" is meant as an accessibility feature, as you can see by the label of that section, so that people with disabilities or people who use screen readers do not get confused and is not meant as a safety protection to stop redirecting.
    See also:
    *https://support.mozilla.com/kb/Options+window+-+Advanced+panel#General_tab
    *http://kb.mozillazine.org/accessibility.blockautorefresh
    *http://kb.mozillazine.org/Accessibility_features_of_Firefox

  • How to create a help button for downloading a help file in OA Framework

    Hi all
    I want to create a help button for downloading a help document.Plz suggest me how to do it.
    Thanks
    Bhupendra

    Create a button of type "button",set the destination url property to the place u have kept the file.But ur file should be anywhere in Common_top.If this file is stored as blob u can use messagedownload bean.
    --Mukul                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • How to use GUI_upload for Uploading a CSV file in Microsoft Excel.

    Hi Guys,
                  can anybody tell me how to Upload the CSV format file in Microsoft excel sheet?
    Thanks,
    Gopi.

    Hi Gopi,
    u can use GUI_UPLOAD, TEXT_CONVERT_XLS_TO_SAP.
    Please check these codes.
    Uploading data from CSV file format into internal table using GUI_UPLOAD
    REPORT zupload MESSAGE-ID bd.
    DATA: w_tab TYPE ZTEST.
    DATA: i_tab TYPE STANDARD TABLE OF ZTEST.
    DATA: v_subrc(2),
    v_recswritten(6).
    PARAMETERS: p_file(80)
    DEFAULT 'C:\Temp\ZTEST.TXT'.
    DATA: filename TYPE string,
    w_ans(1) TYPE c.
    filename = p_file.
    CALL FUNCTION 'POPUP_TO_CONFIRM'
    EXPORTING
    titlebar = 'Upload Confirmation'
    * DIAGNOSE_OBJECT = ' '
    text_question = p_file
    text_button_1 = 'Yes'(001)
    * ICON_BUTTON_1 = ' '
    text_button_2 = 'No'(002)
    * ICON_BUTTON_2 = ' '
    default_button = '2'
    * DISPLAY_CANCEL_BUTTON = 'X'
    * USERDEFINED_F1_HELP = ' '
    * START_COLUMN = 25
    * START_ROW = 6
    * POPUP_TYPE =
    * IV_QUICKINFO_BUTTON_1 = ' '
    * IV_QUICKINFO_BUTTON_2 = ' '
    IMPORTING
    answer = w_ans
    * TABLES
    * PARAMETER =
    * EXCEPTIONS
    * TEXT_NOT_FOUND = 1
    * OTHERS = 2
    IF sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    * WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    CHECK w_ans = 1.
    CALL FUNCTION 'GUI_UPLOAD'
    EXPORTING
    filename = filename
    * FILETYPE = 'ASC
    has_field_separator = 'X'
    * HEADER_LENGTH = 0
    * READ_BY_LINE = 'X'
    * IMPORTING
    * FILELENGTH =
    * HEADER =
    TABLES
    data_tab = i_tab
    EXCEPTIONS
    file_open_error = 1
    file_read_error = 2
    no_batch = 3
    gui_refuse_filetransfer = 4
    invalid_type = 5
    no_authority = 6
    unknown_error = 7
    bad_data_format = 8
    header_not_allowed = 9
    separator_not_allowed = 10
    header_too_long = 11
    unknown_dp_error = 12
    access_denied = 13
    dp_out_of_memory = 14
    disk_full = 15
    dp_timeout = 16
    OTHERS = 17.
    * SYST FIELDS ARE NOT SET BY THIS FUNCTION SO DISPLAY THE ERROR CODE *
    IF sy-subrc <> 0.
    v_subrc = sy-subrc.
    MESSAGE e899 WITH 'File Open Error' v_subrc.
    ENDIF.
    INSERT ZTEST FROM TABLE i_tab.
    COMMIT WORK AND WAIT.
    MESSAGE i899 WITH sy-dbcnt 'Records Written to ZTEST'.
    Uploading data from Excel file format into internal table using TEXT_CONVERT_XLS_TO_SAP
    REPORT  zupload_excel_to_itab.
    TYPE-POOLS: truxs.
    PARAMETERS: p_file TYPE  rlgrap-filename.
    TYPES: BEGIN OF t_datatab,
          col1(30)    TYPE c,
          col2(30)    TYPE c,
          col3(30)    TYPE c,
          END OF t_datatab.
    DATA: it_datatab type standard table of t_datatab,
          wa_datatab type t_datatab.
    DATA: it_raw TYPE truxs_t_text_data.
    * At selection screen
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
      CALL FUNCTION 'F4_FILENAME'
        EXPORTING
          field_name = 'P_FILE'
        IMPORTING
          file_name  = p_file.
    *START-OF-SELECTION.
    START-OF-SELECTION.
      CALL FUNCTION 'TEXT_CONVERT_XLS_TO_SAP'
        EXPORTING
    *     I_FIELD_SEPERATOR        =
          i_line_header            =  'X'
          i_tab_raw_data           =  it_raw       " WORK TABLE
          i_filename               =  p_file
        TABLES
          i_tab_converted_data     = it_datatab[]    "ACTUAL DATA
       EXCEPTIONS
          conversion_failed        = 1
          OTHERS                   = 2.
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
    * END-OF-SELECTION.
    END-OF-SELECTION.
      LOOP AT it_datatab INTO wa_datatab.
        WRITE:/ wa_datatab-col1,
                wa_datatab-col2,
                wa_datatab-col3.
      ENDLOOP.
    reward if helpful
    raam

  • How to use auto fit selection when downloading to csv file

    hi,
    I am working on reports, i need to download to a .csv file. I am using GUI_DOWNLOAD is there any option for it where text fits exactly in a single cell.
    For Eg:
    I excel there is an option (Format-column-Autofitselection).
    Then the column size increases or decreased according to the text size.

    Dear Josephine,
       There is no option the way you want of autofit. Rather while opening the CSV in excel u can do the required formatting.
    Regards,
    Deva.

  • How can I download zipped CSV files in Firefox and ensure this happens automatically in future?

    When I attempt to download a zipped CSV file in Firefox, the usual pop-up window appears asking what Firefox should do with this file... even after I select "Open with" and choose my Zip File Manager and tick the box that says "Do this automatically for files like this from now on", this pop-up continues to appear every time I come to download files

    @Corel
    Thanks, I had forgotten all about potential server side problems.
    @Conners81 <br/>
    If sample problem files and links are publicly available maybe you could include an example of the link being used, preferably to one of the smaller simpler files.
    *What is the website you are using?
    For comparison an example you may like to try
    * site providing .csv data [http://www.ofcom.org.uk/static/cmr-10/WAL-3.4.html]
    ** a small few lines csv download file [http://www.ofcom.org.uk/static/cmr-10/csv/WAL-3.4.csv]
    ** similar info as a pdf chart [http://www.ofcom.org.uk/static/cmr-10/pdfs/WAL-3.4.pdf]
    Of course you have the added complication of the zipped file.

Maybe you are looking for

  • Moved from AVID to FCP...viewing on NTSC monitor question

    I am in the process of migrating to FCP studio from AVID with mojo. With the mojo I used a S-video out to my NTSC monitor. Now with my FCP system, I have to always have my DSR-25 on and use the composite out to the monitor. Is there a better way? I a

  • SFTP support in Flash Builder?

    Hi all, I wanted to ask whether there is SFTP support somewhere in the Flash Builder / Flex Builder or whether I can somehow add this (plugin?). I searched the internet and I didn't come up with much about it. (I just downloaded and installed Flash B

  • PDF maker change format of Excel 2007 document

    Hi, I use the scale option in Excel 2007 to format my document on a 8 1/2 X 14 page.  I set the scale 80%. When I print the document with Adobe printer, the document print to the right size ( 8 1/2 X 14). When I use PDFMaker, the page size is too lar

  • Batchprosess HDR in Lightroom cc??

    Hello I sometime want to take a lot of HDR pictures and what to get them prosessed using a batch prosess. Is this possible in Lightroom and how do I do this?

  • Passing URL to user variable

    Hi there, I am currently doing a SCORM package which has to be multi language. The URL running the SCORM package defines www.myurl.com/?lang=EN or  ?lang=DE. Now I need the language value from the URl to jump inside captivate to the correct slides. I