Add table using ole
Hello,
How to add table and border using ole in excel sheet?
Thanks,
Regards,
Neelambari
Hi Neelambari,
U need to select the required cells using .....
CALL METHOD OF p_gs_excel 'Range' = l_gs_s_cells
EXPORTING
#1 = p_sel_cells.
CALL METHOD OF l_gs_s_cells 'Select' .
here p_sel_cells. equals to A1:A1,A2:C2,A7:A7,A8:H8,A13:A13.
or u can give A1:C3.
Now drawing the box.....
DATA: l_gs_borders TYPE ole2_object.
GET PROPERTY OF l_gs_s_cells 'Borders' = l_gs_borders.
SET PROPERTY OF l_gs_borders 'LineStyle' = 1.
u can change the value 1 to other value for drawing different kind of box....
Amitava
Similar Messages
-
How do I add tables using iCloud Keynote
I'm using keynote bata (I know it's bata)...I want to add a table on to the current slide I'm working in but can't find an easy way to add it. I don't see an icon that would allow me to insert a table. I know I can using the actual app on a Mac but I'm trying to start getting use to iCloud and it's power. Anyone know where the insert table feature is located on keynote on iCloud?
Thanks,
Raj.Never mind - I found it. Not so clear but I got it. Thanks.
-
OLE - ADD TABLE TO DOCUMENT OF WORD
I WRITE REPORT AT ABAP THAT I ADD TABLE TO DOCUMENT OF WORD OFFICE BY USING ESPECIAL COMMANDS OF OLE, BUT width of all columns of table is identical.
i need help of you to get example program that setting
different width, for example 5 chars for one column, 30 chars for second and so.
thanks for who help me.Hi welcome to SDN.
check out the following article for sample code.
<a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/c1d54348-0601-0010-3e98-bd2">An Easy Reference for OLE Automation.pdf</a>
Regards
Raja -
For Statement on a table using add.instances - need help
Hi,
I made this table in an acrobat form. The table uses java script to add rows . The code I used is:
_detail.addInstance(1);
There are two fields on this table that I want to evaluate 1) an index named index1
and 2) the value named numAmount
The script I am using to evaluate these to fields is as follows:
if (form1.Page1.Subform1.Capital1.Capital1.detail.index1.rawValue ==2)
then
$.rawValue = form1.Page1.Subform1.Capital1.Capital1.detail.index1.numAmount.rawValue
endif
My problem is that I need to nest this if statement inside some kind of a loop. I want the program to look at my table, determine how many instances the user has added, scroll through the table and look at index1, if index 1 = 2 then i want it to return the value in numAmount.
I just can't get the syntax to work in either form calc or javascript.
I am trying to write this code using the calculate method on a fourth field located on form1.#subform[2].Table5.Row5.NumericField1
I have attached the file if it helps. The table is on page one of the form and the display field is on page three.
Any help would be much appreciated!!!This is an Acrobat Forms JavaScripting forum, you might find more help in one of the LiveCycle Designer forums.
-
How do I add more than one column to a table using SQL?
Hi
I need to add 3 columns to a table using SQL
the syntax
"ALTER TABLE TEST ADD COLUMN newcol1 float";
works fine - for adding one coumn only.
For multiple columns I tried various permutations along the lines of
"ALTER TABLE TEST ADD (COLUMN newcol01 float, COLUMN new2 float,COLUMN new3 float)";
"ALTER TABLE TIPSTEST ADD COLUMN new1 float"
"ALTER TABLE TIPSTEST ADD COLUMN new2 float"
"ALTER TABLE TIPSTEST ADD COLUMN new3 float"
etc., but this doesn't work.
From a web search it sounds like SQL can only add one column at a time.
I have a workaround : create intermediate temporary tables , copying data and adding
one column at each stage. It seems a fairly awkward way of programming though.
Am I missing something simple : is there a way to add multiple columns in one go?
ThanksOK : solved an underlying problem with this one myself
for the code
String createString;
createString = "select COFFEES.* INTO NEWCOFFEES FROM COFFEES"; // example
Statement stmt;
try {
stmt = a_Globals.database1Connection.createStatement();
stmt.executeUpdate(createString);
stmt.close();
a_Globals.database1Connection.close();
} catch(SQLException ex) {
System.err.println("SQLException: " + ex.getMessage());
} commenting out the line:
a_Globals.database1Connection.close();
Allowed the subsequent SQL statement(s) to work OK. Looks like this was the cause of several
difficulties, preventing me doing several SQL instructions in turn.
Thanks for the responses.
Mike2z -
Using OLE add Header to MS Word Document in ABAP Program
Dear Friends,
I have a requirement where I want to add Header and Footer to MS Word through OLE in ABAP Program
I am able to open the word document, through OLE,
I am stuck @ the following step.
CALL METHOD OF LO_APPLICATION 'ActiveDocument' = LO_DOCUMENT.
IF SY-SUBRC <> 0. EXIT. ENDIF.
CALL METHOD OF LO_DOCUMENT 'Sections' = LO_SECTIONS.
IF SY-SUBRC <> 0. EXIT. ENDIF.
Please let me know.
Thanks
RajeshHi Rajesh,
You have to use GET PROPERTY & SET PROPERTY attributes of OLE2_OBJECT to use headers.
Just a sample code snippet for your reference :-
DATA : GS_TABLE TYPE OLE2_OBJECT ,
GS_RANGE TYPE OLE2_OBJECT,
GS_CELLTYPE OLE2_OBJECT,
CALL METHOD OF GS_TABLE 'Cell' = gs_cell
EXPORTING #1 = '1'
#2 = '1'.
GET PROPERTY OF gs_cell 'Range' = gs_range.
SET PROPERTY OF gs_range 'Text' = 'VGUID'.
CALL METHOD OF gs_table 'Cell' = gs_cell
EXPORTING #1 = '1'
#2 = '2'.
For more details search on SCN for code on creating MS word document using OLE automation.
Regards
Abhii -
How to add multiple table when creating add on using b1de
Hi all,
Plz help me
How to add multiple table when creating add on using b1de.
ThanksHi dns_sap,
Can you explain a little better what you are trying to accomplish? Is it to create UserTables and UserFields in the database, when the addon runs the first time?
If so, you can use the following code
Add User Table
Try
Dim lRetCode As Long
Dim oUDT As SAPbobsCOM.UserTablesMD = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oUserTables)
oUDT.TableName = TableName
oUDT.TableDescription = TableDescription
oUDT.TableType = TableType
lRetCode = oUDT.Add
'// Check for error when adding the Table: if lRetCode = 0 the table was created; if lRetCode = -2035 the table already exisits
If lRetCode <> 0 Then
oApplication.MessageBox("Error: " & lRetCode.ToString & ", " & oCompany.GetLastErrorDescription)
End If
Catch ex As Exception
oApplication.MessageBox(oCompany.GetLastErrorDescription)
Finally
System.Runtime.InteropServices.Marshal.ReleaseComObject(oUDT)
oUDT = Nothing
lRetCode = Nothing
GC.Collect()
End Try
Add User Field
Try
Dim lRetCode As Long
Dim oUDF As SAPbobsCOM.UserFieldsMD = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oUserFields)
oUDF.TableName = TableName
oUDF.Name = FieldName
oUDF.Description = FieldDescription
oUDF.Type = FieldType
lRetCode = oUDF.Add
'// Check for error when adding the field: if lRetCode = 0 the field was created; if lRetCode = -2035, the field already exists
If lRetCode <> 0 Then
oApplication.MessageBox("Error: " & oCompany.GetLastErrorCode & ", " & oCompany.GetLastErrorDescription)
End If
Catch ex As Exception
oApplication.MessageBox(oCompany.GetLastErrorDescription)
Finally
System.Runtime.InteropServices.Marshal.ReleaseComObject(oUDF)
oUDF = Nothing
lRetCode = Nothing
GC.Collect()
End Try
Regards,
Vítor Vieira -
How does one add tables to an existing universe using COM designer SDK.
Morning All
How does one add tables to an existing universe using COM designer SDK. I have tried:
objUniverse.Tables.Add (strTable_Name)
but get "Cannot create Table" error.
Any ideas?
Thanks in advance.
AnitaHi Anita,
-Use the Add method to add classes and objects to an existing universe using a VB 6 application.
Adding a Class
Definition: Function Add(Name As String) As Class
Syntax: NameOfClassesVariable.Add
Adding an Object Instance
Definition: Function Add(Name As String, [ClassName As String]) As Object
Syntax: NameOfObjectsVariable.Add(name, [class])
- name is the name of the object.
- class is the name of the class containing the object. This parameter should be used in cases where more than one objects exist with the same name.
Sample Visual Basic 6 Code
Dim DesApp As Designer.Application
'MODIFY AND EXPORT CLASSES AND OBJECTS OF AN EXISTING UNIVERSE
Sub modify_and_export_universe()
Dim DesUnv As Designer.Universe
Dim DesCls As Designer.Class
Dim DesObj As Designer.Object
Dim DesDBCol As Designer.DBColumn
Dim DBColName As String
Set DesApp = New Designer.Application
'Login to designer
Call DesApp.LogonDialog
'Make sure to log on with your administrator profile
'e.g : "hostname","username", "password","Enterprise"
'Make Designer application visible
DesApp.Visible = True
'This line disable warning messages from Designer
DesApp.Interactive = False
'to Open locally the universe you want to modify
'Set DesUnv = DesApp.Universes.Open("club_uni")
'Use OpenFromEnterprise method (Universes Class) to import a universe from the repository and opens it
Set DesUnv = DesApp.Universes.OpenFromEnterprise("Universes", "club_uni", False)
'Add a valid connection which already exists
DesUnv.Connection = "club"
'open the universe
'Call DesApp.Universes.Open("club_universe")
'Add the table Account and refresh the view in the main window
Set DesTab = DesUnv.DBTables.Item("Customer").Insert
DesUnv.ArrangeTables
'Add a class
Set DesCls = DesUnv.Classes.Add("Class MyCustomer")
'Looping through all the fields of the DB Table Account
For Each DesDBCol In DesUnv.DBTables.Item("Customer").DBColumns
'Store name of the column
DBColName = DesDBCol.Name
'Add an object to the class
Set DesObj = DesCls.Objects.Add("Obj " & DBColName)
'Affect a field to the object
DesObj.Select = "Customer" & "." & DBColName
Next
'Save the existing universe with the same name club_uni or you can change
DesUnv.SaveAs "club_uni"
MsgBox "Universe created and saved Class MyCustomer has been added!!"
'Close the universe
UnvFullName = DesUnv.FullName
MsgBox "The UniverseFilePath is " & UnvFullName
'Close the universe
DesUnv.Close
'This line disable warning messages from Designer
DesApp.Interactive = False
'Export the universe to the CMS DB (to the last universe folder)
'Make sure you save the universe before exporting it
Call DesApp.Universes.Export("Universes", UnvFullName)
MsgBox "This document has been exported successfully !!"
'Close designer
DesApp.Quit
Set DesApp = Nothing
End Sub
Hope this helps.
Regards,
Deepti Bajpai -
Add Row in a SAPUI5 Table using xmlModel
Hi, experts,
I want to add a new row in a table using a button.
My table was loaded by xmlModel and now i want to add a new row using a toolbar buton. I dont know how i can do it with xmlModel. I Saw some examples with JsonModel.
Anybody can help me?
Regards,
MarceloHi Raman,
Option to add/delete row is available in studio. You can double click and select any particular cell and right click to see the 'Table' options.
It is a little tricky to get it correct in versions prior to 12.0. Consider saving the changes each time.
Thank you,
Sruthi Jayasimhan -
How to point at a word table using forms Ole and Word Document
Hello.
I like to know how to position at a word table and send data from a forms module using ole. I have done something similar before using bookmarks.It's easy and it works. My requirement now is to send data from a forms module to a word document, but this time, the word document will have bookmarks and a word table needs to be filled from data from the database. Just don't know how to get , access, reference the word table from forms.
I'm still using forms6i in C/S mode.
Help will be greatly appreciated ...!.
Best regards, Luis ...!Hi Luis,
The VBA code for updating the cell found at row three, column two of the first table, of the active document is as follows:
ActiveDocument.Tables(1).Cell(3,2).Select
Selection.TypeText("Hello, world!")I haven't time to convert it to OLE2, but hopefully it will at least give you an idea.
Eric Adamson
Lansing, Michigan -
Listen to add/upd/del on a db table using JClient
I am building a UI that views a log table on the database. The log table is constantly updated by external procedures in the DB. I've used the BC4J wizard to import the log table and built a UI client around this.
Is there a way to listen to events on the underlying table using the framework I've built. i.e can the BC4J entities recieve notifications about row add/upd/del and relay this to the VO?
Any help appreciated. (Otherwise I have to consider a background timer that refreshes the view every n minutes).Hi,
what about using a timer?
Another, more coding intensive way, would be advanced queueing in Oracle DB.
Frank -
Is it possible to add records to tables using Enterprise Manager?
Can we add records to tables using Oracle Enterprise Manager web interface instead of the sqlplus commands ? if not, is there any easy way to insert data into table using a graphical interface?
You may consider using iSQL*Plus.
Check http://www.oracle.com/technology/obe/obe10gdb/install/isqlplus/isqlplus.htm
Thanks, -
I created a table using the ranking field and now I need to delete the "dots/buttons" and turn them into text fields, is this possible?
It sounds like what you are trying to do is edit the choices in a likert field to something other than the default radio button. This is not something that you can do in Formscentral at this time.
Andrew -
I know I've REALLY struggled with this before. I just don't understand why this has to be soooooo difficult.
I can very easily do a straight Data Pump of a .xlsX File into a SQL Server Table using a normal Excel Connection and a normal Excel Source...simply converting Unicode to DT_STR and then using an OLE DB Destination of the SQL Server Table.
If I want to make the SSIS Package a little more flexible by allowing multiple .xlsX spreadsheets to be pumped in by using a Foreach Loop Container, the whole SSIS Package seems to go to hell in a hand basket. I simply do the following...
Put the Data Flow Task within the Foreach Loop Container
Add the Variable Mapping Variable User::FilePath that I defined as a Variable and a string within the FOreach Loop Container
I change the Excel Connection and its Expression to be ExcelFilePath ==> @[User::FilePath]
I then try and change the Excel Source and its Data Access Mode to Table Name or view name variable and provide the Variable Name User::FilePath
And that's when I run into trouble...
Exception from HRESULT: 0xC02020E8
Error at Data Flow Task [Excel Source [56]]:SSIS Error Code DTS_E_OLEDBERROR. An OLE DB error has occured. Error code: 0x80004005.
Error at Data Flow Task [Excel Source [56]]: Opening a rowset for "...(the EXACT Path and .xlsx File Name)...". Check that the object exists in the database. (And I know it's there!!!)
I don't understand by adding a Foreach Loop Container to try and make this as efficient as possible has caused such an error unless I'm overlooking something. I have even tried delaying my validations and that doesn't seem to help.
I have looked hard in Google and even YouTube to try and find a solution for this but for the life of me I cannot seem to find anything on pumping a .xlsX file into SQL Server using a Foreach Loop Container.
Can ANYONE please help me out here? I'm at the end of my rope trying to get this to work. I think the last time I was in this quandry, trying to pump a .xlsX File into a SQL Server Table using a Foreach Loop Container in SSIS, I actually wrote a C# Script
to write the contents of the .xlsX File into a .csv File and then Actually used the .csv File to pump the data into a SQL Server Table.
Thanks for your review and am hoping and praying for a reply and solution.Hi ITBobbyP,
If I understand correctly, you want to load data from multiple sheets in an .xlsx file into a SQL Server table.
If in this scenario, please refer to the following tips:
The Foreach Loop container should be configured as shown below:
Enumerator: Foreach ADO.NET Schema Rowset Enumerator
Connection String: The OLE DB Connection String for the excel file.
Schema: Tables.
In the Variable Mapping, map the variable to Sheet_Name, and change the Index from 0 to 2.
The connection string for Excel Connection Manager is the original one, we needn’t make any change.
Change Table Name or View name to the variable Sheet_Name.
If you want to load data from multiple sheets in multiple .xlsx files into a SQL Server table, please refer to following thread:
http://stackoverflow.com/questions/7411741/how-to-loop-through-excel-files-and-load-them-into-a-database-using-ssis-package
Thanks,
Katherine Xiong
Katherine Xiong
TechNet Community Support -
ALV download to Excel onto desktop using OLE concept.
Hi Experts,
I requriement is , through my se38 program i need to download report output to excel.
i did this using OLE concepts code and excel is being downloaded good.
But problem is all columns data is dumped into First column. But in my ALV i have 20 columns. So i except data in excel sheet to be in 20 columns.
Below is the OLE code i used
CREATE OBJECT wa_excel 'EXCEL.APPLICATION'. "Create object for Excel
SET PROPERTY OF wa_excel 'VISIBLE' = 1. "In background Mode
CALL METHOD OF wa_excel 'WORKBOOKS' = w_workbook.
CALL METHOD OF w_workbook 'ADD'. "Create a new Workbook
SET PROPERTY OF wa_excel 'SheetsInNewWorkbook' = 3. "No of sheets
* Downloading header details to first sheet
PERFORM download_sheet TABLES i_final USING 1 'Master Material Details'.
GET PROPERTY OF wa_excel 'ActiveSheet' = w_worksheet.
* Protect the first worksheet with a password
CALL METHOD OF w_worksheet 'PROTECT
EXPORTING #1 = 'infy@123'.
* Save the Excel file
GET PROPERTY OF wa_excel 'ActiveWorkbook' = w_workbook.
CALL METHOD OF w_workbook 'SAVEAS'
EXPORTING #1 = p_infile.
FREE OBJECT: w_worksheet, wa_excel.
FORM download_sheet TABLES p_tab USING p_sheet TYPE i p_name TYPE string.
CALL METHOD OF wa_excel 'WORKSHEETS' = w_worksheet
EXPORTING
#1 = p_sheet.
CALL METHOD OF w_worksheet 'ACTIVATE'.
SET PROPERTY OF w_worksheet 'NAME' = p_name.
CALL METHOD OF wa_excel 'Range' = w_range
EXPORTING
#1 = 'A1'
#2 = 'D1'.
CALL METHOD OF w_range 'INTERIOR' = w_int.
SET PROPERTY OF w_int 'ColorIndex' = 6.
SET PROPERTY OF w_int 'Pattern' = 1.
* Initially unlock all the columns( by default all the columns are locked )
CALL METHOD OF wa_excel 'Columns' = w_columns.
SET PROPERTY OF w_columns 'Locked' = 0.
* Locking and formatting first column
CALL METHOD OF wa_excel 'Columns' = w_columns
EXPORTING
#1 = 1.
* Locking and formatting second column
CALL METHOD OF wa_excel 'Columns' = w_columns
EXPORTING
#2 = 2.
SET PROPERTY OF w_columns 'Locked' = 2.
SET PROPERTY OF w_columns 'NumberFormat' = '@'.
* Export the contents in the internal table to the clipboard
CALL METHOD cl_gui_frontend_services=>clipboard_export
IMPORTING
data = p_tab[]
CHANGING
rc = w_rc
EXCEPTIONS
cntl_error = 1
error_no_gui = 2
not_supported_by_gui = 3
OTHERS = 4.
* Paste the contents in the clipboard to the worksheet
CALL METHOD OF w_worksheet 'Paste'.
* Autofit the columns according to the contents
CALL METHOD OF wa_excel 'Columns' = w_columns.
CALL METHOD OF w_columns 'AutoFit'.
FREE OBJECT: w_columns, w_range.
Please help me if there is any SET Property of WA_EXCEL with which i can handle ALV data into Diffrenet columns.
Regards,
jayant.hi nabheet,
we have implemnted this logic and it is workign fine. Bit it takes long time to download data in Excel sheet. Actually it is happening feild by field.
Please advice any perfomance tuning to this logic.
Rgs,
jayant
Maybe you are looking for
-
Is it normal for progress bar to appear at every start up ?
after upgrading to Yosemite, every time i start my Mac a progress bar appears and it seems to take longer to get to the home screen - is this normal ?
-
Hi I am trying to use the new Mustang release which has the CMS bug causing long rescans fixed. However, I am running into this exception which occurs in b71 but not Java 1.5.0 Caused by: java.lang.IllegalStateException: zip file closed
-
Hi Experts, In the following code I am getting some error like, "the list (w_tabnachn,w_tabvorna) after "INTO" is not of the form (f1,...,fn) or contains an undefined field. the form (f1,...,fn), or contains an undefined field. " SELECT nachn vorna
-
Problems by sharing Web Dynpro Project in SVN or CVS Repository
Hi, I am trying to share a Web Dynpro Project with an 3rd-Party Repository like SVN or CVS instad of DTR. As help to share this project I used the guideline from Wolf Hengevoss ("The Fast Way to Component-Based Development with the SAP NetWeaver CE 7
-
Canon EF 24-70 F2.8 mk11 focusing issues
Hi, I covered a wedding yesterday. Used a 5Dmk111 and a Canon EF 24-70 F2.8 mk11. A lot of my shots were at 24-30mm @ f2.8 or f3.2 and a large proportion of these were out of focus. The chosen focus point was in centre but the focus in the shots was