Showing posts with label xml. Show all posts
Showing posts with label xml. Show all posts

Wednesday, March 21, 2012

Displaying xml with xslt in RS

Hi,

I've got an xml and an xslt - I want to get that into reporting services. Right now I have a link to the xml file in a 'report', which will open it correctly and format with the xslt. I'd like it to display without going to an external link.

I know how to use an xml datasource, but I need the xslt applied, since it has some nice formatting in it - so i don't think that will work.

I'm trying to report on the results of a scripted ms baseline security analyzer of several servers - the style sheet lets you drill down and has links to the base reports.

Thanks for your help.

There is a way to apply xslt "automagically" in a report definition (check the Data Output tab of the Report Properties dialog) , although unfortunately you would probably have to rework your xslt a bit to use it. The reason is that the xml it is going to be applied to is the data XML of the report itself. You either need to define a report that will supply exactly the xml that you currently have as its data result, or you need to change the XSLT to fit the data xml you *will* get from some report.

The key point heres are "from some report" and "data output of a report". You can't just take any xslt result and display it within a ReportViewer interface. Is that what you are trying to do?

Note that it *is* possible to upload arbitrary files to Report Manager and then link to them, I think. But that's not the same thing as displaying those files within a reportviewer control interface.

>L<

|||

"Note that it *is* possible to upload arbitrary files to Report Manager and then link to them, I think. But that's not the same thing as displaying those files within a reportviewer control interface."

Yes, that sounds like it would be what I'm after - I really just need it there because all of our other reports are there, not because of any RS functionality. Now if I only knew the technical term for this to find it in the manual, I'd be set.

"You either need to define a report that will supply exactly the xml that you currently have as its data result"

Seems like this could work too - I'll have to look into it.

Thanks for your help Lisa.

|||

>>Yes, that sounds like it would be what I'm after - I really just need it there because all of our other reports are there, not because of any RS functionality. Now if I only knew the technical term for this to find it in the manual, I'd be set.

<rofl> Well I don't know the techical term but I can tell you that you upload the file using a button in the Report Manager that says... wait for it... Upload File. You give it a title, it becomes a browseable item in the Report manager interface (unless of course you mark it "hide in list view"), etc.

You can do it programmatically as well, you might want to look at this http://www.sqldbatips.com/showarticle.asp?ID=62 or you can probably use the SOAP API for this as well.

>L<

displaying xml using reporting service web service

I'm using VS2005 web developer. I can't display XML results when using the
render method, although it renders fine.
I'm using the SQL Server 2000 reporting services web service render method
to get a byte array like this:
result = rs.Render(reportPath, format, historyID, devInfo,
parameters, _
credentials, showHideToggle, encoding, mimeType,
reportHistoryParameters, warnings, streamIDs)
This is from the sample at
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/RSPROG/htm/rsp_ref_soapapi_service_lz_6x0z.asp
It works great if I assign HTML4.0 and EXCEL to the "format" variable.
Then I put
response.binarywrite(result)
and it is just fine.
When I try this with the XML format, it creates a file perfectly if I put
Dim stream As FileStream = File.Create("report.xml", result.Length)
but I don't know how to display the xml in a browser.
Response.binarywrite(result) and Response.writefile("report.xml") gives me
an error
The XML page cannot be displayed.
...
Cannot have a DOCTYPE declaration outside of a prolog
I guess because the XML is written inside the html.
I would appreciate any suggestions.
Thanks
BillCorrection - response.writefile(filename) works, but I don't want to have to
create files on the server and clean them up all the time.
Thanks
Bill
"bill" <belgie@.datamti.com> wrote in message
news:ubuEOCnMGHA.2124@.TK2MSFTNGP14.phx.gbl...
> I'm using VS2005 web developer. I can't display XML results when using
> the render method, although it renders fine.
> I'm using the SQL Server 2000 reporting services web service render method
> to get a byte array like this:
> result = rs.Render(reportPath, format, historyID, devInfo,
> parameters, _
> credentials, showHideToggle, encoding, mimeType,
> reportHistoryParameters, warnings, streamIDs)
> This is from the sample at
> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/RSPROG/htm/rsp_ref_soapapi_service_lz_6x0z.asp
> It works great if I assign HTML4.0 and EXCEL to the "format" variable.
> Then I put
> response.binarywrite(result)
> and it is just fine.
> When I try this with the XML format, it creates a file perfectly if I put
> Dim stream As FileStream = File.Create("report.xml", result.Length)
> but I don't know how to display the xml in a browser.
> Response.binarywrite(result) and Response.writefile("report.xml") gives
> me an error
> The XML page cannot be displayed.
> ...
> Cannot have a DOCTYPE declaration outside of a prolog
> I guess because the XML is written inside the html.
> I would appreciate any suggestions.
> Thanks
> Bill
>

