Data in report to word doc

Hi all,
I get only one field data(ie frm MANDT) from report to Word doc.
How can i get the record of a table.
REPORT  ZMGC_INT.
INCLUDE OLE2INCL.
DATA P_FWOR LIKE RLGRAP-FILENAME.
DATA I_BUFFER TYPE .
PERFORM LANZA_WORD.
FORM LANZA_WORD.
DATA: WORDAPP TYPE OLE2_OBJECT,
DOCUMENT TYPE OLE2_OBJECT,
SELECTION TYPE OLE2_OBJECT.
Copia el contenido del buffer en el portapeles
               CALL FUNCTION 'ZCLPB_EXPORT'
                 TABLES
                   DATA_TAB         = I_BUFFER
                 EXCEPTIONS
                   CLPB_ERROR       = 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.
Abre Word
CREATE OBJECT WORDAPP 'word.application'.
IF SY-SUBRC NE 0.
MESSAGE E398(00) WITH 'No se ha podido abrir el Word'.
ENDIF.
Lo pone en visible
SET PROPERTY OF WORDAPP 'Visible' = 1.
Cogemes el objeto documento
CALL METHOD OF WORDAPP 'Documents' = DOCUMENT.
Abrimos el fichero plantilla
IF P_FWOR IS INITIAL.
CALL METHOD OF DOCUMENT 'Add'.
ELSE.
CALL METHOD OF DOCUMENT 'Open' EXPORTING #1 = P_FWOR.
IF SY-SUBRC NE 0.
MESSAGE E398(00) WITH 'Error al leer el fichero plantilla'.
ENDIF.
ENDIF.
Coge el objeto selección
CALL METHOD OF WORDAPP 'Selection' = SELECTION.
Pega el contenido del portapapeles
CALL METHOD OF SELECTION 'Paste'.
IF SY-SUBRC NE 0.
WRITE 'PASTE'.
ENDIF.
Graba el fichero
CALL METHOD OF WORDAPP 'ActiveDocument' = DOCUMENT.
*CALL METHOD OF DOCUMENT 'SaveAs' EXPORTING #1 = P_FWOR.
*IF SY-SUBRC NE 0.
*MESSAGE E398(00) WITH 'Error al grabar el nuevo documento'.
*ENDIF.
Cierra Word
CALL METHOD OF WORDAPP 'Quit'.
IF SY-SUBRC NE 0.
MESSAGE E398(00) WITH 'Error al cerrar Word'.
ENDIF.
ENDFORM. " LANZA_WORD

Ranjith,
  Go to tcode SE83 -
>CONTROLS---->BASICS----->Desktop Office Integration.
Right side  examples .You will find the required code.
Pls. Mark if useful

