473,657 Members | 2,598 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 1049

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

Similar topics

24
4181
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 have is this: The "primary" or "source" table is easy. This is a trial balance (account number as a primary key, description, amount). I'll need table(s) to denote which account numbers belong to which
10
2793
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 this. www.teledna.com Regards, Minchu
3
4944
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/ I want the datalist do display only the first row of the table. But it always fails. tried for exemple: dim nrowpos as ingeger 'shows the current rowposition dim dv as dataview
1
3123
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 simplest it works - if I define the datasource for the grid to be 'reportListView' and use autogenerate columns then I get all columns of the view appearing when the page is viewed. However I now want to restrict the number of columns to be...
1
3143
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 dataset. Afterwards when the sorted data is required, i use the Dataview's sort method and sort the data. This sorted data is perfectly shown in the datagrid. Now i want this data to be shown in my crystal report object too. Its not working!!! Can...
18
3338
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 columns, "scode" and "sname", as 1 column (if not possible then 2 columns will be fine) in the listbox. Can the listbox display 2 columns information from the dataset and how can I do that? Also, I set the property of the listbox to selectionmode...
3
12911
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 works fine, however once the stored procedures were put into a subreport, it cause an exception: "Missing parameter field current value"
3
2875
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 :) Anyways, I am creating a website where I have a database of pet listings in california. Each record lists the Type of Listing (eg. dog grooming or vet) the the Area it is in (so state, county etc.), a Name, Description, and Address. I created a search...
1
3563
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 other combo box. I already know one way to make this work using two DataTables and a DataView, and handling the SelectionChangeCommitted event of the parent ComboBox so that it sets the .RowFilter of the DataView to which the child ComboBox is...
0
8425
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8743
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8522
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
6177
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5647
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4173
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4333
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2745
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 we have to send another system
2
1973
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.