Report - Problems with CSV export

Hi all,
I've tried to export a report as csv-file, but I need special formatting (every column has a given length). I found an example that's creating a csv in a before header process, using this code:
declare
date_from DATE;
date_to DATE;
begin
  date_from := TO_DATE(:P1_DATE_FROM, 'DD-MON-YYYY');
  date_to   := TO_DATE(:P1_DATE_TO, 'DD-MON-YYYY');
  owa_util.mime_header( 'application/excel', FALSE );
  htp.p('Content-Disposition: attachment; filename=hsfvkr.csv');
  owa_util.http_header_close;
for x in ( SELECT   LPAD(VERTR, 8, 0) VERTR,
                    LPAD(KONTO, 10, 0) KONTO,
                    RPAD(NAME_1, 32, ' ') NAME,
                    RPAD(ORT, 32, ' ') ORT,
                    AUF_ART,
                    RPAD(AUFNR, 8, ' ') AUFNR,
                    RPAD(RG_NR, 8, 0) RG_NR,
                    TO_CHAR(RG_DAT, 'DDMMYY') RG_DATE,
                    MENGE,
                    RPAD(IDENTNR, 22, ' ') IDENTNR,
                    RPAD(VAR, 6, ' ') VAR,
                    RPAD(BEN, 30, ' ') BEN,
                    DECODE(NVL(LENGTH(ABMESSUNG), 0), 0, RPAD(' ', 30, ' '),
                                                      RPAD(ABMESSUNG, 30, ' ')) ABMESSUNG,
                    VKPREIS,
                    PWERT_ARAB,
                    ZNR
             FROM   EXPORT_CSV_HSFVKR
             WHERE  VERTR = :P1_VERTRETER
             AND    RG_DAT >= date_from
             AND    RG_DAT <= date_to )
  loop
    htp.p( x.VERTR      || ';' ||
           x.KONTO      || ';' ||
           x.NAME       || ';' ||
           x.ORT        || ';' ||
           x.AUF_ART    || ';' ||
           x.AUFNR      || ';' || 
           x.RG_NR      || ';' ||
           x.RG_DATE    || ';' ||
           x.MENGE      || ';' ||
           x.IDENTNR    || ';' ||
           x.VAR        || ';' ||
           x.BEN        || ';' ||
           x.ABMESSUNG  || ';' ||
           x.VKPREIS    || ';' ||
           x.PWERT_ARAB || ';' ||
           x.ZNR        || CHR(13) );
  end loop;
htmldb_application.g_unrecoverable_error := true;
end;The export is working fine, but opening the file with a hex editor there are some strange signs at the start of the file (FF FE - ÿþ) and after every signs there's a 00 written.
Does anybody know what to do that 00 isn't written after every sign???
So it's looking quite good in Excel our customer can't import the csv because of the additional signs.
Thanks
chrissy
chrissy

I did something similar to what you are trying to achive but had the following lines different.
I don't know it will be of nay help, but you can try it.
begin
-- Set the MIME type
owa_util.mime_header( 'application/octet', FALSE );
-- Set the name of the file
htp.p('Content-Disposition: attachment; filename="tes.csv"');
-- Close the HTTP Header
owa_util.http_header_close;
-- Loop through all rows in for test view
I also used chr(10) which is LF for end of line instead of CR.

