Render HTML inside Excel, using Open XML

Hello guys,
I am creating excel file using, Open XML.
The data will be coming from database, and can contain HTML tags.
e.g. <b>some sample <i style='color:red'> text </i></b>
I want the HTML to be rendered inside excel sheet, so that user can view well formatted excel..
Please, Help me out

Hi J_Prasanna,
I'm afraid that it's not possible with OpenXML SDK, but it's possible if you use Excel PIA along with Internet Explorer. Use the Internet Explorer COM object to render the HTML content, then copy the document, use the Paste method of the Worksheet object
to paste the text with format.
Dim IE As Object
Set IE = CreateObject("InternetExplorer.Application")
With IE
.Visible = False
.Navigate "about:blank"
.document.body.InnerHTML = Sheets("Sheet1").Range("A1").Value
.document.body.createtextrange.execCommand "Copy"
ActiveSheet.Paste Destination:=Sheets("Sheet1").Range("A1")
.Quit
End With
The code is similar if you use managed project.
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click
HERE to participate the survey.

Similar Messages

  • Auto fit columns in excel using open xml

    I have generate excel using open xml and it contain auto fit property for columns. my problem is that the excel is opening very well in kingsoft spreadsheets
    and other tools, but not opening in microsoft excel 2013 and older version. Is there any solution for auto fit columns in excel using open xml and should open in Microsoft excel  all version

    Hi Raj12345,
    >> I have generate excel using open xml and it contain auto fit property for columns. my problem is that the excel is opening very well in kingsoft spreadsheets and other tools, but not opening in microsoft excel 2013 and older version
    I assume you was using OpenXML SDK and I'm afraid we are not able to find the root cause according to your description, would you mind sharing us some code sample to reproduce this issue.
    >> Is there any solution for auto fit columns in excel using open xml and should open in Microsoft excel  all version
    As far as I know, there is no auto fit property for columns in excel with openxml. I am afraid that you need to calculate the column width depending on the cell contents, and then set the column width. The link below shows more details:
    # Solution: How to AutoFit Excel Content
    https://social.msdn.microsoft.com/Forums/office/en-US/28aae308-55cb-479f-9b58-d1797ed46a73/solution-how-to-autofit-excel-content?forum=oxmlsdk
    Best Regards,
    Edward
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

  • Change Excel sheet tab color using Open XML dll

    Hi,
    I want to change the sheet tab color of an excel Xlsx  document. I am using the following code but it does not set the sheet color. I get object reference exception when I set the sheet tab color.
    public static string filepath = @"C:\Test\Book1.xlsx";
    private static void ChangeSheetcolor()
    try
    using (SpreadsheetDocument spreadSheetDocument = SpreadsheetDocument.Open(filepath, false))
    WorkbookPart workbookPart = spreadSheetDocument.WorkbookPart;
    IEnumerable<Sheet> sheets = spreadSheetDocument.WorkbookPart.Workbook.GetFirstChild<Sheets>().Elements<Sheet>();
    //my code
    WorksheetPart worksheetPart =
    GetWorksheetPartByName(spreadSheetDocument, "Sheet1");
    if (worksheetPart != null)
    // worksheetPart.Worksheet.SheetProperties.TabColor.Rgb = DocumentFormat.OpenXml.HexBinaryValue.FromString("Red");
    worksheetPart.Worksheet.SheetProperties.TabColor.Rgb = DocumentFormat.OpenXml.HexBinaryValue.FromString("#CCCCCC");
    // Save the worksheet.
    worksheetPart.Worksheet.Save();
    catch (Exception ex)
    private static WorksheetPart
    GetWorksheetPartByName(SpreadsheetDocument document,
    string sheetName)
    IEnumerable<Sheet> sheets =
    document.WorkbookPart.Workbook.GetFirstChild<Sheets>().
    Elements<Sheet>().Where(s => s.Name == sheetName);
    if (sheets.Count() == 0)
    //does not exist
    return null;
    string relationshipId = sheets.First().Id.Value;
    WorksheetPart worksheetPart = (WorksheetPart)
    document.WorkbookPart.GetPartById(relationshipId);
    return worksheetPart;
    How to change the sheet tab color using Open XML dlls.
    Thanks
    Ashok

    Hi J_Prasanna,
    I'm afraid that it's not possible with OpenXML SDK, but it's possible if you use Excel PIA along with Internet Explorer. Use the Internet Explorer COM object to render the HTML content, then copy the document, use the Paste method of the Worksheet object
    to paste the text with format.
    Dim IE As Object
    Set IE = CreateObject("InternetExplorer.Application")
    With IE
    .Visible = False
    .Navigate "about:blank"
    .document.body.InnerHTML = Sheets("Sheet1").Range("A1").Value
    .document.body.createtextrange.execCommand "Copy"
    ActiveSheet.Paste Destination:=Sheets("Sheet1").Range("A1")
    .Quit
    End With
    The code is similar if you use managed project.
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • When reading the Rich Text present in Excel column using open XML its taking it as plain text

    Hello All,
    When i am reading excel columns using open Xml in C# everything is working fine except the column that
    contain Rich Text (ex: bold, italic,color,size). Its reading the Rich Text content as plain text. As we know for Rich Text in open XML we get the text as Runs (C#
    object) which contains the text as value and rpr as run properties. I have also written the code to convert Runs to html. But the issue is that for some Rich Text format its reading it as Runs but most of the Rich Text its reading it as plain text.
    The issue i am getting is, for some rich text its creating RUN and for some of the rich text its not creatingRUN.
    Let me give the example for more understanding:
    Suppose i have two cells in excel which contains the below text.
    1. Rich Text
    1
    2. RichText
    2
    Now when i read these cells using the below code
    var stringTable =spreadsheetDocument.WorkbookPart.GetPartsOfType<SharedStringTablePart>().FirstOrDefault();
    if (stringTable.SharedStringTable.ElementAt(index1).ChildElements.GetItem(0).GetType().Name == "Run")
    Custom code to convert Rich text to HTML...
    else
    Read the plain text...
    Though both the cell contains rich text, one is going in RUN block and one is going in Plain text bloc.
    Also, one thing that i have noticed is when i use standard color for text its consider it as RUNS and when i use color apart from the standard color it does not consider it as RUNS. Same behavior occurs for different combination of text viz. bold, italic, underline
    etc

    Hi Ejaz,
    This forum is for software developers who are using the Open Specification documentation to assist them in developing systems, services, and applications that are interoperable with Microsoft products. The Open Specifications can be found at:
    http://msdn.microsoft.com/en-us/library/cc203350(PROT.10).aspx. Since your post does not appear to be related to the Open Specification documentation set, we would appreciate it if
    you could try to post your question in a more relevant forum. Thank you.
    Open XML Format SDK
    https://social.msdn.microsoft.com/Forums/en-US/home?forum=oxmlsdk&filter=alltypes&sort=lastpostdesc
    Josh Curry (jcurry) | Escalation Engineer | Open Specifications Support Team

  • Why won't FireFox open local .html files (when using "open file")?

    I teach hand coding and use FireFox to grade my students work. I also tell them to use this browser to review their own work. If they cannot navigate to their files on their desktop I will have to switch to another browser. I know it is something from the latest version... as I have been using FireFox for the last 5 years as my classroom browser of choice.

    Firefox should still be able to open files using open files.
    I use Windows so things may differ slightly but the option to open files is available but not visible by default, I can get the option to browse for files using: keyboard keys'''Alt , F , O'''
    My directory structure and path may differ slightly but I am also able to key directly into the location bar something such as '''''file:///C:/'''''
    A third option would be simply to click on the relevant HTML file and use the option to open, or open with Firefox. Such files may also be bookmarked.

  • Insert a Picture into the Picture/Image Content Control using Open XML SDK 2.0

    I have created a word template as follows
    Here PizzaPicture is a Picture Content Control, PizzaName is a Plain Text Content Control and PizzaDescription is a Rich Text Content Control
    I am able to assign text to PizzaName and PizzaDescription Easily but not able to even locate the PizzaPicture. Here is my code
    using (WordprocessingDocument document = WordprocessingDocument.Open(@".\test.docx", true)) {
    MainDocumentPart mainPart = document.MainDocumentPart;
    DocumentFormat.OpenXml.Wordprocessing.Text text = null;
    SdtContentBlock pizzaNameBlock = null;
    SdtContentBlock pizzaDescriptionBlock = null;
    //SdtContentBlock pizzaPictureBlock = null;
    List<SdtBlock> sdtList = mainPart.Document.Descendants<SdtBlock>().ToList();
    foreach (SdtBlock sdt in sdtList)
    Console.WriteLine(sdt.SdtProperties.GetFirstChild<Tag>().Val.Value);
    SdtBlock s1 = mainPart.Document.Body.Descendants<SdtBlock>().Where(r => r.SdtProperties.GetFirstChild<Tag>().Val == "PizzaName").Single();
    SdtBlock s2 = mainPart.Document.Body.Descendants<SdtBlock>().Where(r => r.SdtProperties.GetFirstChild<Tag>().Val == "PizzaDescription").Single();
    SdtBlock s3 = mainPart.Document.Body.Descendants<SdtBlock>().FirstOrDefault(r =>
    SdtProperties p = r.Elements<SdtProperties>().FirstOrDefault();
    if (p != null)
    Console.WriteLine("P is not null");
    // Is it a picture content control?
    SdtContentPicture pict =
    p.Elements<SdtContentPicture>().FirstOrDefault();
    if (pict != null) Console.WriteLine("Pict is not null");
    // Get the alias.
    SdtAlias a = p.Elements<SdtAlias>().FirstOrDefault();
    if (pict != null && a.Val == "PizzaPicture")
    return true;
    return false;
    if (s3 == null) {
    Console.Write(" s3 is Null");
    } else {
    Console.WriteLine("s3 not null");
    if (s1 != null) {
    pizzaNameBlock = s1.Descendants<SdtContentBlock>().FirstOrDefault();
    text = pizzaNameBlock.Descendants<DocumentFormat.OpenXml.Wordprocessing.Text>().FirstOrDefault();
    // here you can set the current time
    text.Text = "Peperoni";
    Console.WriteLine(text.Text);
    string embed = null;
    if (s3 != null)
    Drawing dr = s3.Descendants<Drawing>().FirstOrDefault();
    if (dr != null)
    Blip blip = dr.Descendants<Blip>().FirstOrDefault();
    if (blip != null)
    embed = blip.Embed;
    if (embed != null)
    IdPartPair idpp = document.MainDocumentPart.Parts
    .Where(pa => pa.RelationshipId == embed).FirstOrDefault();
    if (idpp != null)
    ImagePart ip = (ImagePart)idpp.OpenXmlPart;
    using (FileStream fileStream =
    File.Open(@"c:\temp\pepperoni.jpg", FileMode.Open))
    ip.FeedData(fileStream);
    if (s2 != null) {
    pizzaDescriptionBlock = s2.Descendants<SdtContentBlock>().FirstOrDefault();
    string altChunkId = "AltChunkId12345";
    AlternativeFormatImportPart chunk = mainPart.AddAlternativeFormatImportPart(AlternativeFormatImportPartType.Xhtml, altChunkId);
    chunk.FeedData(File.Open(@".\html.txt", FileMode.Open));
    AltChunk altChunk = new AltChunk();
    altChunk.Id = altChunkId;
    ////Replace content control with altChunk information
    OpenXmlElement parent = pizzaDescriptionBlock.Parent;
    parent.InsertAfter(altChunk, pizzaDescriptionBlock);
    pizzaDescriptionBlock.Remove();
    mainPart.Document.Save();
    document.Close();
    Here the call mainPart.Document.Descendants<SdtBlock>().ToList(); returns me only 2 items PizzaName, PizzaDescription but
    no PizzaPicture.
    Secondly the line   SdtContentPicture pict =  p.Elements<SdtContentPicture>().FirstOrDefault();
    returns NULL. So it seems that there is no element of type SdtContentPicture.
    What am I doing wrong? I am pretty sure that I have put PizzaPicture as a Picture content control.
    My objective is to locate this control in the document and then insert an image into it programmatically.
    MSDNStudent Knows not much!

    Hi,
    I'm running some test on your code, and I'll come back as soon as I get some update. But before that, I would recommend you to bind customXMLPart with the content controls via Content Control Tool Kit,
    which enables us to bind customXMLPart with CC by dragging and dropping.
    After binding, you can change contents of the template via OpenXML SDK easily as the following code:
    private void button1_Click(object sender, EventArgs e)
    string fileName = @"C:\CCTest.docx";
    WordprocessingDocument wordDoc = WordprocessingDocument.Open(fileName, true);
    MainDocumentPart mainPart = wordDoc.MainDocumentPart;
    CustomXmlPart customPart = mainPart.CustomXmlParts.FirstOrDefault();
    //convert image into string
    string picName = @"C:\Users\Public\Pictures\Sample Pictures\Desert.jpg";
    System.IO.FileStream fileStream = System.IO.File.Open(picName, System.IO.FileMode.Open);
    System.IO.BinaryReader br = new System.IO.BinaryReader(fileStream);
    byte[] byteArea;
    byteArea = br.ReadBytes(System.Convert.ToInt32(fileStream.Length));
    string picString = System.Convert.ToBase64String(byteArea);
    //Load the XML template
    string DataString = Properties.Resources.XMLData;
    XmlDocument xmlDoc = new XmlDocument();
    xmlDoc.LoadXml(DataString);
    //change the value
    XmlNodeList xmlNode = xmlDoc.GetElementsByTagName("pizzaPic");
    xmlNode[0].InnerText = picString;
    xmlNode = xmlDoc.GetElementsByTagName("pizzaName");
    xmlNode[0].InnerText = "Pizza Name";
    xmlNode = xmlDoc.GetElementsByTagName("pizzaDescription");
    xmlNode[0].InnerText = "Pizza Description";
    //write the custom xml data into the customxmlpart
    System.Xml.XmlTextWriter writer = new System.Xml.XmlTextWriter(customPart.GetStream(System.IO.FileMode.Create), System.Text.Encoding.UTF8);
    writer.WriteRaw(xmlDoc.InnerXml);
    writer.Flush();
    writer.Close();
    fileStream.Close();
    br.Close();
    mainPart.Document.Save();
    wordDoc.Close();
    and the XML template of the project would something like:
    <?xml version="1.0"?>
    <Pizza xmlns="http://Test/ContentControls/Pizzas">
    <pizzaPic></pizzaPic>
    <pizzaName></pizzaName>
    <pizzaDescription></pizzaDescription>
    </Pizza>
    I hope this helps.
    Calvin Gao[MSFT]
    MSDN Community Support | Feedback to us

  • Insert Pie Chart to Excel Using OpenXml

    I managed to implement the code(I got from MSDN) to create a bar graph in excel, I am however facing challenges in creating a piechart, I had thought that I can manipulate the code a little bit and  produce a pie chart-but I have spent nights and
    nights still can't find my way to create a pie chart. I need help on this, I would appreciate if you can help me through this.
    F.Shumba

    Hi F.Shuba,
    From the description, you want to create a piechart using Open XML.
    A recommend way is that create a pie chart manually and use Open XML SDK 2.5 Productivity Tool to open this workbook. Then you can get the code for creaing the chart for reference.
    If you still have issue, please feel free to let me know.
    Regards & Fei
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • How to save a selected word image to image file in open XML in PNG format?

    Hi Everyone,
    I have a very strange problem. I want to extract the image from word using open xml sdk. Here the user selects the image on opened word, and then clicks on any button, so it should extract the same selected image to any predefined location in the PNG format.
    I also tried to do the same thing using Word API, there I am copying the selection of image to clipboard and then getting the image and converting it to bitmap and saving it, but the image resolution is coming very bad. Is there any method through which
    I can save the image to file either by Open XML sdk or Word API using C#.
    Thanks,
    Shahab Abbasi

    Hi Shahab,
    To extract images from word document, please take a look at this thread:
    https://social.msdn.microsoft.com/Forums/office/en-US/e2a795ea-2ab7-401e-b6a8-0576220553f8/openxml-excel-how-to-extract-only-image-files?forum=oxmlsdk
    string fileName = @"C:\test.docx";
    using (WordprocessingDocument document = WordprocessingDocument.Open(fileName, true))
    var e = document.MainDocumentPart.ImageParts.GetEnumerator();
    int picNum = 0;
    while (e.MoveNext())
    picNum++;
    ImagePart imagePart = e.Current;
    Stream stream = imagePart.GetStream();
    long length = stream.Length;
    byte[] byteStream = new byte[length];
    stream.Read(byteStream, 0, (int)length);
    FileStream fstream = new FileStream(@"C:\abc.jpg", FileMode.OpenOrCreate);
    fstream.Write(byteStream, 0, (int)length);
    fstream.Close();
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Open xml relationship target is NULL when inserting chart

    Hi,
    I have looked into the specification ISO/IEC 29500-1:2012 and i understand that the attribute Target for the element Relationship can be set to NULL at times(Empty header and footer in the specification).
    Now, i have stumbled on Target being NULL also when inserting a diagram into a word document. For example:
    <Relationship Id="rId3" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/oleObject"
    Target="NULL" TargetMode="External" xmlns="http://schemas.openxmlformats.org/package/2006/relationships" />
    I'm using Open xml sdk and i'm trying to create a relationship. My question is how i should resolve the target which i think should point to the diagram/chart that i inserted.
    Br,
    /Peter
    Peter

    Hi Cindy,
    It is "easy" to reproduce :)
    1. Create a word document
    2. Add a CustomXml to the document with for example "Word content control toolkit"
    2:1 The CustomXml should look something like this <Root xmlns=http://schemas.company.se><Description></Description></Root>
    3. Open up the word document and open up the "XML Mapping Pane" under Developer tab. Add rich text content control which mapps to the <Description> element.
    4. Save and close the document
    5. Take a copy of thedocument
    6. Open up the document again, place the insert point within the content control mapped to <Description> element and insert a Chart.
    7. Save and close the document
    8. Rename the document with the extension .zip and navigate to word/charts/_rels/ and open up chart2.xml.rels.
    9. Search for Target="NULL", you should find 1 occurrence
    You can also download a sample here: http://1drv.ms/1raxoUr
    Br,
    /Peter
    Peter

  • "Open In Excel" button inside the Xlviewer.aspx page return Error and I can not open excel using local office

    Inside the xlviewer.aspx page when I click on "Open In Excel" at first I receive this Error: 
    Some files contain viruses that can be harmful to your computer. it is important to be certain that this file is from a trustworthy sourceDo you want to open this file?
    Then, When I click on Yes, the second error message(below) shows and I can not open Excel using my local Excel Application.
    This action couldn't be performed because office doesn't recognize the command it was given.
    I should notice that the application is published under the HTTPS protocol.
    It is just working with IE 9.0. Neither Chrome nor IE after 9.0.

    Sure. I posted here since I suspect that the lastest upgrade may have a bearing on it.
    What do I need to move it over to Number and Lion?

  • How do I save an excel file as XML using applescript.

    I set display alerts to false, but excel will not save.  I get error -1708.
    My code looks as such:
    set theFile to "Macintosh HD:Users:Dustin:Documents:products.xlsx"
    tell application "Microsoft Excel"
      activate
      open theFile
              set display alerts to false
              tell active sheet
      save as filename "products.xml" file format XML spreadsheet file format
              end tell
      close active workbook without saving
              set display alerts to true
    end tell
    end
    If I remove the code to set the display alerts, excel pops up an display alert to continue or cancel the save.
    I'll take anything at this point....

    Are you sure you want to do a "SAVEAS" to create the PDF?  What version of MS Office are you using?
    One of the best ways to figure out how to do something with ActiveX in Excel is to first do it in Excel by recording a Macro.  See what code Excel generates, then try to model that in LabVIEW.
    I don't see .pdf as an option you can save Excel as a filetype to (Excel 2007).  But when I go to the Excel 2007 button, Save As, then PDF or XPS while recording a macro, I get this code.
    ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:= _
    "C:\Documents and Settings\CurrentUser\Desktop\FILENAME.pdf", Quality:= _
    xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas:=False, _
    OpenAfterPublish:=True
       This shows me you should be usingthe ExportAsFixedFormat method on the worksheet as opposed to trying to use the SaveAs method on the workbook.  (But the workbook object as that same method as well.)

  • Open xml file in excel - default should be selected

    Hi All,
    I have done an Application to Export the Table data to Excel . I have done it successfully.
    But at the time of exporting the data to excel, it is prompting for the following options
    How to Open Files in Excel
    When you open an XML file in Excel, you are prompted to select one of the following methods to import the XML data:
                       As an XML list
                       As a read-only workbook
                       Use the XML Source task pane
    I dont want to see these three options (by default First should be selected). How can i do this.
    Thanks in Advance for ur replies.
    Regards,
    Malla

    Hi,
    I am not sure how much this information helps to you. I am postiong this information to give you an idea.
    If you are able to achive this please let me know.
    As per my analysis it is not possible to hide these options.
    Even if you crate one .xml file on your desktop and if you open with Microsoft Excel it will give these three options. You have to select one of the options.
    I think WD Node data will be converted to xml and it will be opened through Microsoft Excel i guess.
    There are specific reasons why Microsoft Excel ask to choose these options when we try to open an xml file in Excel.
    As an XML list
    An XML list is created in a new workbook.
    The contents of the file are imported into the XML list. If the XML data file does not refer to a schema, then Microsoft Excel will infer the schema of the XML data file.
    As a read-only workbook
    The XML data file is opened as a read-only workbook. The structure of the file is flattened.
    Use the XML Source task pane
    Use the XML Source task pane
    The schema of the XML data file is displayed in the XML Source task pane. You can then drag elements of the schema to the worksheet to map those elements to the worksheet.
    If you are opening an XML data file that does not refer to a schema, then Excel will infer the schema of the XML data file.
    Regards,
    Charan

  • Issues opening excel saved as xml with reports builder 10.1.2.0.2

    Hi
    I saved excel as xml and when I try to open it using Oracel Reports, I get the following error:
    REP-6106: Error in XML report definition at line 2 in .....\...\Book1.xml
    This is what is there in line 2:
    Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet"
    Has anyone had similar issues in opening excel saved as xml?
    Any help?
    Thx!

    Hi
    Thanks for the response. The document is good for issues with jsp reports. I am not even able to save this one as jsp till now. Not sure if there is some other way to do it.
    This is what I did:
    1. Create an excel template with 2 worksheets.
    2. Save as xml.
    3. Try to open with reports builder.
    Thats when I get the error.
    Not sure if my version problem or I am missing out on some step.
    Thx!

  • Fetch excel file from app. server using open dataset...

    Hello Experts,
    Our functional consultant is asking me if it possible to get an excel file from the
    application server file using OPEN dataset and in background mode? If yes, Please tell me on how to do this.
    Thank you guys and take care!

    Hi Viraylab,
    to download this the procedure:
    you can use the FM 'EXCEL_OLE_STANDARD_DAT ' for this purpose.
    this FM 'EXCEL_OLE_STANDARD_DAT' can be used to start Excel with a new sheet and transfer data from an internal table to the sheet.
    Here are some of the parameters:
    file_name: Name and path of the Excel worksheet file e.g. ?C:TEMPZTEST?
    data_tab: Name of the internal table that should be uploaded to Exvcel
    fieldnames: Internal tabel with column headers
    How to build the field names table:
    data: begin of i_fieldnames occurs 20,
    field(60), end of i_fieldnames.
    i_fieldnames-field = ?This is column 1?. append i_fieldnames-field.
    i_fieldnames-field = ?This is column 2?. append i_fieldnames-field.
    to upload follow this:
    OPEN DATASET dsn FOR INPUT IN BINARY MODE.
    DO.
    READ DATASET dsn INTO itab-field.
    IF sy-subrc = 0.
    APPEND itab.
    ELSE.
    EXIT.
    ENDIF.
    ENDDO.
    [/code]Rob
    or Try this function module.
    FILE_READ_AND_CONVERT_SAP_DATA
    pass 'XLS' to I_FILEFORMAT..
    Dont forgot to Reward me points .....All the very best....
    Regards,
    Sreenivasa sarma K.

  • Data of alv report in  excel file in background processing using open datas

    Hi Experts,
    I have developed report for purchase register . if i execute this report in background process i am not able to get the downloaded file in excel and output is also not coming properly, columns are going to overlap.
    i used open dataset  read dataset and close dataset but still problem is not solved. so if anyone have code with this and also which will have concatenate statement in the code send it.
    Regards,
    Rahul

    Hi Rahul,
    Ur code shud be like below:
    DATA : l_filename2 TYPE string,
                v_extn.
        SPLIT p_filename AT '.xls' INTO l_filename2  v_extn.
        CONCATENATE l_filename2  'downloaded'  INTO l_filename2  SEPARATED BY '_'.
        CONCATENATE l_filename2  'txt'   INTO l_filename2 SEPARATED BY '.'.
        OPEN DATASET l_filename2 IN TEXT MODE FOR OUTPUT ENCODING DEFAULT.
        IF sy-subrc <> 0.
          MESSAGE e499(sy) WITH text-e02.
        ENDIF.
        LOOP AT it_order_number INTO wa_order_number.
          TRANSFER wa_order_number TO l_filename2.
        ENDLOOP.
        CLOSE DATASET l_filename2.
    Now, go to tcode AL11 and check it in the Application server itself.
    Hope this helps,
    Regards,
    Arnab.

Maybe you are looking for

  • Reinstall IIS on a SBS 2011?

    I deleted IIS 7 and WSUS on a SBS 2011 server. Now IIS wont reinstall. Reason: Exchange Console did not find the local Server any more and Exchange cannot be administered. Maybe the reason was the Exchange SP3 installation in Sept 2013. Nobody did no

  • CS4 Should I Stay or should I Go ?

    I am having a difficult time to decide if I should stay with Dreamweaver as my WYSIWYG editor for web development. I am still quite new to the whole Dynamic website development but am well experienced in Visual Basic I have been using Dreamweaver MX

  • Upload web site

    I start devoloping a site in my PowerBook using Iweb; the site was published and all worked fine. But now, that I need to upload the site to my G5 to keep working in it, I am out of luck. Probably the designers didn't thought that uploading is a must

  • Pandora starts playing randomly while I am on the net or watching a movie. How do I fix this problem? Thanks.

    Pandora starts playing randomly while I am on the net or while watching a movie. How do I fix this problem? Thanks.

  • SAP NetWeaver Developer Studio Support Portlet Development

    Hi Everybody, Do we create portlet with SAP NetWeaver Developer Studio SAP. NetWeaver Application Server, Java(TM) EE 5 Edition support or it does not support Portled development. Is there any portlet plug-in for NWDS to develop portlet. Thank You Sy