Displaying XML Data

There is a requirement that I need to display the XML data stored in
database in one of the report. How can I display this data in Reporting
Services with the color schema similar to IE (elements and attributes in
different colors etc..)?
Thanks,
Live_Love_LaughThe displaying the XML data itself is not an issue. You can pass it to a
custom function (preferebaly located in an external assembly) and apply a XSL
transformation when the report is processed. What makes your task difficult
is the color-coding. Unfortunately, version 1.0 doesn't support HTML markers,
e.g. <b> for bold, <font> etc. To make the task even more difficult textboxes
are rendered as table cells and don't have ids which makes it difficult to
reference them by DHTML.
One thing you can try is exporting the report as XML and associating an XSL
stylesheet in the DataOutput properties which will render the report the way
you want it.
"Live_Love_Laugh" wrote:
> There is a requirement that I need to display the XML data stored in
> database in one of the report. How can I display this data in Reporting
> Services with the color schema similar to IE (elements and attributes in
> different colors etc..)?
> Thanks,
> Live_Love_Laugh
>
>|||I have the same requirement
Did either of you succeed?
If so can you tell me what you did or post an example?
Thanks in advance
"Teo Lachev" wrote:
> The displaying the XML data itself is not an issue. etc
> "Live_Love_Laugh" wrote:
> > There is a requirement that I need to display the XML data stored in
> > database in one of the report. How can I display this data in Reporting
> > Services with the color schema similar to IE (elements and attributes in
> > different colors etc..)?
> >
> > Thanks,
> > Live_Love_Laughsql

Saturday, February 25, 2012

Display XML Hierarchies in Reporting Services

Reply | Reply to Author | Forward | Print | Individual Message | Show
original | Remove | Report Abuse | Find messages by this author
To all,
I have read several posts that say SQL 2005 Reporting Services does not
display hierarchical XML data very well. It must first be flattened.
Is this true?
In my scenario, I capture hierarchical data and store it in an XML
column in a SQL2005 table. Now I need to display it in a Server Side
Report using SQL 2005 Reporting Services. This data will have any
number of descendants that I need to ensure is intact and visible on
the report.
What are my options to get it done?
And if it really can't be done in Reporting Services what other
approach would be worth looking into?
Thanks in advance,
RobI think Asif Sayed has an example on Code Project that may help you. The
dataset is not based on xml data but demonstrates a parent/child
relationship.
http://www.codeproject.com/useritems/RecursiveData.asp
Steve MunLeeuw
"Rob" <rclassen@.IDSTechNet.com> wrote in message
news:1161266421.322891.145750@.i3g2000cwc.googlegroups.com...
> Reply | Reply to Author | Forward | Print | Individual Message | Show
> original | Remove | Report Abuse | Find messages by this author
>
> To all,
> I have read several posts that say SQL 2005 Reporting Services does not
>
> display hierarchical XML data very well. It must first be flattened.
> Is this true?
>
> In my scenario, I capture hierarchical data and store it in an XML
> column in a SQL2005 table. Now I need to display it in a Server Side
> Report using SQL 2005 Reporting Services. This data will have any
> number of descendants that I need to ensure is intact and visible on
> the report.
>
> What are my options to get it done?
>
> And if it really can't be done in Reporting Services what other
> approach would be worth looking into?
>
> Thanks in advance,
>
> Rob
>

