Move Table Column with AppleScript in Microsoft Word

Microsoft Word has a flaw (in my opinion) with tables in that it aligns the left and right text with the margins rather than aligning the table columns with the margins. This results in sloppy tables, because the left and right borderlines lie outside the margins.
I would like to fix the word tables by
calculating the left cell padding and right cell padding in points and setting them to variables {left_pad,right_pad} respectively
move left column by left_pad to the right
move right column by right_pad to the left
The script I was working on does not work, but I will post it to show my thought process as I hone in on my solution.
tell application "Microsoft Word"
    --595 points is width of A4 paper
    -- Set page margin in points to variables
    set {l_margin, r_margin, t_margin, b_margin} to {(get left margin of page setup of active document), get (right margin of page setup of active document), get (top margin of page setup of active document), get (bottom margin of page setup of active document)}
    get {l_margin, r_margin, t_margin, b_margin}
    -- Set specific Paragraph margins
    -- NOTE: If you select a table thinking you wish to drag just the left margin to the right, or the right margin to the left, this code does not accomplish this because each cell has its own paragraph formatting. This code will set the margin for every single cell, because each cell has its own margins! (separate from padding).
    set para_sel to paragraph format of selection
    set paragraph format left indent of para_sel to (centimeters to points centimeters 0.5)
    -- Aligning left and right columns of table with the margins
    -- NOTE: There is a command to set left row indent, but not right row indent (very stupid of Microsoft)
end tell

I have worked up something that seems to work (although I cannot promise it is the best way). Hope it helps anyone else who has this need.
tell application "Microsoft Word"
activate
set findRange to find object of selection
clear formatting findRange -- clear any previous formatting used in a find operation
set forward of findRange to true -- find forward
set style of findRange to "List Bullet" -- the style to look for
tell findRange
set gotIt to execute find find text "" -- do the search w/o matching any text
end tell
if gotIt is true then -- if a match was found
copy object selection -- copy it to the clipboard
set mySelection to (the clipboard) -- then put clipboard into a variable
set myOffset to ¬
(get selection information selection information type ¬
(horizontal position relative to page)) -- now put selection info into a variable
display dialog mySelection & return & (myOffset as text) -- then display it
end if
end tell

