Results 1 to 9 of 9
  1. #1
    Join Date
    Jan 2005
    Posts
    5

    Unanswered: linkfields acces in paradox 7

    Hello everybody,
    sorry for my english but I would like to do my best.

    I work on paradox7 and i need to export the data contain in a lot of report to XML files.

    To do this I make a script for one of my report and he work well.
    But i want to do a script who export automatically any report in my db (there is at least 50 reports)
    My problem is that:
    in some report i got my master table (master) who is link to a other table (employee) with the employee id.
    But in my report i use more than one employee to get their first and last name.

    when i use the method enumDataModel i got something like this

    table name------propertyname--------propertyvalue

    master---------one to one------------employee
    *
    *
    *
    employee-------parent-----------------master
    employee-------linktype---------------one to one
    employee-------linkfiels----------------id,id
    *
    *
    *
    employee1------parent----------------master
    employee1------linktype---------------one to one
    employee1------linkfiels----------------id2,id
    *
    *
    *



    But when i take the properties of the report with enumuiobject:
    the properties of the field of the first name for the two employee are the same like employee.Name[] with no information on the linkfields.
    And thus i cant know which id i must take to get the data of the employee.

    If someone can understand me and (I can dream sometimes ) help me it would be great.
    Last edited by biau; 01-10-05 at 10:42.

  2. #2
    Join Date
    Aug 2003
    Location
    Bologna - Italy
    Posts
    209
    I suppose that you have a field "firstname" and a field "lastname" in your employee table.

    If it's like that, you DON'T NEED to link the employee table two times: it is an error, and you should link the table only once, and then create two different field object on the report, then right click on one of them and select Define field and select the firstname field, and repeat for the other selecting the lastname field.

    If, instead, you really need to link two times the employee table, that would happen if you need to show data that come from two DIFFERENT employees at a time: suppose you have a master table which lists marriages, so you'll have a field "ID1" which contains the id of the husband and another field "ID2" wich contains the id of the wife.

    In this situation is correct having linked two times the employee table, but the two tables are showing different employees: one is the "husbands" table, and th other is the "Wives" table...

    So you should simply decide if you're interested in husbands or wives!
    The only failure is not trying to do it.

  3. #3
    Join Date
    Jan 2005
    Posts
    5
    Thanks for trying to help me!
    I really need to link two times the employee table but i got only one employee table.

    example: (sorry this example is very ridiculous but good for understanding)
    my master table contain a date and hour when two employee must do the coffee (yes the must be two for do this in my example)
    in my master table i got 4 attributes:

    date/ hour/ idemployee1/ idemployee2

    And i do a report for print it and put it on the wall in front of the coffee machine.

    Thus my report contain two employee and the relational model is like this in paradox:

    ---master (date/hour)
    ||
    ||
    ||->employee (link on idemployee1=id) (first,last)
    |-->employee1 (link on idemployee2=id) (first,last)

    And i dont understand where i can find information on the links between master and employee/employee1 (employee and employee1 are the same table but paradox rename it in the relational model)
    These information is not accessible in the information of relational model taking with the function enumDataModelof the report or in the properties of the object that i find with enumuiobjects

    ouf...i do my best to explain

  4. #4
    Join Date
    Aug 2003
    Location
    Bologna - Italy
    Posts
    209
    I don't understand why you say that EnumDataModel doesn't tell you what you need...

    In the rows you have posted at the top of the thread you see very well what's the link:

    employee --- parent ---- master

    Tells you that employee is a child of master (and the same happens also for employee1) and

    employee --- linkfields --- id,id

    tells that master field id is linked to employee field id, as

    employee1 --- linkfields --- id2,id

    tells that master field id2 is linked to employee1 field id.

    What other info do you need that you don't find here?
    The only failure is not trying to do it.

  5. #5
    Join Date
    Jan 2005
    Posts
    5
    yes enumdatamodel give me all what i need.
    But i cant link it to the properties of the fields in my report, because when i take the properties for the fields of the firstname (for example) for my two employees, the value of the fields are the same:

    employee.fname

    and i have no trace of employee1

  6. #6
    Join Date
    Aug 2003
    Location
    Bologna - Italy
    Posts
    209
    ? Are you sure that you're reading the correct field object properties ?

    I've tried inserting a table in a report data model, giving it a table alias and inserting in the report a field from that table; what i see is that the report field tablename property shows the table alias i wrote in the data model window, and that's the same table alias you find in the first field of the enumdatamodel output...

    How are you trying to read the properties of the uiobject?

    Please post the objectpal code snippet...
    The only failure is not trying to do it.

  7. #7
    Join Date
    Jan 2005
    Posts
    5
    Code:
    method run(var eventInfo Event)
    var
    
    state 		report
    
    
    endvar
    
    
    state.load("stef_test_state.rsl")
    
    state.enumUIObjectProperties("_properties_temp.db")
    state.enumDataModel("_model_temp.db")
    
    
    
    endMethod
    In _model_temp.db i found employee and employee1 table with linkfields
    but in _properties_temp.db i only found employee....

  8. #8
    Join Date
    Aug 2003
    Location
    Bologna - Italy
    Posts
    209
    I'm using Paradox 10, but i correctly see the Table Aliases used in the data model in the table _properties_temp.db produced with the code snippet you posted...

    Have you tried looking in Bertil Isberg paradox bug list ( http://www.swebug.se/sig/sig_par/index.htm ) to see if this is a bug of your version of paradox?

    And are you really sure you're looking at the correct record in _properties_temp?
    The only failure is not trying to do it.

  9. #9
    Join Date
    Jan 2005
    Posts
    5
    yes i m reallly sure because there is no record who contain employee1
    But i m under paradox 7
    and i in a few day i would have paradox 11

    perhaps that will solve my problem...
    I keep you informed
    and thanks a lot for your help

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •