M
Mike Edgar
This is a follow up to another message i posted before, i can't find the
original thread to reply to so i'll start a new one.
I am delivering reports to my users using OWC10, I use a DataSourceControl
to provide the components with data, the datasource control uses an XML
recordset in mspersist format which is served from an aspx page within the
same site.
I have managed to get the whole thing working, the problem is that for each
component on a page, I get two connections to the URL that provides the
data, this can be very frustrating and is utterly pointless as the data is
the same both times, so what gives ?
Previously, I was particuarly bothered about the cross domain warnings,
because i got a warning for every time the components get data from the URL,
but after much discussion it seems there are two ways to get rid of the
warnings, A) set your site to be a trusted one in the internet options of
the browser B) use RDS
I've decided that i can live with making my users add a trusted site, but
even though i don't see two warnings for each component, the connection is
still being made twice, which i can't live with.
I've looked at KB article Q249805 (
http://support.microsoft.com/?kbid=249805 ) as suggested, during the last
round of posts, by Jim Vita, a helpful bloke from microsoft developer
support, but the code used there has much the same effect. Although it was
using OWC9 rather than 10, when i tweaked the code to make it use OWC10, the
results are the same as my code.
Debugging my script/code I can see that the connection is made where the DSC
adds the recordset AND on the first InsertFieldSet call, i'm guessing that
the first call that requires the component to actually bind to the data
would cause this second connection...
my code is shown below, i have also included the XML that is returned from
my url, in case anyone wants to implement it...
thanks,
Mike
-------8< -----------8< ------------
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
<HEAD>
<title>MakeReport</title>
<meta content="Microsoft Visual Studio .NET 7.1" name="GENERATOR">
<meta content="C#" name="CODE_LANGUAGE">
<meta content="VBScript" name="vs_defaultClientScript">
<meta content="http://schemas.microsoft.com/intellisense/ie5"
name="vs_targetSchema">
<LINK href="monactivestyles.css" type="text/css" rel="stylesheet">
<script language="javascript" src="FilterControls/calendar.js"></script>
<script language="vbscript" src="FilterControls/common.vbs"></script>
</HEAD>
<body leftMargin="1" topMargin="20" MS_POSITIONING="GridLayout">
<form name="Form1" method="post" action="makereport.aspx?ReportID=11"
id="Form1">
<div id="content" onresize="setframesize()" style="MARGIN-LEFT: 5px"
align="left" MS_POSITIONING="FlowLayout">
<OBJECT id="DSC" style="display:none;"
classid="clsid:0002E553-0000-0000-C000-000000000046">
</OBJECT>
<OBJECT id="ReportItem0" style="display:none;"
classid="CLSID:0002E552-0000-0000-C000-000000000046">
</OBJECT>
<SCRIPT language="VBScript">
Sub Window_onLoad()
set DSC = document.DSC
DSC.ConnectionString = "provider=mspersist"
set ReportItem0 = document.ReportItem0
sURL = "MakeData.aspx?ReportItemID=10"
ReportItem0exists = false
for each datamember in DSC.RecordsetDefs
if datamember.Name = "ReportItem0Data" then
ReportItem0exists = true
end if
next
if ReportItem0exists = false then
DSC.RecordsetDefs.AddNew sURL, DSC.Constants.dscCommandFile,
"ReportItem0Data"
end if
set ReportItem0.DataSource = DSC
ReportItem0.DataMember = "ReportItem0Data"
ReportItem0.AutoFit = true
ReportItem0.DisplayToolbar = false
ReportItem0.ActiveView.ExpandDetails =
ReportItem0.Constants.plExpandNever
ReportItem0.ActiveView.TitleBar.Caption = "Locate Unauthorised Software"
ReportItem0.ActiveView.FilterAxis.InsertFieldSet
ReportItem0.ActiveView.FieldSets("Location")
ReportItem0.ActiveView.RowAxis.InsertFieldSet
ReportItem0.ActiveView.FieldSets("Publisher")
ReportItem0.ActiveView.FieldSets("Publisher").Fields(0).Subtotals(1) =
false
ReportItem0.ActiveView.RowAxis.InsertFieldSet
ReportItem0.ActiveView.FieldSets("Product")
ReportItem0.ActiveView.FieldSets("Product").Fields(0).Subtotals(1) =
false
ReportItem0.ActiveView.RowAxis.InsertFieldSet
ReportItem0.ActiveView.FieldSets("M Version")
ReportItem0.ActiveView.FieldSets("M Version").Fields(0).Subtotals(1) =
false
ReportItem0.ActiveView.DataAxis.InsertFieldSet
ReportItem0.ActiveView.FieldSets("Computer Name")
ReportItem0.ActiveView.DataAxis.InsertFieldSet
ReportItem0.ActiveView.FieldSets("Domain")
ReportItem0.ActiveView.DataAxis.InsertFieldSet
ReportItem0.ActiveView.FieldSets("IP")
ReportItem0.ActiveView.DataAxis.InsertFieldSet
ReportItem0.ActiveView.FieldSets("Primary User")
ReportItem0.ActiveView.DataAxis.InsertFieldSet
ReportItem0.ActiveView.FieldSets("Last User")
Dim totComputer_Name
set totComputer_Name = ReportItem0.ActiveView.AddTotal("Count of
Computer Name", ReportItem0.ActiveView.FieldSets("Computer Name").Fields(0),
ReportItem0.Constants.plFunctionCount)
ReportItem0.ActiveView.DataAxis.InsertTotal totComputer_Name
ReportItem0.style.display = "inline"
End Sub 'Window_onLoad()
</SCRIPT>
</div>
</form>
</body>
</HTML>
---------8< ----------------8< -----------------
<?xml version="1.0" encoding="utf-8" ?>
- <xml xmlns:s="uuid:BDC6E3F0-6DA3-11d1-A2A3-00AA00C14882"
xmlns:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882"
xmlns:rs="urn:schemas-microsoft-com:rowset" xmlns:z="#RowsetSchema">
- <s:Schema id="RowsetSchema">
- <s:ElementType name="row" content="eltOnly">
- <s:AttributeType name="Product" rs:number="1" rs:nullable="true"
rs:writeunknown="true">
<s:datatype dt:type="string" rs:dbtype="str" dt:maxLength="255" />
</s:AttributeType>
- <s:AttributeType name="Publisher" rs:number="2" rs:nullable="true"
rs:writeunknown="true">
<s:datatype dt:type="string" rs:dbtype="str" dt:maxLength="255" />
</s:AttributeType>
- <s:AttributeType name="c2" rs:name="M Version" rs:number="3"
rs:nullable="true" rs:writeunknown="true">
<s:datatype dt:type="int" dt:maxLength="4" rsrecision="10"
rs:fixedlength="true" />
</s:AttributeType>
- <s:AttributeType name="c3" rs:name="Computer Name" rs:number="4"
rs:nullable="true" rs:writeunknown="true">
<s:datatype dt:type="string" rs:dbtype="str" dt:maxLength="255" />
</s:AttributeType>
- <s:AttributeType name="Domain" rs:number="5" rs:nullable="true"
rs:writeunknown="true">
<s:datatype dt:type="string" rs:dbtype="str" dt:maxLength="255" />
</s:AttributeType>
- <s:AttributeType name="IP" rs:number="6" rs:nullable="true"
rs:writeunknown="true">
<s:datatype dt:type="string" rs:dbtype="str" dt:maxLength="255" />
</s:AttributeType>
- <s:AttributeType name="c6" rs:name="Primary User" rs:number="7"
rs:nullable="true" rs:writeunknown="true">
<s:datatype dt:type="string" rs:dbtype="str" dt:maxLength="50" />
</s:AttributeType>
- <s:AttributeType name="c7" rs:name="Last User" rs:number="8"
rs:nullable="true" rs:writeunknown="true">
<s:datatype dt:type="string" rs:dbtype="str" dt:maxLength="50" />
</s:AttributeType>
- <s:AttributeType name="Location" rs:number="9" rs:nullable="true"
rs:writeunknown="true">
<s:datatype dt:type="string" rs:dbtype="str" dt:maxLength="255" />
</s:AttributeType>
<s:extends type="rs:rowbase" />
</s:ElementType>
</s:Schema>
- <rs:data>
<z:row Product="KaZaA Media Desktop" Publisher="Sharman Networks" c2="1"
c3="EKLIS" Domain="MONACTIVE" IP="192.168.1.180" c6="administrator"
c7="administrator" />
<z:row Product="Discovery Evaluation" Publisher="Centennial UK Ltd."
c2="4" c3="GRAEMEH" Domain="MONACTIVE" IP="192.168.1.178" c6="graemeh"
c7="graemeh" />
<z:row Product="Kazaa Media Desktop" Publisher="Sharman Networks" c2="2"
c3="MONKEY" Domain="MUPPETS" IP="192.168.1.177" c6="Mike" c7="Mike" />
<z:row Product="Kazaa Media Desktop" Publisher="Sharman Networks" c2="2"
c3="NEELA" Domain="MONACTIVE" IP="192.168.1.189" c6="neela" c7="neela" />
<z:row Product="Kazaa Media Desktop" Publisher="Sharman Networks" c2="2"
c3="RACHELS" Domain="MUPPETS" IP="192.168.1.183" c6="rachel" c7="rachel" />
</rs:data>
</xml>
original thread to reply to so i'll start a new one.
I am delivering reports to my users using OWC10, I use a DataSourceControl
to provide the components with data, the datasource control uses an XML
recordset in mspersist format which is served from an aspx page within the
same site.
I have managed to get the whole thing working, the problem is that for each
component on a page, I get two connections to the URL that provides the
data, this can be very frustrating and is utterly pointless as the data is
the same both times, so what gives ?
Previously, I was particuarly bothered about the cross domain warnings,
because i got a warning for every time the components get data from the URL,
but after much discussion it seems there are two ways to get rid of the
warnings, A) set your site to be a trusted one in the internet options of
the browser B) use RDS
I've decided that i can live with making my users add a trusted site, but
even though i don't see two warnings for each component, the connection is
still being made twice, which i can't live with.
I've looked at KB article Q249805 (
http://support.microsoft.com/?kbid=249805 ) as suggested, during the last
round of posts, by Jim Vita, a helpful bloke from microsoft developer
support, but the code used there has much the same effect. Although it was
using OWC9 rather than 10, when i tweaked the code to make it use OWC10, the
results are the same as my code.
Debugging my script/code I can see that the connection is made where the DSC
adds the recordset AND on the first InsertFieldSet call, i'm guessing that
the first call that requires the component to actually bind to the data
would cause this second connection...
my code is shown below, i have also included the XML that is returned from
my url, in case anyone wants to implement it...
thanks,
Mike
-------8< -----------8< ------------
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
<HEAD>
<title>MakeReport</title>
<meta content="Microsoft Visual Studio .NET 7.1" name="GENERATOR">
<meta content="C#" name="CODE_LANGUAGE">
<meta content="VBScript" name="vs_defaultClientScript">
<meta content="http://schemas.microsoft.com/intellisense/ie5"
name="vs_targetSchema">
<LINK href="monactivestyles.css" type="text/css" rel="stylesheet">
<script language="javascript" src="FilterControls/calendar.js"></script>
<script language="vbscript" src="FilterControls/common.vbs"></script>
</HEAD>
<body leftMargin="1" topMargin="20" MS_POSITIONING="GridLayout">
<form name="Form1" method="post" action="makereport.aspx?ReportID=11"
id="Form1">
<div id="content" onresize="setframesize()" style="MARGIN-LEFT: 5px"
align="left" MS_POSITIONING="FlowLayout">
<OBJECT id="DSC" style="display:none;"
classid="clsid:0002E553-0000-0000-C000-000000000046">
</OBJECT>
<OBJECT id="ReportItem0" style="display:none;"
classid="CLSID:0002E552-0000-0000-C000-000000000046">
</OBJECT>
<SCRIPT language="VBScript">
Sub Window_onLoad()
set DSC = document.DSC
DSC.ConnectionString = "provider=mspersist"
set ReportItem0 = document.ReportItem0
sURL = "MakeData.aspx?ReportItemID=10"
ReportItem0exists = false
for each datamember in DSC.RecordsetDefs
if datamember.Name = "ReportItem0Data" then
ReportItem0exists = true
end if
next
if ReportItem0exists = false then
DSC.RecordsetDefs.AddNew sURL, DSC.Constants.dscCommandFile,
"ReportItem0Data"
end if
set ReportItem0.DataSource = DSC
ReportItem0.DataMember = "ReportItem0Data"
ReportItem0.AutoFit = true
ReportItem0.DisplayToolbar = false
ReportItem0.ActiveView.ExpandDetails =
ReportItem0.Constants.plExpandNever
ReportItem0.ActiveView.TitleBar.Caption = "Locate Unauthorised Software"
ReportItem0.ActiveView.FilterAxis.InsertFieldSet
ReportItem0.ActiveView.FieldSets("Location")
ReportItem0.ActiveView.RowAxis.InsertFieldSet
ReportItem0.ActiveView.FieldSets("Publisher")
ReportItem0.ActiveView.FieldSets("Publisher").Fields(0).Subtotals(1) =
false
ReportItem0.ActiveView.RowAxis.InsertFieldSet
ReportItem0.ActiveView.FieldSets("Product")
ReportItem0.ActiveView.FieldSets("Product").Fields(0).Subtotals(1) =
false
ReportItem0.ActiveView.RowAxis.InsertFieldSet
ReportItem0.ActiveView.FieldSets("M Version")
ReportItem0.ActiveView.FieldSets("M Version").Fields(0).Subtotals(1) =
false
ReportItem0.ActiveView.DataAxis.InsertFieldSet
ReportItem0.ActiveView.FieldSets("Computer Name")
ReportItem0.ActiveView.DataAxis.InsertFieldSet
ReportItem0.ActiveView.FieldSets("Domain")
ReportItem0.ActiveView.DataAxis.InsertFieldSet
ReportItem0.ActiveView.FieldSets("IP")
ReportItem0.ActiveView.DataAxis.InsertFieldSet
ReportItem0.ActiveView.FieldSets("Primary User")
ReportItem0.ActiveView.DataAxis.InsertFieldSet
ReportItem0.ActiveView.FieldSets("Last User")
Dim totComputer_Name
set totComputer_Name = ReportItem0.ActiveView.AddTotal("Count of
Computer Name", ReportItem0.ActiveView.FieldSets("Computer Name").Fields(0),
ReportItem0.Constants.plFunctionCount)
ReportItem0.ActiveView.DataAxis.InsertTotal totComputer_Name
ReportItem0.style.display = "inline"
End Sub 'Window_onLoad()
</SCRIPT>
</div>
</form>
</body>
</HTML>
---------8< ----------------8< -----------------
<?xml version="1.0" encoding="utf-8" ?>
- <xml xmlns:s="uuid:BDC6E3F0-6DA3-11d1-A2A3-00AA00C14882"
xmlns:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882"
xmlns:rs="urn:schemas-microsoft-com:rowset" xmlns:z="#RowsetSchema">
- <s:Schema id="RowsetSchema">
- <s:ElementType name="row" content="eltOnly">
- <s:AttributeType name="Product" rs:number="1" rs:nullable="true"
rs:writeunknown="true">
<s:datatype dt:type="string" rs:dbtype="str" dt:maxLength="255" />
</s:AttributeType>
- <s:AttributeType name="Publisher" rs:number="2" rs:nullable="true"
rs:writeunknown="true">
<s:datatype dt:type="string" rs:dbtype="str" dt:maxLength="255" />
</s:AttributeType>
- <s:AttributeType name="c2" rs:name="M Version" rs:number="3"
rs:nullable="true" rs:writeunknown="true">
<s:datatype dt:type="int" dt:maxLength="4" rsrecision="10"
rs:fixedlength="true" />
</s:AttributeType>
- <s:AttributeType name="c3" rs:name="Computer Name" rs:number="4"
rs:nullable="true" rs:writeunknown="true">
<s:datatype dt:type="string" rs:dbtype="str" dt:maxLength="255" />
</s:AttributeType>
- <s:AttributeType name="Domain" rs:number="5" rs:nullable="true"
rs:writeunknown="true">
<s:datatype dt:type="string" rs:dbtype="str" dt:maxLength="255" />
</s:AttributeType>
- <s:AttributeType name="IP" rs:number="6" rs:nullable="true"
rs:writeunknown="true">
<s:datatype dt:type="string" rs:dbtype="str" dt:maxLength="255" />
</s:AttributeType>
- <s:AttributeType name="c6" rs:name="Primary User" rs:number="7"
rs:nullable="true" rs:writeunknown="true">
<s:datatype dt:type="string" rs:dbtype="str" dt:maxLength="50" />
</s:AttributeType>
- <s:AttributeType name="c7" rs:name="Last User" rs:number="8"
rs:nullable="true" rs:writeunknown="true">
<s:datatype dt:type="string" rs:dbtype="str" dt:maxLength="50" />
</s:AttributeType>
- <s:AttributeType name="Location" rs:number="9" rs:nullable="true"
rs:writeunknown="true">
<s:datatype dt:type="string" rs:dbtype="str" dt:maxLength="255" />
</s:AttributeType>
<s:extends type="rs:rowbase" />
</s:ElementType>
</s:Schema>
- <rs:data>
<z:row Product="KaZaA Media Desktop" Publisher="Sharman Networks" c2="1"
c3="EKLIS" Domain="MONACTIVE" IP="192.168.1.180" c6="administrator"
c7="administrator" />
<z:row Product="Discovery Evaluation" Publisher="Centennial UK Ltd."
c2="4" c3="GRAEMEH" Domain="MONACTIVE" IP="192.168.1.178" c6="graemeh"
c7="graemeh" />
<z:row Product="Kazaa Media Desktop" Publisher="Sharman Networks" c2="2"
c3="MONKEY" Domain="MUPPETS" IP="192.168.1.177" c6="Mike" c7="Mike" />
<z:row Product="Kazaa Media Desktop" Publisher="Sharman Networks" c2="2"
c3="NEELA" Domain="MONACTIVE" IP="192.168.1.189" c6="neela" c7="neela" />
<z:row Product="Kazaa Media Desktop" Publisher="Sharman Networks" c2="2"
c3="RACHELS" Domain="MUPPETS" IP="192.168.1.183" c6="rachel" c7="rachel" />
</rs:data>
</xml>