Similar Messages

  • Hiding Table Columns with the Spry Element Selector

    I am trying to set up a toggle button that will show/hide
    rows >1 when clicked. I've used Adobe's
    "Hiding
    Table Columns with the Spry Element Selector" example and it
    worked fine with an HTML list, until I linked to actual XML data.
    Now it works in reverse. What gives?
    Here's the example:
    http://a44.awardspace.com/testing/toggleShowHideRows.htm

    That's what I started with. Same result:
    http://a44.awardspace.com/testing/toggleShowHideRows.htm

  • I'm using an iBook G4. I'm having a problem with a lengthy Microsoft Word (2003) document crashing. It keeps telling me that there's a problem and then working and working. I have to do a forced shutdown.

    I'm using an iBook G4. I'm having a problem with a lengthy Microsoft Word document. It keeps freezing when I try to make a change in it. The computer is working and working. Then I have to use a forced shutdown. And it starts all  over again. Suggestions?

    Is there sufficient free space on the iBook's startup disk (typically called Macintosh HD)?  The OS and apps use free space to write temporary files, and it free space becomes too low, it can cause the Mac to bog down.  Low free space also makes whatever free space is left fragment into tiny pieces scatter all over the hard drive, making the problem even worse.  If it more than 90% full, you should free up some space.

  • How do you add a row to an existing specific table (ie. Table 2) in an active Microsoft word document via applescript?

    I've tried:
    Tell application "Microsoft Word"
    insert rows at bottom of table 2 of active document
    end tell
    with no luck?
    I've also tried various oher permutations.
    Would some be able to help with this?
    Thanks

    Hi,
    Try this
    tell application "Microsoft Word"
        select (last row of table 2 of active document)
        insert rows selection position below number of rows 1
    end tell

  • Applescript on Microsoft Word 2004

    Hello,
    I have a very strange problem with applescript and word.
    When using a script simular to this:
    tell application "Microsoft Word"
    open "fm:file.doc"
    save as active document file name "fm:file.doc" file format format
    activate
    end tell
    It works for all users but for one.
    He always gets this error message:
    Microsoft Word got an error: active document doesn’t understand the save as message. (-1708)
    And I have no idea why.
    I double check everything.
    The path is correct. (It opens file.doc on the same location.)
    I've deleted the word preferences, in case there is something wrong with them.
    I even reinstalled Microsoft Office.
    I also installed all the updates (running Word 11.5.6 now).
    But nothing worked so far. - I don't know what I could try next. - Please help me.

    ok - thank you.
    reposted in http://discussions.apple.com/thread.jspa?threadID=2360890

  • File locking with OSX Server & Microsoft Word

    We have a small office LAN based on a Airport Extreme bases station. Periodically Microsoft Word reports a break in connection to the shared folder where we store documents to get disconnected. When that happens and the user reconnects to the share, the user gets the file read-only message for the Word document that was open at the time.
    I have found that in order to clear the read-only flag, I have to restart the server and open the Word file on the server with the ID of the user who was editing the file on the remote computer. Only that seems to clear the file locking that causes the file to be read-only.
    I cannot figure out a less drastic way to release the lock file. I don't see any hidden temp files in the same folder as the document that is locked for editing found by ls -a or in the root direction of the shared folder in the .TemporaryItems/folders.<UID> that seems to be holding the lock.
    I have run chflags nouchg <Word file> from Terminal, but that seems to have no effect either. I also used xattr to see if there were any locks held that way, but I don't see anything that way either.
    File sharing to Macs only, which are configured just to use AFP through OSX Server.
    Does anyone understand how the file locks of Word documents can be released directly with out restarting the server?
    I should add that the underlying problems seems to be WiFi related. The behavior is that the WiFi connection seems to break long enough that the shared volumes disconnects. Outlook also causes a break. This behavior seems to have started with 10.9 and the purchase of new Retina Display MacBook Pros. I turned off AppNap on the Office applications but that is not clearly helpful. I also have been told the problem seems more likely to occur when Word is open in the background and another program like Outlook is in the foreground.
    Any suggestions appreciated.

    Apple write an operating system and also produce file sharing software as part of that to be used as a file server. Apple provide documentation for third-party software developers on how they should write software to work with Apple's software and also give those developers early access to new versions so those third-party developers can test and if needed make adjustments and issue updates to cope with any Apple changes.
    Some third-party developers are good at dealing with this, some are bad, and some totally ignore what Apple does and give the impression they don't care if their product works properly or not. I think we can all judge where Microsoft sits.
    It appears Microsoft have never paid any attention in particular to how Apple expect file-locking to be handled when accessing files on a Mac server. There have been problems for years and years and years with Office. Two other problems I have seen which seem different to yours but probably related are -
    With Office documents it is supposed to be possible for more than one person to edit the same file at the same time, consider it a miracle if this actually works
    With Office in particular Word, there is an auto-save function, unfortunately the way this seems to be implemented it seems that Word creates a new temporary file each time it auto-saves the document and keeps all the previous temporary files open still, this eventually means potentially over a hundred temporary files are open - just for one Word document and you can then hit a limit on the total number of files you are allowed to have open at the same time. At this point further auto-saves fail, and you also encounter great difficulty doing a real full save of the document.
    I do not hold Apple completely blameless over this issue, it is likely their file-locking implementations change too often, and have inadequate documentation, however even considering this a company the size of Microsoft with the amount of sales (and profit) they derive from Office for the Mac has no excuses at all for failing to put the effort in to resolve any such clearly critical problems.
    We could go on and on about other areas where Microsoft don't play by the (software) rules. Even in Windows Office does not obey the standard print dialog rules Microsoft specified themselves!
    Unfortunately not only is Office for Mac upgraded infrequently, but even when new paid for upgrades are released Microsoft have a history of still not fixing bugs. It goes without saying that a mere free update is even less likely to actually fix a bug, typically such free updates only address security issues. The next version of Office is going to be Office for Mac 2014 see http://www.macworld.com/article/2106643/microsoft-will-release-a-new-version-of- office-for-mac-this-year.html
    One area I confidently predict Microsoft not to resolve in Office for Mac 2014 is that fact that Word for Mac still does not support right-to-left languages like Hebrew and Arabic. This is despite the fact that OS X itself has supported this for years and years, and despite the fact other Mac programs support this including the free TextEdit and Pages - both of which can read Word files. Some people may remember that at one point the Israeli Government temporarily banned all Microsoft software over this issue. See http://apple-beta.slashdot.org/story/03/10/15/2215249/israeli-government-suspend s-microsoft-contracts This issue goes back over TEN years!!
    I note that Microsoft has now taken their OfficeForMac blog offline, probably due to the weight of criticisms. I would not say it is due to out-right anti-Microsoft hate, that war ended long ago. We just want products that work. I myself do use Microsoft products, even at home - where they are the best solution, so I use Microsoft Media Center for example. Sadly this is now being neglected by Microsoft.

  • Convert Adobe Form (with data) to Microsoft Word Document

    Adobe Acrobat 8.0 Standard
    Windows XP Professional SP2
    Microsoft Word 2003 SP3
    I am attempting to convert an Adobe PDF Form (with data included) to a Microsoft Word document.
    When I use the menu to attempt this, I get a Word document containing only the form fields.
    I want to be able to grab all the text from the document, as these forms were used to fill in information for Job Descriptions, and I want to submit the text to job boards (without having to retype anything).
    What are my options for obtaining this information?

    Bill:
    Thank you for all of your help. I do not have the program in front of me, so I don't have a means of independently verifying this, until I go see the user tomorrow when he returns to the office ...
    Just to confirm, a fillable PDF is different from a standard PDF, as it stores the form fields in a special way, likewise, the data is stored in a special way. This is actually a quite useful feature, for compiling data, if you use the form multiple times.
    A standard export of a fillable PDF exports only the fields.
    To get the data, I would have to choose to save form data.
    To get the fields and the data, I have to print it using a PDF printer to create a new PDF document. Once I create this new PDF document, I can then export to Word as desired.
    If I want ONLY form fields: (one-step process)
    Export > Microsoft Word > %filename%.DOC
    If I want ONLY form data:(one-step process)
    File > Save FORM DATA > FDF file format > %filename%.FDF
    If I want both the form and the data: (two-step process)
    File > Print to PDF > Save as %filename%.PDF
    Open %filename%.PDF > Export > Word Document
    Is this the process? Pardon my confusion, but I am a newbie, and I do not have the program to test with.
    Thanks for your help, kind sir.

  • Indices and constraints on XML Tables/Columns (with Schema)

    Hi,
    I've read a lot of documents by know, but the more I read the more I got confused. So I hope you can help me.
    Frist my Oracle Server Version: Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit
    I've manages to create a table with a column with the type SYS.XMLTYPE and the storage modle "Object Relational" with an XML Schema.
    I can insert data and I can execute XQuery statements.
    I can also create an XMLTYPE table with my Schema, althoug the tool SQL Developer keeps telling me, that the one column wich is generated within the table is of the type CLOB instead of object realtional (which is what I defined).
    The query for that is:
    CREATE TABLE ENTRY_XML OF XMLTYPE
    XMLTYPE STORE AS OBJECT RELATIONAL
    XMLSCHEMA "BBMRI_Entry.xsd" ELEMENT "Entry";
    That's where I am, now my questions:
    1. What's the difference? I'm aware of the obviouse difference, that with the first way I can add relational columns as well, but apart from that? If I only want to store the xml data, is the second approach always better (especially in regard to my next question)?
    2. My schema contains elements with attributes (which contain IDs), which have to be unique. So I tried to add a UNIQUE constraint, but failed. I found this (http://www.oracle.com/technology/sample_code/tech/java/codesnippet/xmldb/constraints/Specify_Constraints.html), but it just doesn't work.
    Query: "ALTER TABLE ENTRY_XML CONSTRAINT ENTRY_XML_SUBID_UNQIUE UNIQUE (xmldata."SubId");"
    Error: "ORA-01735: invalid ALTER TABLE option"
    3. I didn't try yet, but I need to specifiy foreign keys within the XML as well (which is explained in the link at question 2). I guess the solution to question 2 will make this possible as well.
    4. Since I can create a UNIQUE constaint for attributes (well, I can't yet, but I hope that this will change soon) I woundered if it would be possible to realize something like auto_increment. Although I see the problem with validating the xml input if the Ids are empty. Any suggestions on that problem? Do I have to query for the highest (free) id before I can insert the new documents?
    Well, that's enough for today, I hope someone can help me!
    Greetings, Florian

    I've read through all the literature (again) and found out, that I did most of the stuff right in the first place. I just missinterpreted the generated tables for the types and wondered why they only contained one column. Well, at least one mistery solved.
    But know to make it easier just one question, which might solve all problems I have:
    How can I create UNIQUE constraints and FOREIGN KEYS when I have a table or column of the type XmlType with a schema using the object relational storage method?
    I found a solution http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14259/xdb05sto.htm#i1042421 (Example 5-12), but it just does not work for me.
    I removed the FOREIGN KEY and tried it again and the UNIQUE Key works.
    So basically the question is how to retrieve the "AId" Attribute. "XMLDATA"."AId", "XMLDATA"."Attribute"."AId" and "XMLDATA"."Subject"."Attribute"."AId" all do not work.
    I've added my schema declarations at the bottom (which I've already successfully registred and used without foreign keys and constraints, so they work).
    After I've registered the two schema files 3 types and 11 tables where created. One type for the attribute, one for the study type and one probably to link the attributes to the study types. The tables are one for the attribute, 4 for the content*-elements, 2 for the study type (I don't really know why two) and 4 with strange names starting with "SYS_NT" and then some random numbers and letters (looks alot like some base64 encoded string).
    The Query I try to use to create the table is: (The table "Attribute" already exists and contains a field "ID", which is it's PK.)
    CREATE TABLE STUDYTYPE_XML
    OF XMLType (UNIQUE ("XMLDATA"."STId"),
    FOREIGN KEY ("XMLDATA"."AId") REFERENCES ATTRIBUTE(ID))
    XMLTYPE STORE AS OBJECT RELATIONAL
    ELEMENT "StudyType.xsd#StudyType";
    The error I get is:
    Error starting at line 1 in command:
    CREATE TABLE STUDYTYPE_XML
    OF XMLType (UNIQUE ("XMLDATA"."STId"),
    FOREIGN KEY ("XMLDATA"."AId") REFERENCES ATTRIBUTE(ID))
    ELEMENT "StudyType.xsd#StudyType"
    Error at Command Line:3 Column:37
    Error report:
    SQL Error: ORA-22809: nonexistent attribute
    22809. 00000 - "nonexistent attribute"
    Cause: An attempt was made to access a non-existent attribute of an
    object type.
    Action: Check the attribute reference to see if it is valid. Then retry
    the operation.
    Attribute-Schema (Attribute.xsd):
    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified">
         <xs:attribute name="AId">
              <xs:simpleType>
                   <xs:restriction base="xs:integer">
                        <xs:minInclusive value="0" />
                   </xs:restriction>
              </xs:simpleType>
         </xs:attribute>
         <xs:attribute name="Name" type="xs:string" />
         <xs:element name="ContentString" type="xs:string" />
         <xs:element name="ContentInteger" type="xs:integer" />
         <xs:element name="ContentDouble" type="xs:decimal" />
         <xs:element name="ContentDate" type="xs:date" />
         <xs:element name="Attribute">
              <xs:complexType>
                   <xs:choice minOccurs="0" maxOccurs="1">
                        <xs:element ref="ContentString" />
                        <xs:element ref="ContentInteger" />
                        <xs:element ref="ContentDouble" />
                        <xs:element ref="ContentDate" />
                   </xs:choice>
                   <xs:attribute ref="AId" use="required" />
                   <xs:attribute ref="Name" use="optional" />
              </xs:complexType>
         </xs:element>
    </xs:schema>
    Study Type Schema (StudyType.xsd):
    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified">
         <xs:include schemaLocation="Attribute.xsd" />
         <xs:attribute name="STId">
              <xs:simpleType>
                   <xs:restriction base="xs:integer">
                        <xs:minInclusive value="0" />
                   </xs:restriction>
              </xs:simpleType>
         </xs:attribute>
         <xs:element name="StudyType">
              <xs:complexType>
                   <xs:sequence>
                        <xs:element ref="Attribute" minOccurs="1" maxOccurs="unbounded" />
                        <xs:element ref="StudyType" minOccurs="0" maxOccurs="unbounded" />
                   </xs:sequence>
                   <xs:attribute ref="STId" use="required"/>
              </xs:complexType>
         </xs:element>
    </xs:schema>
    Edited by: alwaysspam on Sep 8, 2010 5:35 PM

  • Custom sort pivot table columns with Essbase as the data source

    Is it possible to sort columns in a pivot table according to an arbitrary value that I define when the data is coming from Essbase?
    For example, say I have a dimension called Soda, with values Coke, Diet Coke, Dr. Pepper and Diet Dr. Pepper. I create a report with a sales measure with the measure labels on the rows and the Soda dimension on the column. By default the columns will be sorted alphabetically:
    Coke Diet Coke Diet Dr. Pepper Dr. Pepper
    Sales 1M .5M .75M 1.25M
    I want to create a report that looks like this:
    Coke Diet Coke Diet Dr. Pepper Dr. Pepper
    Sales
    I think I could do this if the source was relational just by creating bins or creating a custom column with a case statement that assigns each Soda an arbitrary value and then sort on this value. Everything I've tried with Essbase as the source, though, results in:
    State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 42043] An external aggregate is found in an outer query block. (HY000)
    Any ideas?

    Hi,
    1. You can try solve the 'An external aggregate is found in an outer query block' by changing aggregation rule for your measure both in physical and business layer.
    By default it's set to Aggr_External - change it to Sum
    In physical : Column properties->Aggregation rule
    In business model : Column properties->Aggregation tab -> Default aggregation rule.
    This may change the result - after changing check whether you still get correct values.
    2. Also, in case the desired order is the same as the order of members in the Essbase cube, and you want to leave Aggr_External, you can create a calculated column that will help you with the sort.
    See http://oraclebizint.wordpress.com/2008/04/28/oracle-bi-ee-101332-handling-sort-order-in-hyperion-essbase-931-evaluate-and-mdx/
    Hope this helps,
    Alex

  • SQL from Table Column with Dynamic URL Problem

    This is the SQL I'm attempting to save to a table column via the Object Browser;
    select
    "a"."PBR_BRIEF_ID" "Brief ID",
    "a"."PROJECT_NUMBER" "Project",
    "b"."DESCRIPTION" "Description",
    "b"."ACTUAL_END_DATE" "Actual End",
    "b"."RFS_DATE" "RFS",
    "b"."LOCATION_CODE" "Location",
    ''||"b"."ESA_CODE"||'' "ESA",
    "b"."PROJECT_USER_STATUS" "Status",
    "b"."PROJECT_TRIGGER" "Trigger"
    from
    UPT1TRIAL.FUND_PLAN_BRIEF_LINK_CCR@NDSD "a",
    UPT1INTEGRAL.INT_PROJECT_DATA@NDSD "b"
    where
    "a"."PBR_BRIEF_ID" = :P3_BRIEF_ID and
    "a"."PROJECT_NUMBER" = "b"."PROJECT_DEFINITION_NUMBER"
    The intesting bit is the following, where a URL is return behind a particular column;
    ''||"b"."ESA_CODE"||'' "ESA",
    It's interesting because when I click on "Apply Changes" in the Object Browser, the text that appears in the column is as follows, i.e. with APP_ID and SESSION populated;
    ''||"b"."ESA_CODE"||'' "ESA",
    Why would that happen??
    The full SQL above is used in an application page with a SQL Query (PL/SQL function body returning SQL query). The basic SQL works OK but because of what the Object Browser is doing, the link does not.
    Message was edited by:
    Damian - apologies for lack of formatting!!
    Message was edited by:
    Damian

    Damian,
    Use
    & lt;
    for your &lt; tags and then the message will appear in the proper format.
    If you are using dynamic sql to generate an url with APP_ID and SESSSION you could:
    a) create page items (P1_APP_ID and P1_SESSION)
    b) compute those page items to the actual APP_ID and SESSION_ID
    c) use the value of those items while generating your dynamic sql (instead of APP_ID and SESSION)
    Then, your links will show the right APP_ID and the right SESSION.
    Denes Kubicek

  • Impact of table columns with number datatype but has no precision in Forms

    Hi.
    Currently, I have table columns that have a data type of number but has no precision declared (e.g. AGREEMENT_CODE NUMBER). I would just like to ask if there's anyone out there who knows if this has a negative impact on Oracle's forms and reports...with the way buffer memories are allocated or other things on performance. I am still putting in maximum length values for base table items. I don't know if this will affect buffer memory allocation as well.
    Thank you.

    I don't know this for fact, but I would think that numbers with a large number of significant figures might affect buffer sizes, but I'll bet your example AGREEMENT_CODE values would never have a large number of figures. In fact, whether or not you limit the size of a number in the database or your form probably does not affect the way the actual data values are transmitted or stored.
    If someone is telling you to worry about this, I think they are barking up the wrong tree someplace way out in left field.
    There are so many other things that can seriously affect processing speed and data transfer speed, starting with query plans and index usage. I have never heard this one causing concern anywhere before.

  • How to change the css behaviour of af:table column with rowheader

    Hi
    Can we change the css look and feel of the af:column with rowheader attribute set true ? Currently I am getting a projected look with shades in the left side. I want it to be like normal af:column style. If there any specific styleClass I need to put please provide the details
    THanks
    Suneesh

    Hi,
    you can use skinning for this. The skin selectors are shown here:
    http://download.oracle.com/docs/cd/E15523_01/apirefs.1111/e15862/toc.htm
    Frank

  • How to make table column with formula

    Hi all..
    This is my class
    public class MyNumber{
         private int num;
         public int getNum(){
              return num;
         public void setNum( int num){
              this.num = num;
    }Consider I design a table with FXML editor ( Scene Builder in this case )
    and these are some of my codes
    private TableView tab;
    private TableColumn<MyNumber, Integer> tabColInput;
    private TableColumn tabColOutput;
    tab.setEditable(true);
    tabColInput.setEditable(true);
    tabColInput.setCellValueFactory( new PropertyValueFactory<Person,Integer>("num") );
    tabColInput.setCellFactory(TextFieldTableCell.forTableColumn());
    tabColInput.setOnEditCommit(
        new EventHandler<CellEditEvent<MyNumber, Integer>>() {
            @Override
            public void handle(CellEditEvent<MyNumber, Integer> t) {
                ((MyNumber) t.getTableView().getItems().get(
                    t.getTablePosition().getRow())
                    ).setNum(t.getNewValue());
    );Problem:
    I want to make tabColOutput to always show the result for tabColInput times 2
    eg:
    When I change a row in tabColInput to 10, tabColOutput will show 20
    When I change a row in tabColInput to 3, tabColOutput will show 6
    Could anyone advice me how to do this?
    Ps: I am not english native speaker, so I am sorry if I am saying it wrong ^^

    I just give it a try and it works like magic
    Here is how I do it (change a cell from a table by code)
    import java.util.ArrayList;
    import java.util.List;
    import javafx.application.Application;
    import javafx.collections.FXCollections;
    import javafx.collections.ObservableList;
    import javafx.geometry.Insets;
    import javafx.scene.Group;
    import javafx.scene.Scene;
    import javafx.scene.control.Label;
    import javafx.scene.control.TableColumn;
    import javafx.scene.control.TableView;
    import javafx.scene.control.cell.PropertyValueFactory;
    import javafx.scene.layout.VBox;
    import javafx.scene.text.Font;
    import javafx.stage.Stage;
    public class TableViewSample extends Application {
        public static final String Column1MapKey = "A";
        public static final String Column2MapKey = "B";
        public static void main(String[] args) {
            launch(args);
        @Override
        public void start(Stage stage) {
            List<MyTableData> listData = new ArrayList<MyTableData>();
            listData.add(new MyTableData("A", 21) );
            listData.add(new MyTableData("B", 24) );
            listData.add(new MyTableData("C", 23) );
            listData.add(new MyTableData("D", 21) );
            listData.add(new MyTableData("E", 22) );
            ObservableList<MyTableData> tableData = FXCollections.observableArrayList(listData);
            Scene scene = new Scene(new Group());
            stage.setTitle("Table View Sample");
            stage.setWidth(300);
            stage.setHeight(500);
            final Label label = new Label("Student IDs");
            label.setFont(new Font("Arial", 20));
            TableColumn<MyTableData, String> firstDataColumn = new TableColumn<MyTableData, String>("NAME");
            TableColumn<MyTableData, Integer> secondDataColumn = new TableColumn<MyTableData, Integer>("AGE");
            firstDataColumn.setCellValueFactory(new PropertyValueFactory<MyTableData, String>("name"));
    //        firstDataColumn.setCellValueFactory(new Callback<TableColumn.CellDataFeatures<MyTableData, String>, ObservableValue<String>>(){
    //            @Override
    //            public ObservableValue<String> call(CellDataFeatures<MyTableData, String> p) {
    //                return p.getValue().nameProperty();
            firstDataColumn.setMinWidth(130);
            secondDataColumn.setCellValueFactory(new PropertyValueFactory<MyTableData, Integer>("age"));
            secondDataColumn.setMinWidth(130);
            TableView<MyTableData> table_view = new TableView<MyTableData>();
            table_view.setItems(tableData);
            table_view.getColumns().setAll(firstDataColumn, secondDataColumn);
            final VBox vbox = new VBox();
            vbox.setSpacing(5);
            vbox.setPadding(new Insets(10, 0, 0, 10));
            vbox.getChildren().addAll(label, table_view);
            ((Group) scene.getRoot()).getChildren().addAll(vbox);
            stage.setScene(scene);
            stage.show();
            //(this is where I change my table content with code)
            tableData.get(0).setName("xx Gargoyle xx");
            System.out.println("Testing Done");
    import javafx.beans.property.SimpleStringProperty;
    import javafx.beans.property.StringProperty;
    public class MyTableData{
        private final SimpleStringProperty name;
        private int age;
        public MyTableData(String name, int age) {
            this.name = new SimpleStringProperty(name);
            this.age = age;
        public String getName() {
            return name.get();
        public StringProperty nameProperty(){
            return name;
        public void setName(String name) {
            this.name.set(name);
        public int getAge() {
            return age;
        public void setAge(int age) {
            this.age = age;
    }And thank you very much

  • Search for all words in a table column that any of the words start with a certain letter

    I have products table. Each row has a Description which may have a few words within it. I wanted to know if it's possible to search through it and find all descriptions that have match the search. But, I want it to consider it a match even if it's not the
    first word of the description, but rather the start of any word in the description.
    For example:
    Descriptions
    Nice Casual Gloves(This should show up, and although it's not in the very beginning of the description it's at the beginning of a new word.)
    Nice Dressy Gloves(This should show up, and although it's not in the very beginning of the description it's at the beginning of a new word.)
    Great Dresses (This should show up)
    Fancy Outerwear
    Glasses (This should show up)
    Shoes
    Sheer Stockings (This should not show up because although it has a "g" it's not in the beginning of a word.)
    Boots
    Galoshes (This should show up)
    I would want to search within this list Where Description like 'G%' but I don't want it to only get the descriptions that start with "g" at the beginning of the description, but rather any "g" at the beginning of any word. I do not want
    to get all descriptions that have a "g" somewhere in the word (then I could just do WHERE DESCRIPTION LIKE '%g%'), rather only if it somewhere within the description but at the beginning of any word.
    Thank you so much
    Debra has a question

    The most perfect solution would be to get a CLR routine to either (a) Do a regular expression match, (b) Run a split routine at CLR speeds then do a simple LIKE, or (c) both (a) and (b).  If your requirements grow to handle more and more complex searches,
    you may have to do it that way eventually.
    However, like the other answers, here's a way to do it reasonably well given your current requirements.  You may have to tweak the REPLACE logic if you have frequent OTHER forms of word delimiters.
    Method:  Pull data; add space before and after original text; replace all common word separators other than space with a space (so for example, "(These pretzels)", "He said 'These pretzels are making me thirsty" and so forth would
    be replaced with a space before "The"; then do a Patindex (you could do with just a LIKE also) on the search string prefaced with a space.  Here's an example, stealing from table sys.messages just for ease of demonstration.
    With SampleData as
    Select top 100 *
    , ' ' + Replace(Replace(Replace(Replace(text, '"', ' '), '''', ' '), '/', ' '), '(', ' ') + ' ' as TextPlus
    from sys.messages
    where language_id = 1033
    Select TextPlus
    , patindex('% The%', textplus)
    from SampleData
    where patindex('% The%', textplus) > 1
    Same logic, in the most concise format:
    Select top 100 Text
    from sys.messages
    where language_id = 1033
    and ' ' + Replace(Replace(Replace(Replace(text, '"', ' '), '''', ' '), '/', ' '), '(', ' ') + ' ' like '% the%'

  • Move tables (some with LONG datatypes) across tablespaces in Oracle 9i

    I have a 14GB tablespace which about 3,000 tables (and only tables) in. Only 2.6GB is used so I would like to resize the tablespace to about 3GB initially.
    I moved the tables with "alter table <owner>.<tablename> move tablespace <tablespace>" and this worked for most of the tables but failed on some with this kind of error:
    alter table IFSAPP.COMMAND_SYS_BUFFER_TAB move tablespace IFSAPP_DATA_TEMP
    ERROR at line 1:
    ORA-00997: illegal use of LONG datatypeI then moved the other tables back to the original a little frustrated.
    Further reading suggested exporting and importing the tables is the way to go.
    I prefer the alter table because Oracle manages the lock whilst it moves. If I export and import, the table could change in between, potentially ending with me importing an old copy, couldn't it? [It seems neigh on impossible to guarantee an available window to do much!]
    So I though I could you the alter table move for ALL tables and those that are left, use export/import, to minimise the risk.
    How should I proceed?
    1) Create TEMP_TABLESPACE as 3GB
    2) "alter table ... move tablespace ..." for all tables in ORIGINAL_TABLESPACE to TEMP_TABLESPACE
    3) For the remaining tables, individually:
    a) lock table (not sure how)
    b) export table: exp user/pass tables=tablename file=exp.dmp rows=yes
    c) drop table
    d) create table in TEMP_TABLESPACE*
    e) import table: imp user/pass tables=tablename
    * this means I need to know how to re-create the table. It also means views and indexes and packages are going to become invalid.
    4) drop tablespace ORIGINAL_TABLESPACE
    5) Create ORIGINAL_TABLESPACE as 3GB
    6) "alter table ... move tablespace ..." for all tables in TEMP_TABLESPACE to ORIGINAL_TABLESPACE
    7) For the remaining tables, individually:
    a) lock table (not sure how)
    b) export table: exp user/pass tables=tablename file=exp.dmp rows=yes
    c) drop table
    d) create table in ORIGINAL_TABLESPACE
    e) import table: imp user/pass tables=tablename
    This seems high risk and messy.
    Has anyone advice or tips to make it simpler?
    As it stands I am considering leaving alone, the risks worry me!
    Thanks

    Interesting idea.. so this would create a temporary table in the temporary tablespace.
    Rather than set the default tablespace, can I merely add the tablespace clause?
    COPY FROM user/password@database CREATE TmpTblName TABLESPACE TmpTablespace USING SELECT
    * FROM Table_name;
    Either way - can you confirm for each table, I would need to:
    COPY FROM user/password@database CREATE TmpTblName TABLESPACE temp_tablespace USING SELECT * FROM Table_name;
    At this point all indexes for these will be invalid.
    Drop tablespace ORIGINAL_TABLESPACE
    Create ORIGINAL_TABLESPACE as 3GB
    COPY FROM user/password@database CREATE TblName TABLESPACE original_tablespace USING SELECT * FROM TmpTable_name;
    rebuild any indexes which are unusable.
    recompile any invalid objects

Maybe you are looking for

  • FBL3N : GL Account description

    Hi Gurus I have a problem whereby I need to have GL Account description in every Line Item Display through Tcode FBL3N. As per the requirements from user we need to have GL account description in every line item. Please help me . Suitable answer will

  • Run-Time ALV C ode Required

    Hi I need some help in ALV,i have to create a ALV reports with 1st clmn displaying month frm JAN-DEC.Than on each month I have to do some calculation based on counters,so can any one help me in this regards or plz send me the code for RUN-Time ALV,so

  • How to change the side of the y axis in numbers ?

    I am trying to make a negative only chart (all the x values are negative), thus the y axis has to be on the right, yet it is displayed on the left ! I really need some help please. Thank you !

  • Trex links

    Hi, after making a search with trex I need that the result links not open a new windows. How can I change this links to open the _parent target? thanks in advance, david

  • Strange call from BT

    Just had a strange call from BT on 08000 285 085, asking me if I was moving house.  I said that I wasn't moving.  The man then gave me a "special" number to call if I was moving. Anyone else had this call?  Is this a genuine BT call?