Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeDNN Open Source...DNN Open Source...Module ForumsModule ForumsReportsReportsGenerating reports from XML SQLGenerating reports from XML SQL
Previous
 
Next
New Post
10/9/2007 11:52 AM
 

I am trying to generate my first report using a SQL Query outputting XML & an XSLT transform.

Having looked at the XML generated, there seems to be <DocumentElement><QueryResults><XML_<guid> before the results

Cut from results pane:
<DocumentElement>
  <QueryResults>
    <XML_F52E2B61-18A1-11d1-B105-00805F49916B>&lt;Users Username="aarongclarke"&gt;&lt;Roles Rolename="Newsletter"/&gt;&lt;Roles Rolename="Registered Users"/&gt;&lt;Roles Rolename="Subscribers"/&gt;&lt;/Users&gt;&lt;Users Username="admin"&gt;&lt;Roles

However the code I have doesn't work - can someone please help a newbie with this

Thanks

the query is:

SELECT Username, Rolename FROM Users
JOIN UserRoles ON Users.UserID=UserRoles.UserID
JOIN Roles ON UserRoles.RoleID=Roles.RoleID
ORDER BY Username, Rolename
FOR XML AUTO

and I am using the XSL template:

<?

xml version="1.0" encoding="utf-8"?>
<
xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<
xsl:template match="/*/*/*">
    <
table>
    <
xsl:for-each select="Users">
    <
tr><td><b><xsl:value-of select="@Username"/></b></td></tr>
    <
xsl:for-each select="Roles">
    <
tr><td></td><td><xsl:value-of select="@Rolename"/></td></tr>
    </
xsl:for-each>
    </
xsl:for-each>
    </
table>
    </
xsl:template>
</
xsl:stylesheet>

 
New Post
10/11/2007 4:01 AM
 

Chris, you don't need FOR XML AUTO.
Reports loads the sql query into a System.Data.DataTable and serialize it as XML afterwards.

There is a  Show XML Source link below the query text box.

For a new DNN install, it will return:


<DocumentElement>
  <QueryResults>
    <Username>admin</Username>
    <Rolename>Administrators</Rolename>
  </QueryResults>
  <QueryResults>
    <Username>admin</Username>
    <Rolename>Registered Users</Rolename>
  </QueryResults>
  <QueryResults>
    <Username>admin</Username>
    <Rolename>Subscribers</Rolename>
  </QueryResults>
</DocumentElement>

 
New Post
10/12/2007 6:18 AM
 

Thanks - I need a bit more control over the XML produced than this, so will have to go with another module for this report.

 
New Post
10/18/2007 3:11 PM
 

Sorry that this module won't do what you need. So that we can plan for future features, what kind of control do you need?


Andrew Nurse
DotNetNuke Core Team Member and Reports Module Project Lead
Microsoft Certified Professional Developer

 
New Post
10/18/2007 3:33 PM
 

Chris,

You may want to try XMLdb ... this will accept your SQL XML query and process the XLST.  You can find it at http://www.tressleworks.ca/Downloads/tabid/116/Default.aspx near the bottom of the page. 

Hope this helps.  /Paul.

 
Previous
 
Next
HomeHomeDNN Open Source...DNN Open Source...Module ForumsModule ForumsReportsReportsGenerating reports from XML SQLGenerating reports from XML SQL


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out