Similar Messages

  • BI 7 Web Templates: Problems with csv-export

    Hi all,
    I am aware that a csv-export out of a web template is associated with excel, meaning that the export in csv opens in excel.
    Nevertheless my problem is, that in the course of the export process several blank columns are inserted.
    So when I afterwards open the file with the "windows editor" for example I have a result like
    PLZ;;;45133 where I expected
    PLZ;45133
    Has anyone an idea?
    Best regards
    Mark

    Hello,
    Is there a hierarchy involved?
    If yes, then the blank spaces are inserted due to the hierarchy. When the hierarchy is drilled down, the blank spaces are inserted to show the hierarchy structure. Unfortunately, this is standard and cannot be changed using standard BW functionality.
    Thanks,
    Michael

  • Many problems with the 'Export to Text' (.txt) in CR Xi

    Hi,
    I have listed many problems with the 'Export to Text' (.txt) function of CR Xi.
    These problems are related to this export format only (meaning everything works fine in the Viewer or in the 'Export to PDF')...
    - Multi-columns layout do not export as Multi-column (export only a one column);
    - Numeric values with parenthesis for negative values or with a fix currency sign at the leftmost position are not exported correctly;
    - Fields having a Suppress formula which is "WhilePrintingRecords" do not appears when exported;
    - Fields with 'Suppress double value' checked are not always suppressed when exported to Text.
    - 'Keep Group Together' flag is not working.
    - 'Reset Page Number After' simply does not works when exported to text;
    - 'Keep object together' on TextBox/Section is not working.
    - Whenever a group is ending on the last line of a page, the the following page as the same Group header as the previous group with no records until the page is filled, then the PageBreak and PageHeader is missing but the records of the following group appears.
    I would like to know what is the status of the 'Export to Text' function (is it a deprecated function not supported anymore???).
    If still supported, when will these bugs be fixed???
    Thanks

    Hi Rene
    Export to Text is supported till date. Crystal Reports 2008 also supports this with Keep together working however when I tried with format with multiple columns, it didnot show up in the exported text file.
    Regards
    Sourashree

  • Reporting problems with iTunes

    Does anyone know how to report problems with updates to iTunes to Apple? I cannot find any way to contact them to alert them to bugs and problems.

    And if you're an ADC member (the Online membership is free), you can use Apple's Bug Reporter.

  • HT4718 are there any reported problems with safari with the new OS X Mavericks?

    My early 2008 iMac running OS X 10.9.2 all of the sudden has problems loading pages in safari.  The problem timing is the same as the upgrade to Maverick. The computer is connecting to wifi and other devices such as iPhones and three PCs have no problems.  The ISP is Xfinity.  Are there any reported problems with Maverick and Safari?

    Try searching.

  • Chrome (Windows NT 6.1 6.2) users reporting problems with loading and mouseevents - any insights?

    For several years now, I have created simple studies (I do psychological stuff) to run online, recruiting participants through Amazon Mechanical Turk (AMT). I have had no problems until recently (last 6 to 9 months). Now, some AMT users are reporting problems with stimuli loading or buttons not responding immediately when clicked (e.g., advancing to a new screen). What is common amongst all the users experiencing problems is that they use Chrome, and they also tend to be Windows NT 6.1 or 6.2 users running Flash Player 12.0. But not a single Firefox, Safari, or MSE user has ever reported an issue. I'm just looking for help in troubleshooting this problem. Again, the studies I run are incredibly simple (e.g., no videos being loaded from server, etc.), mostly word presentation where I record time and x,y coordinates of mouse movements as they respond to questions. Would attempting to publish for another target version of Flash Player help? The default setting is to publish the .swf and .html wrapper for Flash Player version 11.7. Any ideas? I also use version 13.0.1 of Flash Professional CC to create my studies if it helps. 

    This is helpful. Thanks. So it would be to my advantage to play around with something like SWFObject 2?
    http://www.adobe.com/mena_fr/devnet/flashplayer/articles/swfobject.html
    Or is there something else you would recommend?
    What I've been doing is a far cry from actual web development, but quite interested in learning more. This swfobject seems to get at what you are suggesting (I think). 

  • Interactive Report - problem with export by email

    Hi,
    We're upgrading to Apex 4.0 and we encountered a problem with the email export in html format for the Interactive Reports. The french accents are displayed with some weird symbols in the HTML file.
    When I export directly in html from my report instead of the email, the accents are fine. So the problem must be the encoding of the email which is set to UTF-8. Our database use WE8MSWIN1252 encoding for the NLS Characterset.
    Without changing our NLS Characterset, is there something I can do to correct this ?
    Thanks

    Hi Denes,
    The administrator have created a mapping table,and they send me this two lines in JMT.conf file:
    /htmldb-test /i/fck/*
    /htmldb-test /pls/*
    The error still exists,i would like to know if these two lines generate a kind of confusion in any treatment of filtre in interactive report.
    Aymen

  • Problem with column export

    Hi ,
    I have a column in a report that I want to include in the csv export.
    The column has a "Column Link" pointing to some other page in the application.
    I tried setting field "Include In Export" to "Yes" and applying the changes. But when I see the column again, this field shows "No". I have tried this many times but every time, this field gets reset to "No". I am not able to export this column to csv export file.
    Is there any problem with exporting columns with "Column Link"?
    ~Ketan

    That problem is being debated, see: Include in Export does not work in APEX 3.1 .
    Scott

  • Problem with PDF export and embedded font (characters disappear)

    Designer: Crystal Reports 2008 SP 2
    Engine: CR4E 2.0 SP2 (runtime_12.2.203)
    Hi there!
    we found a problem in the pdf export. It seems like there would be a problem with the embedded fonts, the problem is as follows:
    Rpt file with, for example only a text box which contains the german string " Änderungs Schlüssel ".
    Export the Rpt file with CR4E to a pdf file.
    When we open the pdf file in Adope Reader 8, the text appears to be correct,
    but if we print the PDF file from the Adope Reader, the text changes to " nderungs Schl sselu201C,
    here we are missing ther german umlaute.
    When we open the file for example with an alternative PDF reader like Foxit Reader, there they are also missing.
    After i found some posts here in the forum, there are people facing the same problem, since i couldn't find a solution in the forum, we build a little workaround for it that works for us.
    For all of you that have the same problem here the workaround:
    We used the IText JAVA library, this jar can can help as to fix the PDF file so the text is displayed correctly.
    Here the code:
    ReportClientDocument doc = new ReportClientDocument();
    doc.setReportAppServer(ReportClientDocument.inprocConnectionString);
    doc.open("C:\XY.rpt", OpenReportOptions._openAsReadOnly);
    //... database logon,.....
    InputStream inputStream = doc.getPrintOutputController().export(ReportExportFormat.PDF);
    inputStream = PDFHealer.heal(inputStream);
    //... write the stream some where

    The helper class using IText:
    import java.io.ByteArrayInputStream;
    import java.io.ByteArrayOutputStream;
    import java.io.IOException;
    import java.io.InputStream;
    import com.lowagie.text.Document;
    import com.lowagie.text.DocumentException;
    import com.lowagie.text.pdf.PdfContentByte;
    import com.lowagie.text.pdf.PdfImportedPage;
    import com.lowagie.text.pdf.PdfReader;
    import com.lowagie.text.pdf.PdfWriter;
    public class PDFHealer
       public static InputStream heal(InputStream in) throws DocumentException, IOException
          try
             ByteArrayOutputStream out = new ByteArrayOutputStream();
             PdfReader reader = new PdfReader(in);
             // we retrieve the total number of pages
             int n = reader.getNumberOfPages();
             // step 1: creation of a document-object
             Document document = new Document();
             // step 2: we create a writer that listens to the document
             PdfWriter writer = PdfWriter.getInstance(document, out);
             // step 3: we open the document
             document.open();
             // step 4: we add content
             PdfContentByte cb = writer.getDirectContent();
             int i = 0;
             while( i < n )
                document.newPage();
                i++;
                PdfImportedPage page1 = writer.getImportedPage(reader, i);
                cb.addTemplate(page1, 0, 0);
             // step 5: we close the document
             document.close();
             ByteArrayInputStream ret = new ByteArrayInputStream(out.toByteArray());
             out.close();
             return ret;
          finally
             in.close();

  • Issue with CSV export while using HTMLDB_ITEM.SELECT_LIST_FROM_LOV in SQL

    Hi,
    I have created a SQL report with HTMLDB_ITEM package. IN that report, I have generated a report column using SELECT_LIST_FROM_LOV, which can be used by the admin to update the column entry.
    Here is the link:-
    http://apex.oracle.com/pls/apex/f?p=50508:8:
    The update is working fine, The issue is, if you download this report as a CSV, it will export all the values of the select list for that particular column. Is there any way to restrict the export to the single value of that column( or the current value in the database). Please help/ suggest.
    thanks
    VG

    Brian,
    This example:
    http://htmldb.oracle.com/pls/otn/f?p=31517:176
    and this example:
    http://htmldb.oracle.com/pls/otn/f?p=31517:160
    may help you.
    Denes Kubicek
    http://deneskubicek.blogspot.com/
    http://www.opal-consulting.de/training
    http://apex.oracle.com/pls/otn/f?p=31517:1
    -------------------------------------------------------------------

  • SSRS 2012 problem with excel export

    Hello
    I updated SSRS 2005 up to SSRS 2012. When I exported report in excel (xlsx)  I got following warning :
    "We found a problem with some conent in 'filnename.xlsx'.Do you want to try to recover as much as we can? if you trust the source of this workbook,click yes"
    After Pressing Yes Button
    "REpaired Recors: Cell information from .xl.worksheets.sheet1.xml port"
    15
    0.00000000000000000000 this is in string format instead decimal
    2
    0.00000000000000000000
    This heppens if i have decimal(38.20) variable in table and record value is 0.
    To avoid this problem i must change report and use this expression
    =IIF(Fields!SomeValue.Value = 0, 0, Fields! SomeValue.Value)
    for value in report, but this is not sulution for me because we have more then hundred reports.
    Is any other solution?

    Hi LashaGurgenidze,
    The issue seems to be related to the Excel 2010 or the Excel 2007-2010 rendering extension in SSRS 2012. If possible, I suggest that you keep the Office 2010 and the SQL Server 2012 up to date, and check the issue again.
    In order to solve the issue, we can enable the Excel 2003 rendering extension in SSRS 2012, and use this render when exporting to Excel. We can modify the EXCEL render extension in the rsreportserver.config file as follows:
    <Extension Name="EXCEL" Type="Microsoft.ReportingServices.Rendering.ExcelRenderer.ExcelRenderer,Microsoft.ReportingServices.ExcelRendering"/>
    Then, the Excel 2003 render extension will be available in the Export drop-down list.
    By default, the file is located in: C:\Program Files\Microsoft SQL Server\MSRS11.MSSQLSERVER\Reporting Services\ReportServer. Before we modify it please backup the rsreportserver.config file.
    Regards,
    Alisa Tang
    Alisa Tang
    TechNet Community Support

  • IPhoto problem with email, export, editing...

    Had my iMac upgraded with a new harddrive and Lion at my authorized retailer & service center. All has been good but did not use iPhoto much after the upgrade, but all seemed to be good.
    Recently photographed a family occasion and now I experience the following problems;
    1. After successful import I edit the pictures which leads to numerous crashes, seemingly randomly, but most frequently when jumping from editing one picture to the next.
    2. Share, Email does not work, only a few of the selected pictures are sent, sometimes with a low resolution thumbnail instead of the desired picture. The selection process works normally, but when the mail has been formatted only a few or none picture are inserted, in any of the templates, including classic. The number of selcted photos and their size are reported normal, they just don't show up in the mail itself
    3. Resorting to export to a folder, all of the pictures are exported, however not always with intact changes/edits???
    I have previously never had any major problems with iPhoto up until this version, and am seriously considering ditching it after all the wasted time.
    Any suggestions how to attack this problem in iPhoto 11 & 10.7 Lion?  (I am unable to find any plist etc like in 10.6 and earlier)
    Thanks for any hints and/or tips...

    Hi Larry,
    thanks for your quick reply...
    The harddrive and all user data was transferred by the authorized service center. I able to see and use all the old pictures, so I think (and hope) my pictures were correctly transferred.
    After reading this:
    https://discussions.apple.com/thread/3087683?start=45&tstart=0
    and done minor edits to ALL the NEW (of today) pictures I want, it seems to file, export correctly. I did some additional minor adjustments (exposure, saturation, sharpness, etc) and behold, the export worked ok, including edits like crops, straightenings, etc, that were omitted without the "adjustments"...
    It feels like some proper bugs to me, and will probably look for another more robust and flexible software to do my edits...
    Recommendations?
    Using Picasa sometimes, but read somewhere they use a hack to get to the iPhoto pictures & database, not sure I like that... Maybe I should go Aperture...???

  • Problems with Importing / Exporting Keywords and Meta Datas

    Hi to all!
    I recently upgraded to Aperture 3 and upgraded my referenced library.
    Today I opened the Keyword HUD and noticed some keywords splattered in my list, which seem to be any older ones, since the new numbering indicated that they are not applied to any pictures.
    So I deleted them.
    Than I noticed the <Imported Keywords> folder, opened it, and it contained also a large number of previous keywords. Also they seemed not to be in use, so I also removed them.
    Than I locked the Keyword HUD.
    Now my question: If I export a version, with the option for 'include metadata' ticked, and edit the version than in Photoshop, and after it, import it back into the Aperture library I do have the problem.
    I have tried 'Import Meta Datas' and and click 'Append'. Than it is recognizing the former keywords, which I would appreciate, but not as 'Imported Keywords'.
    If I would open the file w/ the External Editor and return it back, I guess I would not have this problem. Usually I do open the referenced RAW file, and import than the edited version back into Aperture. Keywords are stored in the Library, so I would not avail the former given keywords than, is that right?
    By the way are the keywords part of Meta Datas or not?
    Are there any workarounds?
    And had other people also problems with their keyword list after upgrading?
    Thank for any ideas / infos!
    Michael

    Added header to CSV and to Code
    $ImportFile = Import-Csv "C:\Users\username\Desktop\Scripts\Powershell\Epic\SCCM CI\Tags.csv" -Header Computer
    foreach ($Computer in $ImportFile){
    $path = "\\$Computer\c$\Epic\bin\7.9.2\Epic Print Service"
    $xml = select-xml -path "$path\EpicPullService.config.xml" -xpath //EpicPullService//Cleanup | Select -ExpandProperty Node
    if ($xml.ArchiveHours -eq '12' -and $xml.DeleteHours -eq '120') {
    $Compliance = $True
    }Else{
    $Compliance = $False
    } "$Computer","$Compliance" | Export-Csv "C:\Users\username\Desktop\Scripts\Powershell\Epic\SCCM CI\Results.csv"
    Results:
    select-xml : Cannot find path '\\@{Computer=SW1412-16985}\c$\Epic\bin\7.9.2\Epic Print Service\EpicPullService.config.xml' because it does not exist.
    At C:\Users\username\Desktop\Scripts\Powershell\Epic\SCCM CI\Check_PullServiceXML.ps1:4 char:8
    + $xml = select-xml -path "$path\EpicPullService.config.xml" -xpath //EpicPullServ ...
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : ObjectNotFound: (\\@{Computer=SW...vice.config.xml:String) [Select-Xml], ItemNotFoundException
        + FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.SelectXmlCommand
    If it is not a CSV file then just get it with Get-Content
    Get-Content C:\Users\UserName\Desktop\Scripts\Powershell\Epic\SCCM CI\Tags.csv |
        ForEach-Object{
            $computer=$_
            $path ="\\$computer\c$\Epic\bin\7.9.2\Epic Print Service\\EpicPullService.config.xml"
    ¯\_(ツ)_/¯

  • Indesign CS5 - Problems with PDF-Export

    Hello community,
    we do have a problem with Indesign CS5 and exporting data into PDF. It is about that logo on that white surface, which doesnt come along with the rest after the pdf-export. What we did was: We created that white surface in Indesign itself, put an effect on it with the Indesign effect gallery and then imported the logo in the surface ... the logo itself is .psd data. So, if we export it into pdf like that, it is just dissapeared. Does anyone have had a similar problem and what can be done about it?
    By the way ... if you put, for example, a simple backgroundshadow on a picture ... done also with the Indesign effect gallery, then you get just a white surface instead of the shadow, after the export into pdf. It does maybe correlate with the other problem ... not sure. Any suggestions?
    Thank you very much for your help and kind regards ...

    I would create the entire logo, including the white background, in Illustrator, save as PDF and place that in ID.

  • Problem with Xml exporter

    Hi All,
    Thanks in advance for ur warm replies.
    I am exporting personalizations which i did but iam facing problems with this.
    Please help me on this issue.
    Steps i follwed.
    Step1: exec jdr_utils.listcustomizations('/oracle/apps/ego/item/eu/webui/EGOITEMATTRIBUTEPGL');
    It displays me the customizations which i did as follows
    /oracle/apps/ego/item/eu/webui/customizations/responsibility/24091/EGOITEMATTRIBUTEPGL
    Pl/sql procedure completed successfully.
    Step2: Iam now at command prompt on java_top and i run the following command
    java oracle.jrad.tools.xml.exporter.XMLExporter
    /oracle/apps/ego/item/eu/webui/customizations/responsibility/24091/EGOITEMATTRIBUTEPGL
    -username apps -password <mypwd> \
    -dbconnection "(description=(address_list=(address=(protocol=tcp)(host=<host>)(port=<myport>)))(connect_data=(sid=<mysid>)))" \
    -rootdir "/oracle/apps/ego/item/eu/webui/EGOITEMATTRIBUTEPGL'"
    * I don't know exactly what is root directory here. which path i need to provide here.*
    Error: No such file or directory.
    Thanks and Regards
    Zaheer

    Zaheer,
    <output_dir> - (Required) Output directory where the exported xml file structure is to be stored. You may set this to any directory, however, we recommend that you export your packages or XML files to $APPL_TOP/personalizations.
    If you run the export tool for the package
    /oracle/apps/ak/dem/webui/customizations/site/0/REQORDERSTATUSPAGE and specify -rootdir
    $APPL_TOP/personalizations, the xml file is saved as
    $APPL_TOP/personalizations/oracle/apps/ak/dem/webui/customizations/site/0/REQORDERSTATUS PAGE.xml.
    In your case define rootdir as rootdir "/oracle/apps/ego/item/eu/webui ".
    Thanks
    --Anil                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

Maybe you are looking for

  • Airport Extreme to extend wireless – How best to set this up?

    I added an Airport Extreme to my ISP Service provider box in order to extend my home / home office networking capabilities. Currently I have a MBP (May 2010 model) with ethernet & wireless; a PBG4 (Feb 2005 model) with ethernet & wireless; an eMac (F

  • How to add Custom Attributes in the SOAP header for OWSM

    Hi, I like to know how to add the Custom Attributes in the SOAP header for OSWM username token authentication. Currently we are getting the header element like <wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecur

  • TAXINJ and TAXINN cannot co exist ???any alternative

    hi , help and guidance is requrired urgently, As far as my understanding goes, TAXINJ and TAXINN cannot co exist in the same system. If you are talking about technical Upgrade, then I don't think this would be feasible since old Tax would have got po

  • Apple Sponsorship towards Mac Pro Purchase?

    Hey everybody I am a student musician and composer, looking for help towards the purchase of a Mac Pro for music production and scoring. I am wondering whom I would need to contact to get further information about this? Many thanks

  • Loading images from svg file

    I'm making Texas Hold'Em as a final project for a software design class and i'm stuck on figuring out a how to display each card. I'm attempting to use an image with all 52 cards side by side, grouped according to suits. The issue I'm dealing with is