OLE Word Documentation
Dear all,
Where can i found a documentation about OLE using microsoft word ???
Thanks.
hi check this ..
OLE
http://www.sapgenie.com/abap/ole.htm
http://help.sap.com/saphelp_46c/helpdata/en/59/ae3f2e488f11d189490000e829fbbd/frameset.htm
this is for word
REPORT YTEST .
*--Include for OLE-enabling definitions
INCLUDE OLE2INCL .
*--Global variables
*--Variables to hold OLE object and entity handles
DATA GS_WORD TYPE OLE2_OBJECT . "OLE object handle
DATA GS_DOCUMENTS TYPE OLE2_OBJECT . "Documents
DATA GS_ACTDOC TYPE OLE2_OBJECT . "Active document
DATA GS_APPLICATION TYPE OLE2_OBJECT . "Application
DATA GS_OPTIONS TYPE OLE2_OBJECT . "Application options
DATA GS_ACTWIN TYPE OLE2_OBJECT . "Active window
DATA GS_ACTPAN TYPE OLE2_OBJECT . "Active pane
DATA GS_VIEW TYPE OLE2_OBJECT . "View
DATA GS_SELECTION TYPE OLE2_OBJECT . "Selection
DATA GS_FONT TYPE OLE2_OBJECT . "Font
DATA GS_PARFORMAT TYPE OLE2_OBJECT . "Paragraph format
DATA GS_TABLES TYPE OLE2_OBJECT . "Tables
DATA GS_RANGE TYPE OLE2_OBJECT . "Range handle for various ranges
DATA GS_TABLE TYPE OLE2_OBJECT . "One table
DATA GS_TABLE_BORDER TYPE OLE2_OBJECT . "Table border
DATA GS_CELL TYPE OLE2_OBJECT . "One cell of a table
DATA GS_PARAGRAPH TYPE OLE2_OBJECT . "Paragraph
DATA GV_POS(5) TYPE N . "Position information for table
CREATE OBJECT GS_WORD 'WORD.APPLICATION' .
IF SY-SUBRC NE 0.
MESSAGE S000(SU) WITH 'Error while creating OLE object!'.
LEAVE PROGRAM .
ENDIF .
*--Setting object's visibility property
SET PROPERTY OF GS_WORD 'Visible' = '1' .
*--Opening a new document
GET PROPERTY OF GS_WORD 'Documents' = GS_DOCUMENTS .
CALL METHOD OF GS_DOCUMENTS 'Add' .
*--Getting active document handle
GET PROPERTY OF GS_WORD 'ActiveDocument' = GS_ACTDOC .
*--Getting applications handle
GET PROPERTY OF GS_ACTDOC 'Application' = GS_APPLICATION .
*--Setting the measurement unit
GET PROPERTY OF GS_APPLICATION 'Options' = GS_OPTIONS .
SET PROPERTY OF GS_OPTIONS 'MeasurementUnit' = '1' . "CM
*--Getting handle for the selection which is here the character at the
*--cursor position
GET PROPERTY OF GS_APPLICATION 'Selection' = GS_SELECTION .
GET PROPERTY OF GS_SELECTION 'Font' = GS_FONT .
GET PROPERTY OF GS_SELECTION 'ParagraphFormat' = GS_PARFORMAT .
*--Setting font attributes
SET PROPERTY OF GS_FONT 'Name' = 'Arial' .
SET PROPERTY OF GS_FONT 'Size' = '10' .
SET PROPERTY OF GS_FONT 'Bold' = '1' . "Not bold
SET PROPERTY OF GS_FONT 'Italic' = '1' . "Italic
SET PROPERTY OF GS_FONT 'Underline' = '0' . "Not underlined
*--Setting paragraph format attribute
SET PROPERTY OF GS_PARFORMAT 'Alignment' = '2' . "Right-justified
CALL METHOD OF GS_SELECTION 'TypeText'
EXPORTING
#1 = 'This is an OLE example!'.
*--Setting the view to the main document again
SET PROPERTY OF GS_VIEW 'SeekView' = '0' . "Main document view
*--Reseting font attributes for the title
SET PROPERTY OF GS_FONT 'Name' = 'Times New Roman' .
SET PROPERTY OF GS_FONT 'Size' = '16' .
SET PROPERTY OF GS_FONT 'Bold' = '1' . "Bold
SET PROPERTY OF GS_FONT 'Italic' = '0' . "Not Italic
SET PROPERTY OF GS_FONT 'Underline' = '0' . "Not underlined
*--Setting paragraph format attribute
SET PROPERTY OF GS_PARFORMAT 'Alignment' = '1' . "Centered
CALL METHOD OF GS_SELECTION 'TypeText'
EXPORTING
#1 = TEXT-000.
*--Advancing cursor to the new line
CALL METHOD OF GS_SELECTION 'TypeParagraph' .
*--Getting entity handles for the entities on the way
GET PROPERTY OF GS_ACTDOC 'Tables' = GS_TABLES .
GET PROPERTY OF GS_SELECTION 'Range' = GS_RANGE .
*--Adding a table with 3 rows and 2 columns
CALL METHOD OF GS_TABLES 'Add' = GS_TABLE
EXPORTING
#1 = GS_RANGE " Handle for range entity
#2 = '3' "Number of rows
#3 = '2'. "Number of columns
*--Setting border attribute for the table
GET PROPERTY OF GS_TABLE 'Borders' = GS_TABLE_BORDER .
SET PROPERTY OF GS_TABLE_BORDER 'Enable' = '1' . "With border
*--Filling the table with dummy data
*--Reseting font attributes for table content
SET PROPERTY OF GS_FONT 'Name' = 'Garamond' .
SET PROPERTY OF GS_FONT 'Size' = '11' .
SET PROPERTY OF GS_FONT 'Bold' = '0' . "Not bold
SET PROPERTY OF GS_FONT 'Italic' = '0' . "Not Italic
SET PROPERTY OF GS_FONT 'Underline' = '0' . "Not underlined
*--Getting cell coordinates
CALL METHOD OF GS_TABLE 'Cell'
EXPORTING
#1 = '1' "first row
#2 = '1'. "first column
*--Getting the range handle to write the text
GET PROPERTY OF GS_CELL 'Range' = GS_RANGE .
*--Filling the cell
SET PROPERTY OF GS_RANGE 'Text' = 'Venkatesh Appikonda' .
*--Getting cell coordinates
CALL METHOD OF GS_TABLE 'Cell' = GS_CELL
EXPORTING
#1 = '3' "third row
#2 = '2'. "second column
*--Getting the range handle to write the text
GET PROPERTY OF GS_CELL 'Range' = GS_RANGE .
*--Filling the cell
SET PROPERTY OF GS_RANGE 'Text' = 'this is ole example' .
*--Advancing the cursor to the end of the table
GET PROPERTY OF GS_TABLE 'Range' = GS_RANGE .
GET PROPERTY OF GS_RANGE 'End' = GV_POS .
SET PROPERTY OF GS_RANGE 'Start' = GV_POS .
CALL METHOD OF GS_RANGE 'Select' .
*--Skip some lines
DO 10 TIMES .
CALL METHOD OF GS_SELECTION 'TypeParagraph' .
ENDDO.
*--Reseting font attributes for ordinary text
SET PROPERTY OF GS_FONT 'Name' = 'Times New Roman' .
SET PROPERTY OF GS_FONT 'Size' = '12' .
SET PROPERTY OF GS_FONT 'Bold' = '0' . "Not bold
SET PROPERTY OF GS_FONT 'Italic' = '0' . "Not Italic
SET PROPERTY OF GS_FONT 'Underline' = '0' . "Not underlined
*--Setting paragraph format attribute
SET PROPERTY OF GS_PARFORMAT 'Alignment' = '3' . "Justified
*--Indent the paragraph once
GET PROPERTY OF GS_SELECTION 'Paragraphs' = GS_PARAGRAPH .
CALL METHOD OF GS_PARAGRAPH 'Indent' .
CALL METHOD OF GS_SELECTION 'TypeText'
EXPORTING
#1 = TEXT-002.
FREE OBJECT GS_WORD .
this is for excel..
Report ZMULTICOLOR_TEST no standard page heading.
this report demonstrates how to send some ABAP data to an
EXCEL sheet using OLE automation.
include ole2incl.
handles for OLE objects
data: h_excel type ole2_object, " Excel object
h_mapl type ole2_object, " list of workbooks
h_map type ole2_object, " workbook
h_zl type ole2_object, " cell
h_f type ole2_object, " font
h_c type ole2_object. " color
DATA: FILENAME LIKE RLGRAP-FILENAME.
tables: spfli.
data h type i.
table of flights
data: it_spfli like spfli occurs 10 with header line.
*& Event START-OF-SELECTION
start-of-selection.
read flights
select * from spfli into table it_spfli.
display header
uline (61).
write: / sy-vline no-gap,
(3) 'Flg'(001) color col_heading no-gap, sy-vline no-gap,
(4) 'Nr'(002) color col_heading no-gap, sy-vline no-gap,
(20) 'Von'(003) color col_heading no-gap, sy-vline no-gap,
(20) 'Nach'(004) color col_heading no-gap, sy-vline no-gap,
(8) 'Zeit'(005) color col_heading no-gap, sy-vline no-gap.
uline /(61).
display flights
loop at it_spfli.
write: / sy-vline no-gap,
it_spfli-carrid color col_key no-gap, sy-vline no-gap,
it_spfli-connid color col_normal no-gap, sy-vline no-gap,
it_spfli-cityfrom color col_normal no-gap, sy-vline no-gap,
it_spfli-cityto color col_normal no-gap, sy-vline no-gap,
it_spfli-deptime color col_normal no-gap, sy-vline no-gap.
endloop.
uline /(61).
tell user what is going on
call function 'SAPGUI_PROGRESS_INDICATOR'
exporting
PERCENTAGE = 0
text = text-007
exceptions
others = 1.
start Excel
create object h_excel 'EXCEL.APPLICATION'.
PERFORM ERR_HDL.
set property of h_excel 'Visible' = 1.
CALL METHOD OF H_EXCEL 'FILESAVEAS' EXPORTING #1 = 'c:\kis_excel.xls' .
PERFORM ERR_HDL.
tell user what is going on
call function 'SAPGUI_PROGRESS_INDICATOR'
exporting
PERCENTAGE = 0
text = text-008
exceptions
others = 1.
get list of workbooks, initially empty
call method of h_excel 'Workbooks' = h_mapl.
perform err_hdl.
add a new workbook
call method of h_mapl 'Add' = h_map.
perform err_hdl.
tell user what is going on
call function 'SAPGUI_PROGRESS_INDICATOR'
exporting
PERCENTAGE = 0
text = text-009
exceptions
others = 1.
output column headings to active Excel sheet
perform fill_cell using 1 1 1 200 'Carrier id'(001).
perform fill_cell using 1 2 1 200 'Connection id'(002).
perform fill_cell using 1 3 1 200 'City from'(003).
perform fill_cell using 1 4 1 200 'City to'(004).
perform fill_cell using 1 5 1 200 'Dep. Time'(005).
loop at it_spfli.
copy flights to active EXCEL sheet
h = sy-tabix + 1.
if it_spfli-carrid cs 'AA'.
perform fill_cell using h 1 0 000255000 it_spfli-carrid.
elseif it_spfli-carrid cs 'AZ'.
perform fill_cell using h 1 0 168000000 it_spfli-carrid.
elseif it_spfli-carrid cs 'JL'.
perform fill_cell using h 1 0 168168000 it_spfli-carrid.
elseif it_spfli-carrid cs 'LH'.
perform fill_cell using h 1 0 111111111 it_spfli-carrid.
elseif it_spfli-carrid cs 'SQ'.
perform fill_cell using h 1 0 100100100 it_spfli-carrid.
else.
perform fill_cell using h 1 0 000145000 it_spfli-carrid.
endif.
if it_spfli-connid lt 400.
perform fill_cell using h 2 0 255000255 it_spfli-connid.
elseif it_spfli-connid lt 800.
perform fill_cell using h 2 0 077099088 it_spfli-connid.
else.
perform fill_cell using h 2 0 246156138 it_spfli-connid.
endif.
if it_spfli-cityfrom cp 'S*'.
perform fill_cell using h 3 0 155155155 it_spfli-cityfrom.
elseif it_spfli-cityfrom cp 'N*'.
perform fill_cell using h 3 0 189111222 it_spfli-cityfrom.
else.
perform fill_cell using h 3 0 111230222 it_spfli-cityfrom.
endif.
if it_spfli-cityto cp 'S*'.
perform fill_cell using h 4 0 200200200 it_spfli-cityto.
elseif it_spfli-cityto cp 'N*'.
perform fill_cell using h 4 0 000111222 it_spfli-cityto.
else.
perform fill_cell using h 4 0 130230230 it_spfli-cityto.
endif.
if it_spfli-deptime lt '020000'.
perform fill_cell using h 5 0 145145145 it_spfli-deptime.
elseif it_spfli-deptime lt '120000' .
perform fill_cell using h 5 0 015215205 it_spfli-deptime.
elseif it_spfli-deptime lt '180000' .
perform fill_cell using h 5 0 000215205 it_spfli-deptime.
else.
perform fill_cell using h 5 0 115115105 it_spfli-deptime.
endif.
endloop.
EXCEL FILENAME
CONCATENATE SY-REPID '_' SY-DATUM6(2) '_' SY-DATUM4(2) '_'
SY-DATUM(4) '_' SY-UZEIT '.XLS' INTO FILENAME.
CALL METHOD OF H_MAP 'SAVEAS' EXPORTING #1 = FILENAME.
free object h_excel.
perform err_hdl.
FORM FILL_CELL *
sets cell at coordinates i,j to value val boldtype bold *
form fill_cell using i j bold col val.
call method of h_excel 'Cells' = h_zl
exporting
#1 = i
#2 = j.
perform err_hdl.
set property of h_zl 'Value' = val .
perform err_hdl.
get property of h_zl 'Font' = h_f.
perform err_hdl.
set property of h_f 'Bold' = bold .
perform err_hdl.
set property of h_f 'Color' = col.
perform err_hdl.
endform. "FILL_CELL
*& Form ERR_HDL
outputs OLE error if any *
--> p1 text
<-- p2 text
form err_hdl.
if sy-subrc <> 0.
write: / 'OLE-Automation Error:'(010), sy-subrc.
stop.
endif.
endform. " ERR_HDL
regards,
venkat
Similar Messages
-
Hi,
i use OLE-Word to create a table in a word document and fill them.
That's work OK, but i will position the table on a specific Positon on the page.
Position shell be horizontal 7 and vertical 8.
I have tried it with recording in word, bot i don't know the statements in ABAP.
Has anyone an idea to solve it or an example?
thanks.
Regards, Dieter.
Edited by: Dieter Gröhn on Jun 16, 2008 10:34 AMHere my code:
REPORT ZGRO_MS_WORD_OLE_FORMLETTER_T0.
*--Include for OLE-enabling definitions
INCLUDE OLE2INCL .
*--Global variables
*--Variables to hold OLE object and entity handles
DATA GS_WORD TYPE OLE2_OBJECT . "OLE object handle
DATA GS_DOCUMENT TYPE OLE2_OBJECT . "Documents
DATA GS_ACTIV_DOC TYPE OLE2_OBJECT . "Active document
DATA GS_APPLICATION TYPE OLE2_OBJECT . "Application
DATA GS_OPTIONS TYPE OLE2_OBJECT . "Application options
DATA GS_ACTWIN TYPE OLE2_OBJECT . "Active window
DATA GS_ACTPAN TYPE OLE2_OBJECT . "Active pane
DATA GS_VIEW TYPE OLE2_OBJECT . "View
DATA GS_SELECTION TYPE OLE2_OBJECT . "Selection
DATA GS_FONT TYPE OLE2_OBJECT . "Font
DATA GS_PARFORMAT TYPE OLE2_OBJECT . "Paragraph format
DATA GS_TABLES TYPE OLE2_OBJECT . "Tables
DATA GS_RANGE TYPE OLE2_OBJECT . "Range handle for various ranges
DATA GS_TABLE TYPE OLE2_OBJECT . "One table
DATA GS_BORDER TYPE OLE2_OBJECT . "Table border
DATA GS_CELL TYPE OLE2_OBJECT . "One cell of a table
DATA GS_PARAGRAPH TYPE OLE2_OBJECT . "Paragraph
START-OF-SELECTION .
PERFORM WORD_APPLIKATION.
PERFORM TABELLE_ERSTELLEN.
PERFORM TABELLE_ZELLE.
FREE OBJECT GS_WORD .
FORM WORD_APPLIKATION.
*--Creating OLE object handle variable
CREATE OBJECT GS_WORD 'WORD.APPLICATION' .
IF SY-SUBRC NE 0 .
MESSAGE S000(SU) WITH 'Error while creating OLE object!'.
LEAVE PROGRAM .
ENDIF .
*--Setting object's visibility property
SET PROPERTY OF GS_WORD 'Visible' = '1' .
*--Opening a new document
GET PROPERTY OF GS_WORD 'Documents' = GS_DOCUMENT.
CALL METHOD OF GS_DOCUMENT 'Add' .
*--Getting active document handle
GET PROPERTY OF GS_WORD 'ActiveDocument' = GS_ACTIV_DOC .
*--Getting applications handle
GET PROPERTY OF GS_ACTIV_DOC 'Application' = GS_APPLICATION .
*--Setting the measurement unit
GET PROPERTY OF GS_APPLICATION 'Options' = GS_OPTIONS .
SET PROPERTY OF GS_OPTIONS 'MeasurementUnit' = '1' . "CM
*--Getting handle for the selection which is here the character at the
*--cursor position
GET PROPERTY OF GS_APPLICATION 'Selection' = GS_SELECTION .
GET PROPERTY OF GS_SELECTION 'Font' = GS_FONT .
GET PROPERTY OF GS_SELECTION 'ParagraphFormat' = GS_PARFORMAT .
ENDFORM. "word_applikation
FORM TABELLE_ERSTELLEN.
*--Getting entity handles for the entities on the way
GET PROPERTY OF GS_ACTIV_DOC 'Tables' = GS_TABLES .
GET PROPERTY OF GS_SELECTION 'Range' = GS_RANGE .
*--Adding a table
CALL METHOD OF GS_TABLES 'Add' = GS_TABLE
EXPORTING #1 = GS_RANGE
#2 = '1' "Number of rows
#3 = '1'. "Number of columns
*--Setting border attribute
GET PROPERTY OF GS_TABLE 'Borders' = GS_BORDER .
SET PROPERTY OF GS_BORDER 'Enable' = '0' . "0 o. 1
DATA GS_ROWS TYPE OLE2_OBJECT.
GET PROPERTY OF GS_TABLE 'Rows' = GS_ROWS.
SET PROPERTY OF GS_ROWS 'WrapAroundText' = '1'.
SET PROPERTY OF GS_ROWS 'HorizontalPosition' = '3'.
SET PROPERTY OF GS_ROWS 'RelativeHorizontalPosition' = '1'.
SET PROPERTY OF GS_ROWS 'VerticalPosition' = '8'.
SET PROPERTY OF GS_ROWS 'RelativeVerticalPosition' = '1'.
set property of GS_ROWS 'AllowOverlap' = '0'.
ENDFORM. "Tabelle_erstellen
FORM TABELLE_ZELLE.
*--Getting cell coordinates
CALL METHOD OF GS_TABLE 'Cell' = GS_CELL
EXPORTING #1 = '1'
#2 = '1'.
*--Getting the range handle to write the text
GET PROPERTY OF GS_CELL 'Range' = GS_RANGE .
*--Filling the cell
SET PROPERTY OF GS_RANGE 'Text' = 'Test' .
ENDFORM. "TABELLE_Zelle
in Word i record and get this:
Sub Makro1()
' Makro1 Makro
' Makro aufgezeichnet am 16.06.2008
ActiveDocument.Tables.Add Range:=Selection.Range, NumRows:=1, NumColumns:= _
1, DefaultTableBehavior:=wdWord9TableBehavior, AutoFitBehavior:= _
wdAutoFitFixed
With Selection.Tables(1)
If .Style <> "Tabellengitternetz" Then
.Style = "Tabellengitternetz"
End If
.ApplyStyleHeadingRows = True
.ApplyStyleLastRow = True
.ApplyStyleFirstColumn = True
.ApplyStyleLastColumn = True
End With
With Selection.Tables(1).Rows
.WrapAroundText = True
.HorizontalPosition = CentimetersToPoints(2)
.RelativeHorizontalPosition = wdRelativeHorizontalPositionPage
.DistanceLeft = CentimetersToPoints(0.25)
.DistanceRight = CentimetersToPoints(0.25)
.VerticalPosition = CentimetersToPoints(8)
.RelativeVerticalPosition = wdRelativeVerticalPositionPage
.DistanceTop = CentimetersToPoints(0)
.DistanceBottom = CentimetersToPoints(0)
.AllowOverlap = False
End With
End Sub
i will translate it in abap. how can i do it.
i tried something in FORM TABELLE_ERSTELLEN but i can see the table, but i don't get the right position.
Any idea?
thanks.
Regards, Dieter -
Is it possible to download abap key word documentation
hi experts,
i want to download all the abap key word documentation.
i know that if we press f1 on keyword we will get that particuler key word help, but i want all the words document download or copy once.I dont think there is a way to download it in that form.
You can however get the PDF version from here -
http://help.sap.com/printdocu/core/Print46c/en/Data/htm/english.htm
SAP Library -> Basis Components -> Abap programmng & Runtime Env -> ABAP Programming.
You can save this PDF on your PC .
Cheers. -
ABAP OLE Word - Delete last page
Dear all,
I have a SAP program which prints some documents in Microsoft Word by using ABAP OLE Objects.
I use a template to take the main context, and after that I send some variables in order to populate the word document.
The problem is when I create the new word document, I paste the template text in a new document, but at the end I have always an empty page. I don't know how to delete this final page, I don't find the corresponding OLE method to do it.
I have found a method to cut a line, but the problem is that line is also empty, and I cannot cut it.
Could anyone help me?
Many thanks in advance and best regards.Hi,
post some code lines. Format as code, use preview.
Regards,
Clemens -
How to set imgae/photo size in a OLE word
Hi,
I am developing a OLE object to extract data from SAP system into a MS Office word documnet.
I am downloading image from application server to presentation server and displaying it on word documnet using
create object g_wordobj 'Word.Basic' .
call method of g_wordobj 'InsertPicture'
exporting #1 = l_picture_file " file path
#2 = '1' . " link to file *
User requirement is to restrict the image size to height 130 pixel and width 100 pixel.
How can i resize the imgae?Hi,
Yes it is possible to resize a picture in OLE:
data : lo_picture type ole2_object.
data : lw_height type i .
data : lw_width type i .
Build image
call method of g_wordobj 'InsertPicture' = lo_picture
exporting #1 = l_picture_file
#2 = '1' . " link to file *
Get property of picture
clear : lw_height, lw_width.
get property of lo_picture 'Height' = lw_height.
get property of lo_picture 'Width' = lw_width.
call function 'FLUSH'.
*change the height and width values and after
Change the property
set property of lo_picture 'LockAspectRatio' = -1.
set property of lo_picture 'Height' = lw_height.
set property of lo_picture 'Width' = lw_width.
call function 'FLUSH'. -
Poor image quality when displaying OLE Word doc stored in BLOB
Hello,
I am migrating some CR Reports from VB6 to VB.NET 2008.
The reports retrieves Word documents that is stored in BLOB column on SQL Server 2005.
If CR.NET (same behaviour with 2005 and 2008 versions) renders the word document, the quality is really bad. Looks like an ugly moire effect. The characters below 8pt font size are hardly readable. I have already set the option "use full color-depth" in the report options.
If the same word doc is rendered with CR that's included in VB6, it shows a clear and sharp output - the same as displayed in word.
Where is the difference in handling Word OLE between those two CR versions?
Is there anything I can do to improve the quality with CR.NET?
Regards,
StefanHello, Stefan;
Is this a Windows or Web application?
Visual Basic 6.0 shipped with Crystal Reports 4.6 Visual Studio .NET 2005 ships with Crystal Reports 10.2 and VS .NET 2008 with version 10.5.
The Crystal Reports application was rewritten in versions 5.0 and 9.0 and a great many changes were made - among them different options for including OLE Objects. See the [Note 1218374|https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/oss_notes_boj/sdn_oss_boj_erq/sap(bD1lbiZjPTAwMQ==)/bc/bsp/spn/scn_bosap/notes.do] for useful new functionality. I tested a report with a linked Word document and it viewed well through Visual Studio .NET 2008.
Is it possible support for the the Word format as a BLOB field in MS SQL Server has changed over time. What method is used to create the document as a BLOB field?
Are you using the bundled version included with Visual Studio .NET? In the article recommending the property 'Retain Original Image Color Depth', there is a note:
Note: This option only functions with the full version of Crystal Reports 9 or 10. This option does not function with the .NET Report Designer.
Originally the issue was fixed but only in a full versions of Crystal Reports Developer, not in the versions bundled with Visual Studio .NET.
I tested with a linked Word document and see some degradation when there is an image in the Word Document but not in the text itself.
Elaine -
Poor image quality when displaying OLE Word object in PDF
MS Word 2007 OLE object in Crystal Reports XII R2 designer...looks OK in designer. When we export to PDF, the image quality has been degraded significantly. Anybody had this issue before? tried replacing usp10.dll with one found in CommonFiles folder, that did not help.
Hi Mark,
See if this [kbase |http://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/oss_notes_boj/sdn_oss_boj_bi/sap(bD1lbiZjPTAwMQ==)/bc/bsp/spn/scn_bosap/notes%7B6163636573733d36393736354636443646363436353344333933393338323636393736354637333631373036453646373436353733354636453735364436323635373233443330333033303331333233313333333633383336%7D.do] - SAP Note 1213686 - Certain objects do not appear clearly when exporting to PDF/RTF/Word formats - article resolves the issue. It's for CR 9 so you'll have to browse to the CR XI registry structure.
Otherwise try all of the patches for CR XI R2:
Keep your Keycode and then uninstall XI R2, unless you are on SP 4 then just apply SP 5 and 6:
https://smpdl.sap-ag.de/~sapidp/012002523100011802732008E/crxir2_sp4_full_build.exe
https://smpdl.sap-ag.de/~sapidp/012002523100013876392008E/crxir2win_sp5.exe
https://smpdl.sap-ag.de/~sapidp/012002523100015859952009E/crxir2win_sp6.exe
Thank you
Don -
Ole Word Automation, Remove Table Borders
Hi All,
I have created a new word document with a table of 3 rows and 3 columns using the ole. I want to remove vertical lines. The borders property enable only shows or disables the borders. I want to remove any border I want.
I recorded a macro at Word. But I couldn't managed to adopt in ABAP. I will be glad if you can help. Thanks.
Word Macro :
Selection.Borders(wdBorderRight).LineStyle = wdLineStyleNone
ABAP code :
GET PROPERTY OF gs_actdoc 'Tables' = gs_tables .
GET PROPERTY OF gs_selection 'Range' = gs_range .
CALL METHOD OF gs_tables 'Add' = gs_table
EXPORTING
#1 = gs_range
#2 = '3'
#3 = '3'.
GET PROPERTY OF gs_table 'Borders' = gs_table_border .
SET PROPERTY OF gs_table_border 'Enable' = '1' . "With borderHi,
I've found a solution.
After creating table and enabling borders, you can select cells and delete borders.
GET PROPERTY OF gs_actdoc 'Tables' = gs_tables .
GET PROPERTY OF gs_selection 'Range' = gs_range .
**--Adding a table with 3 rows and 3 columns
CALL METHOD OF gs_tables 'Add' = gs_table
EXPORTING
#1 = gs_range " Handle for range entity
#2 = '3' "Number of rows
#3 = '3'. "Number of columns
**--Setting border attribute for the table
GET PROPERTY OF gs_table 'Borders' = gs_table_border .
SET PROPERTY OF gs_table_border 'Enable' = '1' . "With border
CALL METHOD OF gs_table 'Cell' = gs_cell1
EXPORTING
#1 = '1' "first row
#2 = '1'. "first column
CALL METHOD OF gs_cell1 'BORDERS' = borders
EXPORTING
#1 = '2'. "1 top, 2 left, 3 bottom, 4 right (border)
SET PROPERTY OF borders 'LineStyle' = '0'. -
ABAP key word documentation not appearing
Hi every one
when i press F1 on a keyword in ABAP editor it displaying ABAP keyword documentation with blank page.
i am using vista OS and SAPGUI 6.0 and Internet explorer 7.0
Please suggest me what to do to get the Key word help.
Most useful answer will be awarded
Thank you
KiranCheck transaction ABAPDOCU. This shouldn't be dependent on which version of SAPGUI you have (assuming your sap rel is 4.6 or greater).
Also look in table tstct for transaction abapdocu.
If it doesn't exist then you need to re-install it. Should be part of standard SAP however.
VISTA is irelevant in this regard - however you might need to access the SAP help files via a browser and a manual link as the automatic link doesn't work properly under VISTA unless SAPGUI 7.0 is installed -- as the previous poster has said.
For the SAP library you can always use a manual link to the sap help data files but of course it won't work via F1.
Cheers
jimbo -
ABAP OLE Word for reading a file
Hi,
I am looking for the method or property to get the word document content to send it to the clipboard.
All I found an OLE is for writing but not for reading and I need it to read a file.
Someone got an idea?
Thanks a lot.
DavidHi David, the ad on top sucks.
it's already almost 10 years old but SAP did not develop anything new un this area (as far as I know),
[Desktop Office Integration (BC-CI) H|http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCCIOFFI/BCCIOFFI.pdf]
copy_selection
You use this method to copy marked text from the office document to the clipboard:
CALL METHOD document->copy_selection
EXPORTING no_flush = no_flush
IMPORTING error = error
retcode = retcode.
paste_clipboard
You use this method to insert the contents of the clipboard at the current cursor position. The
clipboard contents are inserted as fixed text; there is no link to the object:
CALL METHOD document->paste_clipboard
EXPORTING no_flush = no_flush
IMPORTING error = error
retcode = retcode.
select_all
You use this method to mark all text in the office document.
CALL METHOD document->select_all
EXPORTING no_flush = no_flush
IMPORTING error = error
retcode = retcode.
I hope you were looking for this.
Regards,
Clemens -
OLE Word , table not exists
hi, I use the following program to add table in word but in some system it's OK and in other system it's not.
Is there a configuration issue on it?
Best regards,
Blake Le
REPORT ZLEB_TEST_WORD.
*--Include for OLE-enabling definitions
INCLUDE OLE2INCL .
*--Global variables
*--Variables to hold OLE object and entity handles
DATA GS_WORD TYPE OLE2_OBJECT . "OLE object handle
DATA GS_DOCUMENTS TYPE OLE2_OBJECT . "Documents
DATA GS_ACTDOC TYPE OLE2_OBJECT . "Active document
DATA GS_APPLICATION TYPE OLE2_OBJECT . "Application
DATA GS_OPTIONS TYPE OLE2_OBJECT . "Application options
DATA GS_ACTWIN TYPE OLE2_OBJECT . "Active window
DATA GS_ACTPAN TYPE OLE2_OBJECT . "Active pane
DATA GS_VIEW TYPE OLE2_OBJECT . "View
DATA GS_SELECTION TYPE OLE2_OBJECT . "Selection
DATA GS_FONT TYPE OLE2_OBJECT . "Font
DATA GS_PARFORMAT TYPE OLE2_OBJECT . "Paragraph format
DATA GS_TABLES TYPE OLE2_OBJECT . "Tables
DATA GS_RANGE TYPE OLE2_OBJECT . "Range handle for various ranges
DATA GS_TABLE TYPE OLE2_OBJECT . "One table
DATA GS_TABLE_BORDER TYPE OLE2_OBJECT . "Table border
DATA GS_CELL TYPE OLE2_OBJECT . "One cell of a table
DATA GS_PARAGRAPH TYPE OLE2_OBJECT . "Paragraph
DATA GV_POS(5) TYPE N . "Position information for table
CREATE OBJECT GS_WORD 'WORD.APPLICATION' .
IF SY-SUBRC NE 0.
MESSAGE S000(SU) WITH 'Error while creating OLE object!'.
LEAVE PROGRAM .
ENDIF .
*--Setting object's visibility property
SET PROPERTY OF GS_WORD 'Visible' = '1' .
*--Opening a new document
GET PROPERTY OF GS_WORD 'Documents' = GS_DOCUMENTS .
CALL METHOD OF GS_DOCUMENTS 'Add' .
*--Getting active document handle
GET PROPERTY OF GS_WORD 'ActiveDocument' = GS_ACTDOC .
*--Getting applications handle
GET PROPERTY OF GS_ACTDOC 'Application' = GS_APPLICATION .
*--Setting the measurement unit
GET PROPERTY OF GS_APPLICATION 'Options' = GS_OPTIONS .
SET PROPERTY OF GS_OPTIONS 'MeasurementUnit' = '1' . "CM
*--Getting handle for the selection which is here the character at the
*--cursor position
GET PROPERTY OF GS_APPLICATION 'Selection' = GS_SELECTION .
GET PROPERTY OF GS_SELECTION 'Font' = GS_FONT .
GET PROPERTY OF GS_SELECTION 'ParagraphFormat' = GS_PARFORMAT .
*--Setting font attributes
SET PROPERTY OF GS_FONT 'Name' = 'Arial' .
SET PROPERTY OF GS_FONT 'Size' = '10' .
SET PROPERTY OF GS_FONT 'Bold' = '0' . "Not bold
SET PROPERTY OF GS_FONT 'Italic' = '1' . "Italic
SET PROPERTY OF GS_FONT 'Underline' = '0' . "Not underlined
*--Setting paragraph format attribute
SET PROPERTY OF GS_PARFORMAT 'Alignment' = '2' . "Right-justified
CALL METHOD OF GS_SELECTION 'TypeText'
EXPORTING
#1 = 'This is an OLE example!'.
*--Setting the view to the main document again
SET PROPERTY OF GS_VIEW 'SeekView' = '0' . "Main document view
*--Reseting font attributes for the title
SET PROPERTY OF GS_FONT 'Name' = 'Times New Roman' .
SET PROPERTY OF GS_FONT 'Size' = '16' .
SET PROPERTY OF GS_FONT 'Bold' = '1' . "Bold
SET PROPERTY OF GS_FONT 'Italic' = '0' . "Not Italic
SET PROPERTY OF GS_FONT 'Underline' = '0' . "Not underlined
*--Setting paragraph format attribute
SET PROPERTY OF GS_PARFORMAT 'Alignment' = '1' . "Centered
CALL METHOD OF GS_SELECTION 'TypeText'
EXPORTING
#1 = TEXT-000.
*--Advancing cursor to the new line
CALL METHOD OF GS_SELECTION 'TypeParagraph' .
*--Getting entity handles for the entities on the way
GET PROPERTY OF GS_ACTDOC 'Tables' = GS_TABLES .
GET PROPERTY OF GS_SELECTION 'Range' = GS_RANGE .
*--Adding a table with 3 rows and 2 columns
CALL METHOD OF GS_TABLES 'Add' = GS_TABLE
EXPORTING
#1 = GS_RANGE " Handle for range entity
#2 = '3' "Number of rows
#3 = '2'. "Number of columns
*--Setting border attribute for the table
GET PROPERTY OF GS_TABLE 'Borders' = GS_TABLE_BORDER .
SET PROPERTY OF GS_TABLE_BORDER 'Enable' = '1' . "With border
**--Filling the table with dummy data
**--Reseting font attributes for table content
*SET PROPERTY OF GS_FONT 'Name' = 'Garamond' .
*SET PROPERTY OF GS_FONT 'Size' = '11' .
*SET PROPERTY OF GS_FONT 'Bold' = '0' . "Not bold
*SET PROPERTY OF GS_FONT 'Italic' = '0' . "Not Italic
*SET PROPERTY OF GS_FONT 'Underline' = '0' . "Not underlined
**--Getting cell coordinates
*CALL METHOD OF GS_TABLE 'Cell'
*EXPORTING
*#1 = '1' "first row
*#2 = '1'. "first column
**--Getting the range handle to write the text
*GET PROPERTY OF GS_CELL 'Range' = GS_RANGE .
**--Filling the cell
*SET PROPERTY OF GS_RANGE 'Text' = 'abinash' .
**--Getting cell coordinates
*CALL METHOD OF GS_TABLE 'Cell' = GS_CELL
*EXPORTING
*#1 = '3' "third row
*#2 = '2'. "second column
**--Getting the range handle to write the text
*GET PROPERTY OF GS_CELL 'Range' = GS_RANGE .
**--Filling the cell
*SET PROPERTY OF GS_RANGE 'Text' = 'OLE' .
**--Advancing the cursor to the end of the table
*GET PROPERTY OF GS_TABLE 'Range' = GS_RANGE .
*GET PROPERTY OF GS_RANGE 'End' = GV_POS .
*SET PROPERTY OF GS_RANGE 'Start' = GV_POS .
*CALL METHOD OF GS_RANGE 'Select' .
**--Skip some lines
*DO 3 TIMES .
*CALL METHOD OF GS_SELECTION 'TypeParagraph' .
*ENDDO.
**--Reseting font attributes for ordinary text
*SET PROPERTY OF GS_FONT 'Name' = 'Times New Roman' .
*SET PROPERTY OF GS_FONT 'Size' = '12' .
*SET PROPERTY OF GS_FONT 'Bold' = '0' . "Not bold
*SET PROPERTY OF GS_FONT 'Italic' = '0' . "Not Italic
*SET PROPERTY OF GS_FONT 'Underline' = '0' . "Not underlined
**--Setting paragraph format attribute
*SET PROPERTY OF GS_PARFORMAT 'Alignment' = '3' . "Justified
**--Indent the paragraph once
*GET PROPERTY OF GS_SELECTION 'Paragraphs' = GS_PARAGRAPH .
*CALL METHOD OF GS_PARAGRAPH 'Indent' .
*CALL METHOD OF GS_SELECTION 'TypeText'
*EXPORTING
*#1 = TEXT-002.
FREE OBJECT GS_WORD .Now try your code on a system which dose not have word installed. It should fail.
To fix the problem every system should have word components installed.
Thanks,
Francis -
It seems that the interface to Word 97 has TOTALLY changed!! I'm trying
to create a new document from an existing template, so I'm assuming I
need to use the AttachedTemplate virtual attribute of the _Document
class. How do I set this attribute to the template I want to use?? I
haven't worked with virtual attributes, so I'm having a rough time! Any
help would be greatly appreciated.
Doug Scurr
Information Services
Piper Jaffray Companies
[email protected]
(612) 342-1748
Thanks
Doug
If you are not the intended recipient, please notify the Sender.
Non-business opinions may not reflect opinions of Piper Jaffray
Companies (PJC). Distribution or other use of this information
is prohibited without written consent from the author.
PJC reserves the right to monitor all e-mail.
------------------------------------------------------------------------------It seems that the interface to Word 97 has TOTALLY changed!! I'm trying
to create a new document from an existing template, so I'm assuming I
need to use the AttachedTemplate virtual attribute of the _Document
class. How do I set this attribute to the template I want to use?? I
haven't worked with virtual attributes, so I'm having a rough time! Any
help would be greatly appreciated.
Doug Scurr
Information Services
Piper Jaffray Companies
[email protected]
(612) 342-1748
Thanks
Doug
If you are not the intended recipient, please notify the Sender.
Non-business opinions may not reflect opinions of Piper Jaffray
Companies (PJC). Distribution or other use of this information
is prohibited without written consent from the author.
PJC reserves the right to monitor all e-mail.
------------------------------------------------------------------------------ -
Hi every one
I installed windows vista OS from then onwards i am not getting ABAP keyword documentation in F1 help.
please tell me how would i get this feature back.
Regards
RajeshCheck transaction ABAPDOCU. This shouldn't be dependent on which version of SAPGUI you have (assuming your sap rel is 4.6 or greater).
Also look in table tstct for transaction abapdocu.
If it doesn't exist then you need to re-install it. Should be part of standard SAP however.
VISTA is irelevant in this regard - however you might need to access the SAP help files via a browser and a manual link as the automatic link doesn't work properly under VISTA unless SAPGUI 7.0 is installed -- as the previous poster has said.
For the SAP library you can always use a manual link to the sap help data files but of course it won't work via F1.
Cheers
jimbo -
Insert OLE Word doc not showing all pages
Hi All,
I'm running a test on this before I get all involved in it.
I insert a multi page Word doc into my report.
When I run it, it only shows the first page.
That's the first problem.
When I export it as a Word doc, it exports only that page
and now it's become a non editable graphic.
I need it to be exportable to Word and editable.
That's the second problem.
Am I attempting the impossible ?
Thank you,
JimmyHi Jamie,
Thanks for your reply.
We have a Word document that gets sent out to about 400 schools.
I'm trying to take some of the redundancy out of the task by inserting
Institution Name
Director
Address
etc on the header of the document so that my colleges
won't have to look up each school, find the director, address,
etc and manually type it all in. Then the report gets exported
to Word, where further editing is done.
Also, the tables that they have built in Word must also
retain their integrity, being imported into AND being exported
from Crystal, as a Word document.
I could do this easily, and have, using text boxes, etc. Problem
is, it has to be done in Word. (That's what they're use to working with
Oh, my set up is:
Crystal 11.5
Stand alone desktop, no network. (Just me and the lone prairie ...)
Am I expecting too much ?
Thanks for the 3rd party info. That explains a lot.
Jimmy -
Report with OLE Object Problem (Crystal Report 11)
Post Author: ibertola
CA Forum: General
Hi all,I'm a new user, and I've got a problem with OLE object. I would like to have a report that show me ONLY one of many OLE (word document) in Crystal structure.I've created 3 section detail, and in each one I've insert OLE object (creating from a file, and LINK).So, if I change one document stored locally, and then refresh the report, the content doesn't change like the linked file! Actually I've got all locally Please help me.CR XI r2 is not supported on WIN 2008. See the [supported platforms|https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/7081b21c-911e-2b10-678e-fe062159b453]
documentation and [this|https://wiki.sdn.sap.com/wiki/pages/viewpage.action?pageId=56787567] wiki.
Ludek
Maybe you are looking for
-
Error while loading data in data services
Hi Experts, I´m working in SAP BW 7.0 using Data Services XI 3.2 with SAP BW as a target and schema oracle as a source and we have some problems with the load process I have problems with the conversion of special characters that exist in schema Orac
-
Hello, We have 1 resource Forest and multiple account Forests. We've reviewed the Cross-Forest Cert Enrollment with Windows Server 2008 R2 doc and followed steps 8 and 9 under the 'Deploying AD CS for Cross Forest Cert enrollment' regarding publishin
-
IOS Address book with empty contact
I saw some issues in the iPhone address book. I am not sure it is issue or not. We can create the contact without any information. I mean click the create button and just save. It is saving. what is the reason? Are their any particular purpose?
-
Real Simple Events Problem. Please Help.
Hi I'm a student learning java at the moment and having a problem getting events sorted. I am trying to reference a evetn between two classes defined within the same main class. private ColorPanel c; ....withing class called ButtonPanel public void a
-
Re: Pre-Configured Workflow Scenarios
Hi All, I came to know through the SAP Documentation that some pre-configured Workflow scenarios are available in especially in IDES environment. I'm looking for some pre-configured Workflow scenarios in ECC environment related to Item/Material/Produ