Importing Data

Another great use of the ITRAS is to use the visual COM interface to provide a visual interface for importing data into RAMS. In many cases when integrating the import function with another application it is done so without a visual interface. As described in the ITRDS section. However by utilising the COM forms of the ITRAS, yo ucan quickly dispaly the import progress to the user with the following screen;


The Code

* Create the ITRAS object
loITRAS = Createobject("itras.RP_ApplicationServer")

* Load the import screen and pass the connection and system codes
loITRAS.OEDITFORM.LoadContainer("RP_IMPORTROUTES", "","RP_ROUTE", "", "", "TEST","LOCAL")

* Set the screen values.
loITRAS.OEDITFORM.ocontainer.txtFile.Value =lcFileName
loITRAS.OEDITFORM.ocontainer.txtXMLNode.Value ="TROUTE"
loITRAS.OEDITFORM.ocontainer.txtIgnoreFields.Value ="CODE"
loITRAS.OEDITFORM.Caption = "Please wait while importing completes.."
loITRAS.OEDITFORM.ocontainer.disableuseroptions(.T.)

* Make the form visible
loITRAS.OEDITFORM.Visible = .t.

* Begin the import
loITRAS.OEDITFORM.ocontainer.cmdStartImport.Click()

Thats all it takes to integrate route imports into other applications


Last Updated: 24/11/2005