Similar Messages

  • Table data in html from word doc

    I have a nice looking invoice word doc I would like to use to make a apex report. The word doc has a table with all the numeric data for the invoice, pretty simple. I saved the word doc as html and used a program to strip all the excess html. I put the html into a apex report as a html region and it looks perfect. What is the best way to get SQL data into the html table in the region.
    Do I have to create a SQL region and then put the html data into the header and footer, am I missing something simple?
    Thanks

    794181,
    I'd take the HTML and use it as the framework for a named column template. This will allow you to put the data from your query in to the exact spots it needs to go.
    To make a named column template, go to shared components, templates, create, report; for "Template Type:", select "Named Column (row template)".
    Named column templates are fairly easy to set up, but that also seems to mean that it's hard to find documentation for them. Basically, define your query, and then use #&lt;COLUMN_NAME&gt;# in your HTML, replacing &lt;COLUMN_NAME&gt; with the actual names of the columns from your query.
    Oh, and generally, you won't want to set up a column heading template in your named column template--I almost always just fill in Row Template 1, Before Rows, and After Rows.
    -David

  • To convert a crystal report into word(*.doc) format

    Dear members,
    I have designed and generated a report using crystal as tool,but
    i want to convert this report into Microsoft word format(*.doc).
    Can anybody please help me in this regard?
    Thanks and regards,
    Venkatesh.R

    Hi
    Simple way is to you use Cristal Reports Designer: you can use CR Report convertion function.
    File/Export/Export Report... choose Word Document (rtf) modificable what can be opened with Word and saved how Word Document (.doc).
    Other way:
    Imports CrystalDecisions.CrystalReports.Engine
    Imports CrystalDecisions.Shared
    Dim CrxReport As New CrystalDecisions.CrystalReports.Engine.ReportDocument
    CrxReport.ExportToDisk(CrystalDecisions.[Shared].ExportFormatType.RichText, _
                                        "c:\open_me_with_word.rtf")
    HTH
    Regards
    Sierdna S.
    Edited by: Sierdna S on Sep 24, 2008 12:49 PM

  • Binary Data to PDF and Word Doc

    All,
    We have requirement to open a PDF or DOC in a new window from a BAPI output structure. The field returned from the BAPI is a binary field. Following is the code that is implemented for this scenario.
    for(int i=0;i<wdcontext.nodeOutput().nodePtx_Drao().size();i++)
    IWDCachedWebResource resource = WDwebResource.getWebResource(wdcontext.nodeOutput().nodePtx_Drao().getPtx_DraoElementAt(i).getOrblk(), WdWebResourcetype.PDF);
    IWDWindow win = wdComponentAPI.getWindowManager().createNonModalExternalWindow(resource.getUrl(WDFileDownloadBehaviour.OPEN_PLACE.ordinal()), "test");
    win.open();
    The problem we are facing here is when we try to open the PDF it throws an error saying "File does not begin with '%PDF-'". If we try to open a word document by changing the resource type some junk values are coming.
    Has anyone come across this type of development issues?
    Appreciate all your replies and new inputs in this regard.
    Thanks & Regards,
    Nagarajan.

    Hi,
    I also tried with the same using the below code. Even I am getting the same error.
    byte[] test=new byte[9];test[0]=2;
    IWDCachedWebResource resource = WDWebResource.getWebResource(test,WDWebResourceType.PDF);
    When i tried the same code with other file type its working file.
    IWDCachedWebResource resource = WDWebResource.getWebResource(test,WDWebResourceType.DOC);
    From where are you getting this actual byte array? from R/3?. In internet if you search about this error we are getting the results like "The PDF file has a .mme extension rather than a .pdf extension".
    Note: This is not the problem with Window or LinkToURL ui elments.
    Posting this to give you an idea.
    Regards,
    Charan

  • Displaying Blob data (MS Word Doc) in Reports

    Anyone have suggestions/idea on how to display an MSWord Doc stored within a blob column (not a bfile pointer) within Reports? All I see is the binary data but would like to see the Word Doc itself.
    Thanks.

    Mahi,
    you can't do that yet.

  • Missing data when exporting to "MS Word (*.doc)" and "RTF (*.rtf)"

    Hello,
    We are using CR XI R2 SP3 in our product.  The reports that we generate (using ODBC dsn) show URLs from the database as hyper link text fields.  When we export the report to "Microsoft Word (.doc)" or "Rich Text Format (.rtf)" format, even though the export operation succeeds, the report is missing data when it encounters a URL that looks like following.  There is basically no data after that URL.
    http://www.xyz.com/kType=t;s.linkName=n;s.t()};s.ssl=(s.wd.location.protocol.toLowerCa
    And when it encounters a URL like following, MS Word complains that the file is invalid even though the export succeeds.
    https://www.xyz.com/m));if(m%3E0&m!=e)if(parseInt(c.substring(m+1,e%3C0?c.length:e))%3Cd.get
    If we export the report to pdf format, then everything works just fine.
    Any help on this will be highly appreciated.

    Hi Sumit
    Try to set the URL field with the RTF format. To do this try following:
    1. Right click the field->Format Field.
    2. Click the paragraph tab->Text Interpretation->RTF Text
    Now try to export it.
    Hope this helps.
    Regards
    Nikhil

  • Early Watch not Producing Word.doc, or HTML Reports

    Hello all,
    I've managed to maintain the SDCCN, and the jobs associated with producing an Early Watch.
    However, the process isn't producing any attachments, including a word doc, or an HTML report.
    Oddly, in the operations screen from the CEN, I'm not able to view the report session at all, despite the Early Watch report being in the monitored system as a tree structure.
    When trying to view the session through the operations screen in solution overview, the system throws that it cannot be viewed:
    Cannot open session
        Message no. DSWP033
    Even odder is that the icon (the two bottles) suggests "Data has been transferred".
    Any suggestions would be most helpful.
    Message was edited by:
            Kenneth P

    In case any searches on this and needs a solution...
    Believe it or not, the error was b/c of the >decimal< settings in my user ID.  How very odd.
    However, if you continue to get odd messages, please make sure that your user is set to display with decimals between powers of 10, and commas between powers of 1/10th.
    ie 100.100.100,000

  • Attachments (word docs and PDFs) to emails can not be opened by the receivers. Are received as .dat files or application/octet-stream

    Attachments I add to emails (word doc or PDFs) can not be opened by the email receivers. Word documents attachments are received with ATT00427.dat (application/octet-stream) or .doc with (application/octet-stream). PDF attached files arrive with .pdf (application/octet-stream). My copy of my sent email has the same attachment extensions.
    == This happened ==
    Every time Firefox opened

    Firefox doesn't do email, it's a web browser.
    If you are using Firefox to access web mail, you need to seek support from your service provider or a forum for that service.
    If your problem is with Thunderbird, see this forum for support.
    [http://www.mozillamessaging.com/en-US/support/]
    or this one
    [http://forums.mozillazine.org/viewforum.php?f=39]

  • Report Generation Toolkit - Prints data from a previous report in Word

    I am running an executable from the "system exec.vi" created with Labview 6.1. I am using the Report Generation toolkit vi's to create a report in Word that prints simple Title with test header and then appends a Table with measurement data. The problem is the measurement data in the table is from a previously printed report. This problem only exists when I Run the Report.exe from the "System Exec.vi". If I manually start the Report.exe in Windows or open in the Windows Commandline the correct data measurement data is printed in the report table. Any suggestions are appreciated. Thank You

    Hi,
    So far I havent been able to reproduce this on my computer. Could you post your code so that I can try and reproduce this issue?
    Feroz P
    National Instruments

  • Error to open a data model in Report builder (Word)

    Dear all,
    Im troubles when i try to open a data model in Report Builder (Word). Someone know about this problem?
    The message is: A error has ocurred. Check the settings and try again.
    Any suggestion?
    Thanks for all!

    I've also got this error several times. Usually the reason is an error in the Publisher query (or data template). It's better to first test (view) that you get a proper xml-output in Publisher, and only after that try to create an rtf-template. If this doesn't work, I usually start from the beginning, and first make a very simple report, then try the template, and if it works, then gradually increase elements for the Publisher side. Sometimes I haven't got any idea why it didn't work at the first place, when it then works after beginning from the simple report.

  • Report with cf formula WORD doc --to wip

    my report (reports 6i) has a CF formula --- OLE2--- some file.doc (Word) (one page :))
    in reports 6i it works just fine...
    but in oracle apps i can only see the header and not the word doc.... (i'm runnig the report in wip as a conc request....with pdf output...)
    i tried to convert the doc to pdf (because i have pdf as output for my report...) but i still have the same problem....
    the word doc is a paramater :p_link : d:\scan\pag1.doc
    what should i do to see this in application....what output should have the report in apps????
    ???

    there are NO OLE2 on IAS

  • Export PDF converts filled PDF form without the data - Turns filled PDF form onto blank Word doc. Is there a solution to this or did Adobe just sell me a service that doesn't work?

    Export PDF converts filled PDF form without the data - Turns filled PDF form onto blank Word doc. Is there a solution to this or did Adobe just sell me a service that doesn't work?

    ExportPDF is not for forms. In general, converting forms to Word is a really, really bad idea which can even cause legal problems. Work with the form as a PDF. Acrobat (not Reader) can export form data as simple text for example.

  • Moving Dynamic data from asp page to word doc

    I am trying to acquire data from a user using an asp page,
    then when the user is done entering his/her data, the submit button
    is pressed and the data will go to a formatted word doc or a pdf
    file. I am using dreamweaver version 8.0. Is there a quick way to
    do this? Does dreamweaver need an addin to be able to this or is
    there code that can be used to do this?

    It is not DW that needs the addon but the server that the
    site is running
    on. There are quite a number of components for writing
    documents or PDF's. I
    would check with you host if they have any available.
    Paul Whitham
    Certified Dreamweaver MX2004 Professional
    Adobe Community Expert - Dreamweaver
    Valleybiz Internet Design
    www.valleybiz.net
    "mmflynn" <[email protected]> wrote in
    message
    news:et75ps$8gr$[email protected]..
    >I am trying to acquire data from a user using an asp
    page, then when the
    >user
    > is done entering his/her data, the submit button is
    pressed and the data
    > will
    > go to a formatted word doc or a pdf file. I am using
    dreamweaver version
    > 8.0.
    > Is there a quick way to do this? Does dreamweaver need
    an addin to be
    > able to
    > this or is there code that can be used to do this?
    >

  • Displaying Word Doc in PDF report

    Hi,,,
    Our web application( using OC4J ) use oracle reports for printing and generate pdf . The problem we're having now is we have to use formating such us indent, bullets, tabs etc.
    We tried saving it in html format but could not find a away to read it and format it to pdf.
    Other solutin we tried is to store word doc in blob and try to read it but not successfull also ..
    Any thought on this ? Please help ..
    Desperado ....

    Hi,
    to use formating such us indent, bullets, tabs etc.Can't you use Acrobat writer to do this? I mean, generate PDF files from Reports, open them in Acrobat writer, and edit.
    Else, did you try output to RTF, then open it in MS Word, format it and convert to PDF (need Acrobat writer again).
    Navneet.

  • Export section content to report or ms word doc?

    All,
    Hopefully a quick and simple yes/no question. Is there a way to export just the contents of a set of sections to a word doc or some type of report?
    We created a large set of sections that are unique customer contract languages. The CAT/UAT team wants to be able to validate the content w/o having to create all the test scenarios to generate them in the system.
    thanks!

    There are a couple of command line utilities that you might want to consider: FAP2PDF and FAP2RTF
    These utilities support using wildcards to convert a set of FAP files into PDF or RTF files.
    You can find information about these tools in the Utilities Reference or just run the programs with no parameters in a DOS box.

Maybe you are looking for