MapInfo Pro

 View Only
  • 1.  Site Mapper

    Posted 02-08-2024 01:16

    Hi Guys, 

    Looking for some novice insight/help into Site Mapper. I have 300+ maps I need to print (which are getting currently produced singularly). Using Site Mapper  I have started down the track of using  <COL#> to display the majority of labels. This is working great. Where I am struggling is - I'm trying to use the smart text 'SMGetTableColumnNamesAndValues' but cannot seem to get it to work.

    I'm wanting to display  table data on a secondary page and I'm hoping that this is the avenue I should be trying to use. 



    ------------------------------
    Duane Roberts
    ------------------------------


  • 2.  RE: Site Mapper

    Employee
    Posted 02-08-2024 02:44
    Edited by Peter Møller 02-08-2024 02:44

    Hi Duane

    Let's start here: How do you want the column names and values to be displayed on the layout?

    The function SMGetTableNameValues should by default return the column names in the first column and the values in another column to the right separated by a tab.

    Are you using it like this in the layout window:

    $mb{SMGetTableNameValues("TableName", 1, "", "", 1)}

    where TableName is the table that you want to list the column names and values from, and 1 is the row.



    ------------------------------
    Peter Horsbøll Møller
    Principal Presales Consultant | Distinguished Engineer
    Precisely | Trust in Data
    ------------------------------



  • 3.  RE: Site Mapper

    Posted 02-08-2024 18:16

    Hi Peter,

    I'm grateful help.

    I'm currently attempting to replicate how MapInfo inserts a browser into a layout via site mapper, similar to the image provided. I'm considering using the syntax $mb{SMGetTableColumnNamesAndValues("test", 1, "", "", 1)}, but I'm unsure if this is correct.

    The reason for this is that my map labels are quite large, so I'm using abbreviated labels for smaller polygons. To achieve this, I require a reference table on a secondary page to retrieve the remaining information.

    I created a table named "test" tried the following $mb{SMGetTableNameValues("test", 1, "", "", 1)}, but encountered error 303.

    I hope this clarifies the situation a bit more.

    Thank you once again.

     



    ------------------------------
    Duane Roberts
    ------------------------------



  • 4.  RE: Site Mapper
    Best Answer

    Employee
    Posted 02-09-2024 01:32

    Hi Duane

    That was odd. The error says that the function doesn't get the right number of parameters but to me, it looks fine.

    I tried it with my example, and I get the values to appear - not looking that great though as my column names are quite different in length which throws off the tabs a bit.

    On the left, you can see the expression, and on the right, the result returned by the function.
    But... if you want to mimic a browser with multiple records, I would suggest using two different functions:
    • SMGetTableColumnNames: This function returns the column names only as a separator divided list.
      • SMGetTableColumnNames(Tab As String, Separator As String, ReturnError As Logical) As String
      • Example: $mb{SMGetTableColumnNames("Cell_Towers", "", 1)}
    • SMGetTableRowValues: This function returns the actual values for a single row in a specific table.
      • SMGetTableRowValues(Tab As String, RowID As Integer, Separator As String, ReturnError As Logical) As String
      • Example: $mb{SMGetTableRowValues("Cell_Towers", 1, "", 1)}

    Here's an example of how this can look. The first is using the function SMGetTableColumnNames. The second is using the functionSMGetTableRowValues, and in the third, you can see the actual expression for the second record in the table

    I can see that using these functions in combination with tabs and new line characters, is a bit dependent on values that are of similar length. Otherwise, they may jump a bit around as you saw in the example above.



    ------------------------------
    Peter Horsbøll Møller
    Principal Presales Consultant | Distinguished Engineer
    Precisely | Trust in Data
    ------------------------------



  • 5.  RE: Site Mapper

    Posted 02-20-2024 16:42

    Thanks Peter,  This worked a treat. Thanks again for your time.



    ------------------------------
    Duane Roberts
    ------------------------------