![]() |
Telelogic System Architect (steve huntington) | ![]() |
Topic Title: Outputting Matrix Content to Excel Topic Summary: Created On: 24-Jul-2006 00:53 Status: Read Only |
Linear : Threading : Single : Branch |
![]() |
![]()
|
![]() Answer: You need to extract your file from the Data field within the Files table of the encyclopedia. The fields to the Files table are:
The Data field is of the type image (go figure?!). So I'm conjecturing a bitwise transfer from an ADODB Recordset. To view all of the tables within the encyclopedia use the following SQL string: SELECT * FROM INFORMATION_SCHEMA.TABLES To describe a table's schema the SQL string is: SELECT COLUMN_NAME, DATA_TYPE FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME='<Table name here>' Hope this helps. ![]() | |||||||||||
![]() |
|||||||||||
Before I go ahead and write the code myself, does anyone have ideas on how to get SA to output the contents of a Matrix to Excel? I just want a grid of columns and rows that have the X where they have references to each other. Just like viewing a Matrix in SA, but I don't want to have to view it in SA.
Thanks. Dale |
|||||||||||
![]() |
|||||||||||
![]() |
|||||||||||
Never mind, I wrote the code myself. I have another question though:
Does anyone know how to access the usrmatrix file via VBA now that it seems to have migrated into the database in SA 10.4? I know that I can manually export it to a directory, and I have already created the code to read it, but I want to remove that step and be able to read it directly from the database.
What I am trying to achieve is have a macro that pulls up a user form with all the User Matrices in there, and you can select whichever one you want, click a button, and hey presto - an excel version of the matrix. I'm about 95% there - just need to know how to pull the matrix definitions out of the database.
Actually, being able to pull ALL of the matrices out, not just the user ones would be great if anyone knows the vba code for that....
|
|||||||||||
![]() |
|||||||||||
![]() |
|||||||||||
You need to extract your file from the Data field within the Files table of the encyclopedia.
The fields to the Files table are:
The Data field is of the type image (go figure?!). So I'm conjecturing a bitwise transfer from an ADODB Recordset. To view all of the tables within the encyclopedia use the following SQL string: SELECT * FROM INFORMATION_SCHEMA.TABLES To describe a table's schema the SQL string is: SELECT COLUMN_NAME, DATA_TYPE FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME='<Table name here>' Hope this helps. ![]() |
|||||||||||
![]() |
|||||||||||
![]() |
|||||||||||
EXCELLENT!!!!! Thank you so much Duane. I now have a macro that exports the usrmatrx.xml from the encyclopedia and reads it back into a drop down list on a form. You can then select which matrix you want, and press a button, and it gets put into excel.
woot! Thanks again. ![]() |
|||||||||||
![]() |
|||||||||||
![]() |
|||||||||||
Sorry, but why do you want to hack around with SQL when you can simply use the File Manager in the SA Tools menu to export usrmatrx.xml?
|
|||||||||||
![]() |
|||||||||||
![]() |
|||||||||||
sorry again, misread the issue - to extract usrmatrx.xml from the database using vba, try ISAIMF SAFileExport - Function SAFileExport(bsFileName As String, bsOutputFilePathName As String) As IMFERRORCODE. As you probably know, the standard matrices are in Matrix.xml in the SA program folder.
|
|||||||||||
![]() |
FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.