473,503 Members | 1,638 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Display a report links listing in dataview ASP.NET using C#

1 New Member
What I'm trying display is after the user chooses the product (1st category) from a dropdown, then the dataview will display;

The category

any reports under that

subcategory

any reports under that

any other sub categories involved with the product first category

All I'm able to get so far is after choosing from the drop down, the categories 1st layer. I'm not sure how to code to get the reports under each category and the code to do so.
I am working on web page that display reports from an XML file so the user can click a link and open a report. The problem I'm having is I able to get to the first catagory but do not know how to code to get to the report attribute. The following is the short version of the XML file;
Expand|Select|Wrap|Line Numbers
  1.  
  2. <?xml version="1.0" standalone="yes"?> 
  3. <CommercialCardReports xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  4.  
  5. <CommercialCardReportCategory CategoryId="665" Name="Gray Data Feeds"/> 
  6. <CommercialCardReportCategory CategoryId="1" Name="Canada">
  7.  
  8. <CommercialCardReport ReportId="881" Name="CAN-THD0010 - THD Naps Error Letters" HasArchiveFlag="true" Directory="D:/reports/CAN-THD0010" FileName="naps_errors.xls"/> 
  9. <CommercialCardReportCategory CategoryId="2" Name="HDCS">
  10.  
  11. <CommercialCardReportCategory CategoryId="3" Name="External Status Change Reports"> 
  12. <CommercialCardReport ReportId="4" Name="CAN-CRD0880A - Canada" HasArchiveFlag="true" Directory="D:/reports/CAN-CRD0880A" FileName="Canada_THDCRCStatusChange.xls"/>
  13.  
  14. </CommercialCardReportCategory> 
  15. </CommercialCardReportCategory>
  16.  
  17. <CommercialCardReportCategory CategoryId="663" Name="PROX Reports"> 
  18. <CommercialCardReport ReportId="807" Name="CAN-PRD70246 - THD PROX Canada Inquires" HasArchiveFlag="true" Directory="D:/reports/CAN-PRD70246" FileName="thdcanada_inq.xls"/>
  19.  
  20. </CommercialCardReportCategory> 
  21. <CommercialCardReportCategory CategoryId="21" Name="RPL">
  22.  
  23. </CommercialCardReportCategory> 
  24. </CommercialCardReportCategory>
  25.  
  26. </CommercialCardReports>
  27.  
  28. The following what I have in the aspx page;
  29.  
  30. <asp:XmlDataSource ID="XmlDataSource1" runat="server" DataFile="~/App_Data/Reports.xml"
  31. XPath="/CommercialCardReports/CommercialCardReportCategory">
  32. </asp:XmlDataSource>
  33.  
  34. <asp:DropDownList ID="productDropDownList" runat="server" 
  35. AppendDataBoundItems="True" AutoPostBack="True" DataSourceID="XmlDataSource1" 
  36.  
  37. DataTextField="Name" DataValueField="CategoryId" 
  38. onselectedindexchanged="productDropDownList_SelectedIndexChanged">
  39. <asp:ListItem Selected="True">--Select Product--</asp:ListItem>
  40. </asp:DropDownList>
  41.  
  42. <asp:DataList ID="DataList1" runat="server" DataSourceID="XmlDataSource2" 
  43. Visible="False" BorderStyle="Solid" BorderWidth="2px">
  44. <ItemTemplate>
  45. <asp:Label ID="categoryId" Visible="false" runat="server" Text='<%# Eval("CategoryId") %>'></asp:Label><br />
  46. <asp:Label ID="name" runat="server" Text='<%# Eval("Name") %>'></asp:Label><br />
  47. </ItemTemplate>
  48. </asp:DataList><br />
  49.  
  50. <asp:XmlDataSource ID="XmlDataSource2" runat="server" DataFile="~/App_Data/Reports.xml"
  51. XPath="/CommercialCardReports/CommercialCardReportCategory/CommercialCardReportCategory">
  52. </asp:XmlDataSource>
  53.  
And this what I have in the code behind;
Expand|Select|Wrap|Line Numbers
  1.  
  2. protected void productDropDownList_SelectedIndexChanged(object sender, EventArgs e) 
  3. {
  4. String CategoryId = (String)productDropDownList.SelectedItem.Value; 
  5. XmlDataSource2.XPath = String.Format("/CommercialCardReports/CommercialCardReportCategory[@CategoryId='{0}']/CommercialCardReportCategory", CategoryId);
  6. DataList1.Visible = true; 
  7. }
  8.  
I would appreciate any help I can get thank you.........
Jul 21 '08 #1
0 1036

Sign in to post your reply or Sign up for a free account.

Similar topics

24
4143
by: Michael Malinsky | last post by:
I'm attempting to create a database which will take information from one (perhaps two) tables and utilize that information to return queries to a report designed in Excel. The general idea I...
10
2783
by: minchu | last post by:
Hello, I have used CSS in HTML page (font-verdana size-8pt), looks fine in windows but in linux the fonts are corrupt and its too small. Kindly help me and tell what is the solution to correct...
3
4915
by: olle | last post by:
Hi everyone. Beging a newbee to asp.net and used to work with traditional asp I have one problem working with a datalist. 1/ I make a dataset as as session variable like session("employees") 2/...
1
3117
by: Robert | last post by:
This is a repost from the other dotnet.csharp forum: I'm including a simple datagrid control on my web form. I have created a Dataview (reportListView) onto a data table to populate it. At its...
1
3128
by: saima ashraf | last post by:
Hi, I am trying to sort the data in my crystal report at runtime. The problem is that i can only query the database once and that is at the loading of the report. At that time i fill up my...
18
3321
by: Alpha | last post by:
Hi, I'm working on a Windows applicaton with VS 2003 on windows 2000. I have a listbox that I have binded to a dataset table, "source" which has 3 columns. I would like to display 2 of those...
3
12907
by: kenneth xg | last post by:
Hi, I have problem on passing parameters to subreports' stored procedures which require parameters, from an asp.net web form. I ve tried to use the stored procedures on the main report it...
3
2870
by: WiseG1rly | last post by:
Hey everyone! I am completley new and I will start off by saying that I am not a programmer - figuring out this search took so long! I am debugging now and would appreciate any help :) ...
1
3556
by: Bob Johnson | last post by:
..NET 3.5, Windows Forms app: My objective is to display parent/child data in two ComboBox controls, such that when a parent item is selected in one combo box, associated child items appear in the...
0
7086
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
1
6991
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5578
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5014
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3167
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3154
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1512
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
736
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
382
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.