Display truncating on SQL Profiler

Greetings,

I am having a problem debugging an XML error we are getting in our production environment because I can't view the entire call to the stored procedure in Profiler. I have successfully traced the error, but when I go to the line with the call to the SP that caused the error, it doesn't show me the entire call. It only shows me the 'exec sproc_name and then the first 16 characters of the XML string parameter that is being passed to the proc. For some reason it's doing this to ONLY the stored procs that have XML parameters...on procs that use standard parameters, it displays the entire call correctly.

I have looked for some type of setting that controls this, but haven't been able to find it. I also have looked through many forums for this issue but to no avail. Does anyone know why this is happening? And, is there a workaround/fix?

Thanks in advance...

SBIs it because it's a text column? Do you see anny other calls using text, ntext or image?

Friday, February 24, 2012

display sql xml result

hi all...
i'm using the command below to get a recodset from a sql2000 in a xml
structure.
select * from tb_perguntas FOR XML RAW
i know that with this command i can get a result like this:.
<Customers CustomerID="ALFKI" CompanyName="Alfreds Futterkiste">
<Orders OrderID="10643" OrderDate="08/25/1997" />
<Orders OrderID="11011" OrderDate="04/09/1998" />
</Customers>
i'm having problems getting this xml string from a ASP page.
i tried:
<%
Dim connObj
Set connObj = Server.CreateObject("ADODB.Connection")
Set rs = Server.CreateObject("ADODB.Recordset")
connObj.ConnectionString = "DRIVER={SQL
Server};SERVER=y;UID=x;PWD=z;DATABASE=h"
connObj.Open
Set rs = connObj.Execute("select * from tb_perguntas FOR XML RAW")
response.write( "rs:" & rs.fields(0).value)
%>
the only thing i want it's display the complete string SQL returned.
please help.
thanks.
please help.
You need to use the ICommandStream interface and not the recordset to get
your XML back. See the documentation for examples.
Also, FOR XML raw gives you no hierarchy in the XML, use the AUTO mode or
EXPLICIT mode instead in 2000 (and the PATH mode in 2005).
Best regards
Michael
"rodrigo" <emaildorodrigo@.yahoo.com> wrote in message
news:%23XeLzaYWGHA.3328@.TK2MSFTNGP02.phx.gbl...
> hi all...
> i'm using the command below to get a recodset from a sql2000 in a xml
> structure.
> select * from tb_perguntas FOR XML RAW
> i know that with this command i can get a result like this:.
> <Customers CustomerID="ALFKI" CompanyName="Alfreds Futterkiste">
> <Orders OrderID="10643" OrderDate="08/25/1997" />
> <Orders OrderID="11011" OrderDate="04/09/1998" />
> </Customers>
> i'm having problems getting this xml string from a ASP page.
> i tried:
> <%
> Dim connObj
> Set connObj = Server.CreateObject("ADODB.Connection")
> Set rs = Server.CreateObject("ADODB.Recordset")
> connObj.ConnectionString = "DRIVER={SQL
> Server};SERVER=y;UID=x;PWD=z;DATABASE=h"
> connObj.Open
> Set rs = connObj.Execute("select * from tb_perguntas FOR XML RAW")
> response.write( "rs:" & rs.fields(0).value)
> %>
> the only thing i want it's display the complete string SQL returned.
> please help.
> thanks.
> please help.
>

display sql xml result

