Exporter - What Data Is Posted |
What exactly is posted to your page and the format of the data depends on the Http Post Mode you choose.
The options are:
•Post each record individually •Post all records in a single HTTP Post •Upload XML file containing all records •Upload Zipped XML file containing all records
There are sample files installed with the application showing all these options being used.
The details of what's posted and the format of the data for each of these options is outlined below. for a complete list of Sage tables that can be exported and their fields see Sage Tables
The following text assumes you have left the original Sage field names unaltered, if you have altered the field names using alias's you need to take this into account in any code you use in your page.
Common The following post parameters are always include regardless which Http Post Mode is used.
Post each record individually The following post parameters are include when Http Post Mode = Post each record individually
Post all records in a single HTTP Post The following post parameters are include when Http Post Mode = Post all records in a single HTTP Post
This can seem quite complex the first time you read this, a useful aid to understanding the structure of the posted data is to see it at runtime, what to do is create a page with some code to output the post parameter names & values, then run an export targeting this page, if you select "Display the page after export" option you will see the names of posted parameters and their values printed out on the page.
Sample Code to output the parameter names & values:
VB.NET For Each Item As String In Request.Form Response.Write(Item & "=" & Request.Form(Item) & "<br>") Next
C#.NET foreach (string Item in Request.Form) { Response.Write(Item + "=" + Request.Form[Item] + "<br>"); }
ASP VBScript For Each Item In Request.Form Response.Write(Item & "=" & Request.Form(Item) & "<br>") Next
An alternative method for .NET pages is to enable tracing on the page, simply add:
Trace="true"
to the page directive tag, when the page is run .NET will output all the tracing information into the pages output including all posted form parameters & their values.
Upload XML file containing all records This option uploads an XML file containing all the export data to the page, assuming you have not altered the file name expression the file name will be:
{category}-{jobname}.xml where {category} will be replaced with the job category name and {jobname} replaced with the job name, for example:
MyCategory-MyJob.xml
The layout of the uploaded XML file is 100% compatible with the .NET DataSets ReadXML and WriteXML methods, in fact the file is created using WriteXML, a basic sample of the file contents is shown below, only 2 products and 2 customer records have been exported to generate this sample.
<?xml version="1.0" standalone="yes"?> <SageData> <PrimaryKeys> <Table>STOCK</Table> <KeyColumn>STOCK_CODE</KeyColumn> </PrimaryKeys> <PrimaryKeys> <Table>SALES_LEDGER</Table> <KeyColumn>ACCOUNT_REF</KeyColumn> </PrimaryKeys> <STOCK> <DESCRIPTION>Calculator - Desktop</DESCRIPTION> <SALES_PRICE>10</SALES_PRICE> <STOCK_CODE>CALC001</STOCK_CODE> </STOCK> <STOCK> <DESCRIPTION>Calculator - Pocket</DESCRIPTION> <SALES_PRICE>6</SALES_PRICE> <STOCK_CODE>CALC002</STOCK_CODE> </STOCK> <SALES_LEDGER> <ACCOUNT_REF>A1D001</ACCOUNT_REF> <NAME>A1 Design Services</NAME> <TELEPHONE>01742 876 234</TELEPHONE> </SALES_LEDGER> <SALES_LEDGER> <ACCOUNT_REF>ABS001</ACCOUNT_REF> <NAME>ABS Garages Ltd</NAME> <TELEPHONE>0191 254 5909</TELEPHONE> </SALES_LEDGER> </SageData>
Please note that the primary key information is only included for those sage tables containing a dedicated primary key column.
Upload Zipped XML file containing all records This option is the same as the Upload XML file containing all records option, the only difference is the XML file is zipped into a zip archive called the same name as the XML file and the zip archive is uploaded, depending on the server platform used special components may be required to un-zip the file server side.
|