Reply
 
LinkBack Thread Tools Display Modes
Old 07-10-2011, 11:28 AM   #1 (permalink)
Member
 
Join Date: Apr 2011
Posts: 32
engcosta is on a distinguished road
Default why subreport not appear in main report

i made a report that show me installation hours for every item and then i made a sub report that show me total hours in every phase but when i try to run main report its show me the sub report like this

and the sub report look like this

so i should run the sub report every time i start d-tools to make the main report include the hole sub report and look like this


i need to run the main report only to show me the hole sub report without need to run sub report first
engcosta is offline   Reply With Quote
Old 07-11-2011, 09:46 AM   #2 (permalink)
Member
 
Join Date: Apr 2011
Posts: 32
engcosta is on a distinguished road
Default

I used this code to sort item in sub report by phase to not be override by main report grouping criteria

Quote:
Sub SortItemsByPhase()

ds = rpt.DataSource
doc = ds.Document
xmlRoot = doc.DocumentElement


xmlns = ReportingNamespaceUtility.ReturnXMLNamespaceManage r(doc.NameTable)

Dim xmlItemsRootNode As XmlNode = xmlRoot.SelectSingleNode("//dtr:Items",xmlns)

Dim xmlNodeList As XmlNodeList = xmlRoot.SelectNodes("//dtr:Items/dtr:Item",xmlns)
Dim zones As New List(Of String)

Dim zoneDict As New Dictionary(Of String, List(Of XmlNode))
Dim keys As New List(Of String)

For Each node As XmlNode In xmlNodeList

Dim zone As String = node.SelectSingleNode("dtr:Phase",xmlns).InnerText

If(zoneDict.ContainsKey(zone)) Then

Dim xmlNodes As List(Of XmlNode) = zoneDict(zone)
xmlNodes.Add(node)

Else
keys.Add(zone)
Dim xmlNodes As New List(Of XmlNode)
xmlNodes.Add(node)
zoneDict.Add(zone, xmlNodes)
End If

Next

keys.Sort()

xmlItemsRootNode.RemoveAll()

For Each key As String in keys

Dim xmlNodes As List(Of XmlNode) = zoneDict(key)

For Each node2 As XmlNode in xmlNodes

xmlItemsRootNode.AppendChild(node2)

Next

Next

ds.Document.Save(ds.FileURL)

Dim xmlDS As New DataDynamics.ActiveReports.DataSources.XMLDataSour ce(ds.FileURL, ds.RecordsetPattern)
rpt.DataSource = xmlDS

xmlDS.LoadXML(xmlDS.Document.OuterXml)

'reset the Xml Document
ReportUtilities.SetXMLDocument(xmlDS.Document)

End Sub
engcosta is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 09:47 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.3.0
D-Tools, Inc.