hi all...
i'm using the command below to get a recodset from a sql2000 in a xml
structure.
select * from tb_perguntas FOR XML RAW
i know that with this command i can get a result like this:.
<Customers CustomerID="ALFKI" CompanyName="Alfreds Futterkiste">
<Orders OrderID="10643" OrderDate="08/25/1997" />
<Orders OrderID="11011" OrderDate="04/09/1998" />
</Customers>
i'm having problems getting this xml string from a ASP page.
i tried:
<%
Dim connObj
Set connObj = Server.CreateObject("ADODB.Connection")
Set rs = Server.CreateObject("ADODB.Recordset")
connObj.ConnectionString = "DRIVER={SQL
Server};SERVER=y;UID=x;PWD=z;DATABASE=h"
connObj.Open
Set rs = connObj.Execute("select * from tb_perguntas FOR XML RAW")
response.write( "rs:" & rs.fields(0).value)
%>
the only thing i want it's display the complete string SQL returned.
please help.
thanks.
please help.You need to use the ICommandStream interface and not the recordset to get
your XML back. See the documentation for examples.
Also, FOR XML raw gives you no hierarchy in the XML, use the AUTO mode or
EXPLICIT mode instead in 2000 (and the PATH mode in 2005).
Best regards
Michael
"rodrigo" <emaildorodrigo@.yahoo.com> wrote in message
news:%23XeLzaYWGHA.3328@.TK2MSFTNGP02.phx.gbl...
> hi all...
> i'm using the command below to get a recodset from a sql2000 in a xml
> structure.
> select * from tb_perguntas FOR XML RAW
> i know that with this command i can get a result like this:.
> <Customers CustomerID="ALFKI" CompanyName="Alfreds Futterkiste">
> <Orders OrderID="10643" OrderDate="08/25/1997" />
> <Orders OrderID="11011" OrderDate="04/09/1998" />
> </Customers>
> i'm having problems getting this xml string from a ASP page.
> i tried:
> <%
> Dim connObj
> Set connObj = Server.CreateObject("ADODB.Connection")
> Set rs = Server.CreateObject("ADODB.Recordset")
> connObj.ConnectionString = "DRIVER={SQL
> Server};SERVER=y;UID=x;PWD=z;DATABASE=h"
> connObj.Open
> Set rs = connObj.Execute("select * from tb_perguntas FOR XML RAW")
> response.write( "rs:" & rs.fields(0).value)
> %>
> the only thing i want it's display the complete string SQL returned.
> please help.
> thanks.
> please help.
>|||hi michael, thanks for the reply.
i looked here:
http://support.microsoft.com/kb/272185/EN-US/
[url]http://www.com.it-berater.org/data_access/oledb/interfaces/ICommandStream.htm[/url
]
and there is no example on how to implement this xml return in asp. the
sample is for win32 console applications.
i can return the normal (not xml) search and then manually get the fields
and values form the recordset and set up the nodes adding the "<" "/>" tags,
however if i can already ge the return in xml why bother creating the tags.
i just can't addimit that nobody have done this before..or maybe it's not
htat simple as i think...
"Michael Rys [MSFT]" <mrys@.online.microsoft.com> escreveu na mensagem
news:ew3DUPcWGHA.3492@.TK2MSFTNGP05.phx.gbl...
> You need to use the ICommandStream interface and not the recordset to get
> your XML back. See the documentation for examples.
> Also, FOR XML raw gives you no hierarchy in the XML, use the AUTO mode or
> EXPLICIT mode instead in 2000 (and the PATH mode in 2005).
> Best regards
> Michael
> "rodrigo" <emaildorodrigo@.yahoo.com> wrote in message
> news:%23XeLzaYWGHA.3328@.TK2MSFTNGP02.phx.gbl...
>|||Did you take a look at
http://msdn.microsoft.com/library/d...>
DOandXML.asp
?
Best regards
Michael
PS: You may need to adjust the provider string...
"rodrigo" <emaildorodrigo@.yahoo.com> wrote in message
news:%23SedSHpWGHA.5012@.TK2MSFTNGP05.phx.gbl...
> hi michael, thanks for the reply.
> i looked here:
> http://support.microsoft.com/kb/272185/EN-US/
> [url]http://www.com.it-berater.org/data_access/oledb/interfaces/ICommandStream.htm[/u
rl]
> and there is no example on how to implement this xml return in asp. the
> sample is for win32 console applications.
> i can return the normal (not xml) search and then manually get the fields
> and values form the recordset and set up the nodes adding the "<" "/>"
> tags,
> however if i can already ge the return in xml why bother creating the
> tags.
> i just can't addimit that nobody have done this before..or maybe it's not
> htat simple as i think...
>
>
> "Michael Rys [MSFT]" <mrys@.online.microsoft.com> escreveu na mensagem
> news:ew3DUPcWGHA.3492@.TK2MSFTNGP05.phx.gbl...
>

