3.2.0

Results from XML Template Query to SQL Server are not processing.

I am trying to load the grid using an XML result set returned from SQL server.

My XML Template looks like:

<samplist xmlns:sql="urn:schemas-microsoft-com:xml-sql">
<sql:header>
<sql:param name='sampid'>%</sql:param>
</sql:header>
<sql:query>
Select
isnull(BATCH,0) as Batch,
isnull(CODE,0) as Code,
isnull(FARMNAME,0) as Farm,
isnull(describe,0) as Description
FROM data_samples
WHERE client_id = '2' AND return_dtm between '3/15/2005
10:06:34 AM' AND '4/15/2005 10:06:34 AM'
ORDER BY Batch DESC, code, sampleid
FOR XML AUTO, ELEMENTS
</sql:query>
</samplist>


It returns:

<samplist xmlns:sql="urn:schemas-microsoft-com:xml-sql">
<data_samples>
<Batch>4787</Batch>
<Code>55</Code>
<Farm>BAYOU VISTA</Farm>
<Description>TMR PO</Description>
</data_samples>
<data_samples>
<Batch>4787</Batch>
<Code>115</Code>
<Farm>JOE PACHECO #2</Farm>
<Description>NEW CORN SILAGE</Description>
</data_samples>
</samplist>


I am calling it with the following code:

var table = new Active.XML.Table;
table.setURL("/cvas/templates/samplelist.xml");
table.request();
var columns = ["Batch", "Code", "Farm", "Desc"];
var obj = new Active.Controls.Grid;
obj.setColumnProperty("texts", columns);
obj.setDataModel(table);
document.write(obj);


I get the grid returned with no rows of Data.

If on the other hand.... I save the XML results from the query to a static file, and use the following code:

var table = new Active.XML.Table;
table.setURL("samplelist.xml");
table.request();
var columns = ["Batch", "Code", "Farm", "Desc"];
var obj = new Active.Controls.Grid;
obj.setColumnProperty("texts", columns);
obj.setDataModel(table);
document.write(obj);


The Grid Generates with no Problems.

I have already checked to make sure that the web server is returning the correct MIME type, text/XML, and calling the XML template as an http: request doesn't seem to have any effect.

Please Help!

Thanks,

John B. Reeher
www.agmodels.com
John
April 15,

I found the problem, I am using hte firefox browser v1.03 my .js file was crashing, and I was capturing the error back, subsequently it was also crashing the browser.
John
April 18,
There is a problem with Firefox 1.0.3 (XML only, CSV and JS work fine) which I am investigating currently.
Alex (ActiveWidgets)
April 18,

This topic is archived.

See also:


Back to support forum