display sql datas in xml file with stylesheet

hi,
can any one help me in displaying my sql database datas in an xml file and apply stylesheet to that displayed content.

thanks in advance...You have to learn how to write queries with
FOR XML EXPLICIT close.

Read this article for starters.

http://www.topxml.com/sql/for_xml_explicit.asp

Friday, February 17, 2012

Display images ...

Hello,
I have a customstrings.xml file containing the following:
<string id="sidContactDisplayFormat">{0} - {1} - {2}</string>
<string
id="sidContactFormatFields">contact_name,contact_p hone,contact_vip_flag</string>
In the ascx file I have:
DataStore("ContactsQuickFind").SetCustomColumn("co ntact_display",
"sidContactDisplayFormat", "sidContactFormatFields", "sidContactEmptyString")
which is using the field referenced in the customstring file.
then the display is done through a dropdownlist:
<aw:DropdownList ID="ddlContactQuickFind" RunAt="server"
PreserveItems="true" DataBindMode="GetData"
DataSourceName="ContactsQuickFind" DataTextField="contact_display"
DataValueField="contact_id" ItemDataSourceName="Contact"
ItemDataField="contact_id" OnSelectedIndexChanged="DoContinue"
AutoPostBack="true" Width="300">
<asp:ListItem Value="1">sidNoneDecorated</asp:ListItem>
<asp:ListItem Value="0">sidSelectResultCount</asp:ListItem>
</aw:DropdownList>
My question is I want to display the VIP flag instead of the file value in
the display:
<img src="http://pics.10026.com/?src=http://altiris3/AeXHD/images/icnVIP.gif" />
How can I do this?
Thanks
Dominique
I think you got the wrong newsgroup here... this has nothing to do with xml
and databases.
You may want to try one of the more generic xml groups.
Best regards
Michael
"Dominique" <Dominique@.discussions.microsoft.com> wrote in message
news:4C6C5A88-65C1-4A43-8996-4B2846ED0975@.microsoft.com...
> Hello,
> I have a customstrings.xml file containing the following:
> <string id="sidContactDisplayFormat">{0} - {1} - {2}</string>
> <string
> id="sidContactFormatFields">contact_name,contact_p hone,contact_vip_flag</string>
> In the ascx file I have:
> DataStore("ContactsQuickFind").SetCustomColumn("co ntact_display",
> "sidContactDisplayFormat", "sidContactFormatFields",
> "sidContactEmptyString")
> which is using the field referenced in the customstring file.
> then the display is done through a dropdownlist:
> <aw:DropdownList ID="ddlContactQuickFind" RunAt="server"
> PreserveItems="true" DataBindMode="GetData"
> DataSourceName="ContactsQuickFind" DataTextField="contact_display"
> DataValueField="contact_id" ItemDataSourceName="Contact"
> ItemDataField="contact_id" OnSelectedIndexChanged="DoContinue"
> AutoPostBack="true" Width="300">
> <asp:ListItem Value="1">sidNoneDecorated</asp:ListItem>
> <asp:ListItem Value="0">sidSelectResultCount</asp:ListItem>
> </aw:DropdownList>
> My question is I want to display the VIP flag instead of the file value in
> the display:
> <img src="http://pics.10026.com/?src=http://altiris3/AeXHD/images/icnVIP.gif" />
> How can I do this?
> Thanks
> --
> Dominique
|||thanks
Dominique
"Michael Rys [MSFT]" wrote:

> I think you got the wrong newsgroup here... this has nothing to do with xml
> and databases.
> You may want to try one of the more generic xml groups.
> Best regards
> Michael
> "Dominique" <Dominique@.discussions.microsoft.com> wrote in message
> news:4C6C5A88-65C1-4A43-8996-4B2846ED0975@.microsoft.com...
>
>

Display images ...

Hello,
I have a customstrings.xml file containing the following:
<string id="sidContactDisplayFormat">{0} - {1} - {2}</string>
<string
id="sidContactFormatFields"> contact_name,contact_phone,contact_vip_f
lag</str
ing>
In the ascx file I have:
DataStore("ContactsQuickFind").SetCustomColumn("contact_display",
"sidContactDisplayFormat", "sidContactFormatFields", "sidContactEmptyString"
)
which is using the field referenced in the customstring file.
then the display is done through a dropdownlist:
<aw:DropdownList ID="ddlContactQuickFind" RunAt="server"
PreserveItems="true" DataBindMode="GetData"
DataSourceName="ContactsQuickFind" DataTextField="contact_display"
DataValueField="contact_id" ItemDataSourceName="Contact"
ItemDataField="contact_id" OnSelectedIndexChanged="DoContinue"
AutoPostBack="true" Width="300">
<asp:ListItem Value="1">sidNoneDecorated</asp:ListItem>
<asp:ListItem Value="0">sidSelectResultCount</asp:ListItem>
</aw:DropdownList>
My question is I want to display the VIP flag instead of the file value in
the display:
<img src="http://pics.10026.com/?src=http://altiris3/AeXHD/images/icnVIP.gif" />
How can I do this?
Thanks
--
DominiqueI think you got the wrong newsgroup here... this has nothing to do with xml
and databases.
You may want to try one of the more generic xml groups.
Best regards
Michael
"Dominique" <Dominique@.discussions.microsoft.com> wrote in message
news:4C6C5A88-65C1-4A43-8996-4B2846ED0975@.microsoft.com...
> Hello,
> I have a customstrings.xml file containing the following:
> <string id="sidContactDisplayFormat">{0} - {1} - {2}</string>
> <string
> id="sidContactFormatFields"> contact_name,contact_phone,contact_vip_f
lag</s
tring>
> In the ascx file I have:
> DataStore("ContactsQuickFind").SetCustomColumn("contact_display",
> "sidContactDisplayFormat", "sidContactFormatFields",
> "sidContactEmptyString")
> which is using the field referenced in the customstring file.
> then the display is done through a dropdownlist:
> <aw:DropdownList ID="ddlContactQuickFind" RunAt="server"
> PreserveItems="true" DataBindMode="GetData"
> DataSourceName="ContactsQuickFind" DataTextField="contact_display"
> DataValueField="contact_id" ItemDataSourceName="Contact"
> ItemDataField="contact_id" OnSelectedIndexChanged="DoContinue"
> AutoPostBack="true" Width="300">
> <asp:ListItem Value="1">sidNoneDecorated</asp:ListItem>
> <asp:ListItem Value="0">sidSelectResultCount</asp:ListItem>
> </aw:DropdownList>
> My question is I want to display the VIP flag instead of the file value in
> the display:
> <img src="http://pics.10026.com/?src=http://altiris3/AeXHD/images/icnVIP.gif" />
> How can I do this?
> Thanks
> --
> Dominique|||thanks
--
Dominique
"Michael Rys [MSFT]" wrote:

> I think you got the wrong newsgroup here... this has nothing to do with xm
l
> and databases.
> You may want to try one of the more generic xml groups.
> Best regards
> Michael
> "Dominique" <Dominique@.discussions.microsoft.com> wrote in message
> news:4C6C5A88-65C1-4A43-8996-4B2846ED0975@.microsoft.com...
>
>