treeview 1.1 help


R

RobKaratzas

if there's anyone out there whos:

1. using .net v1.1 VB
2. using the MS v1.x webcontrols
3. loading the treeview control from an XML file
4. and figured out how to load .aspx's into an iframe on node clicks

please e-mail me, been tearing my hair out on this one.

works fine under Mozilla, Firefox, but I'm having to click the treeview
node TWICE under IE to get the iframe to load with the form?


Just replace the Group?Report?.aspx in UIReports.XML with any .aspx form you
have.

full system has 75+ reports and used SQL Server Reporting Services (fully
operational, other than this issue...)

greatly appreciated
rob

=====================

Treeview Project

<VisualStudioProject>
<VisualBasic
ProjectType = "Web"
ProductVersion = "7.10.3077"
SchemaVersion = "2.0"
ProjectGuid = "{07F4EEAF-BE00-4FC9-A8E8-A8298A618186}"<Build>
<Settings
ApplicationIcon = ""
AssemblyKeyContainerName = ""
AssemblyName = "Treeview"
AssemblyOriginatorKeyFile = ""
AssemblyOriginatorKeyMode = "None"
DefaultClientScript = "JScript"
DefaultHTMLPageLayout = "Grid"
DefaultTargetSchema = "IE50"
DelaySign = "false"
OutputType = "Library"
OptionCompare = "Binary"
OptionExplicit = "On"
OptionStrict = "Off"
RootNamespace = "Treeview"
StartupObject = ""<Config
Name = "Debug"
BaseAddress = "285212672"
ConfigurationOverrideFile = ""
DefineConstants = ""
DefineDebug = "true"
DefineTrace = "true"
DebugSymbols = "true"
IncrementalBuild = "true"
Optimize = "false"
OutputPath = "bin\"
RegisterForComInterop = "false"
RemoveIntegerChecks = "false"
TreatWarningsAsErrors = "false"
WarningLevel = "1"
/>
<Config
Name = "Release"
BaseAddress = "285212672"
ConfigurationOverrideFile = ""
DefineConstants = ""
DefineDebug = "false"
DefineTrace = "true"
DebugSymbols = "false"
IncrementalBuild = "false"
Optimize = "true"
OutputPath = "bin\"
RegisterForComInterop = "false"
RemoveIntegerChecks = "false"
TreatWarningsAsErrors = "false"
WarningLevel = "1"
/>
</Settings>
<References>
<Reference
Name = "System"
AssemblyName = "System"
/>
<Reference
Name = "System.Data"
AssemblyName = "System.Data"
/>
<Reference
Name = "System.Drawing"
AssemblyName = "System.Drawing"
/>
<Reference
Name = "System.Web"
AssemblyName = "System.Web"
/>
<Reference
Name = "System.XML"
AssemblyName = "System.Xml"
/>
<Reference
Name = "Microsoft.Web.UI.WebControls"
AssemblyName = "Microsoft.Web.UI.WebControls"
HintPath = "bin\Microsoft.Web.UI.WebControls.dll"
/>
</References>
<Imports>
<Import Namespace = "Microsoft.VisualBasic" />
<Import Namespace = "System" />
<Import Namespace = "System.Collections" />
<Import Namespace = "System.Configuration" />
<Import Namespace = "System.Data" />
<Import Namespace = "System.Drawing" />
<Import Namespace = "System.Web" />
<Import Namespace = "System.Web.UI" />
<Import Namespace = "System.Web.UI.HtmlControls" />
<Import Namespace = "System.Web.UI.WebControls" />
</Imports>
</Build>
<Files>
<Include>
<File
RelPath = "AssemblyInfo.vb"
SubType = "Code"
BuildAction = "Compile"
/>
<File
RelPath = "Global.asax"
BuildAction = "Content"
/>
<File
RelPath = "Global.asax.vb"
DependentUpon = "Global.asax"
SubType = "Code"
BuildAction = "Compile"
/>
<File
RelPath = "Global.asax.resx"
DependentUpon = "Global.asax.vb"
BuildAction = "EmbeddedResource"
/>
<File
RelPath = "ReportGroupingHelp.aspx"
BuildAction = "Content"
/>
<File
RelPath = "ReportGroupingHelp.aspx.vb"
DependentUpon = "ReportGroupingHelp.aspx"
SubType = "ASPXCodeBehind"
BuildAction = "Compile"
/>
<File
RelPath = "ReportGroupingHelp.aspx.resx"
DependentUpon = "ReportGroupingHelp.aspx.vb"
BuildAction = "EmbeddedResource"
/>
<File
RelPath = "Reports.aspx"
BuildAction = "Content"
/>
<File
RelPath = "Reports.aspx.vb"
DependentUpon = "Reports.aspx"
SubType = "ASPXCodeBehind"
BuildAction = "Compile"
/>
<File
RelPath = "Reports.aspx.resx"
DependentUpon = "Reports.aspx.vb"
BuildAction = "EmbeddedResource"
/>
<File
RelPath = "Styles.css"
BuildAction = "Content"
/>
<File
RelPath = "Treeview.vbproj.webinfo"
BuildAction = "None"
/>
<File
RelPath = "Web.config"
BuildAction = "Content"
/>
</Include>
</Files>
</VisualBasic>
</VisualStudioProject>

=========================

UIReports.XML

<TREENODES>
<treenode Text="MyReportGroup1" Type="Group" Target="doc"
NavigateURL="./ReportGroupingHelp.aspx?id=1">
<treenode Text="Group1 Report1" Type="Report" Target="doc"
NavigateURL="./Group1Report1.aspx?id=1"/>
<treenode Text="Group1 Report2" Type="Report" Target="doc"
NavigateURL="./Group1Report2.aspx?id=2"/>
<treenode Text="Group1 Report3" Type="Report" Target="doc"
NavigateURL="./Group1Report3.aspx?id=3"/>
<treenode Text="Group1 Report4" Type="Report" Target="doc"
NavigateURL="./Group1Report4.aspx?id=4"/>
</treenode>
<treenode Text="MyReportGroup2" Type="Group" Target="doc"
NavigateURL="./ReportGroupingHelp.aspx?id=2">
<treenode Text="Group2 Report1" Type="Report" Target="doc"
NavigateURL="./Group2Report1.aspx?id=5"/>
<treenode Text="Group2 Report2" Type="Report" Target="doc"
NavigateURL="./Group2Report2.aspx?id=6"/>
</treenode>
</TREENODES>

==========================
Reports.aspx

<%@ Register TagPrefix="ie" Namespace="Microsoft.Web.UI.WebControls"
Assembly="Microsoft.Web.UI.WebControls" %>
<%@ Page Language="vb" AutoEventWireup="false" Codebehind="Reports.aspx.vb"
Inherits="Treeview.Reports" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<title>Reports</title>
<meta content="Microsoft Visual Studio .NET 7.1" name="GENERATOR">
<meta content="Visual Basic .NET 7.1" name="CODE_LANGUAGE">
<meta content="JavaScript" name="vs_defaultClientScript">
<meta content=" http://schemas.microsoft.com/intellisense/ie5"
name="vs_targetSchema">
<SCRIPT language="javascript">
function reSize()
{
try{
var oBody = doc.document.body;
var oFrame = document.all("doc");

oFrame.style.height = oBody.scrollHeight + (oBody.offsetHeight -
oBody.clientHeight);
oFrame.style.width = oBody.scrollWidth + (oBody.offsetWidth -
oBody.clientWidth);
}
//An error is raised if the IFrame domain != its container's domain
catch(e)
{
window.status = 'Error: ' + e.number + '; ' + e.description;
}
}
function iframeFocus()
{
document.getElementById('doc').focus()
}
</SCRIPT>
</HEAD>
<body topMargin="100" MS_POSITIONING="GridLayout">
<form id="Reports" method="post" runat="server">
<asp:label id="LabelReportMainMenu" style="Z-INDEX: 102; LEFT: 344px;
POSITION: absolute; TOP: 32px"
runat="server" Width="133px" Height="27px" Font-Bold="True">Report Main Menu
</asp:label>
<TABLE id="TableMenu" style="Z-INDEX: 106; LEFT: 8px; POSITION: absolute;
TOP: 88px" borderColor="black"
cellSpacing="1" cellPadding="1" width="800" border="1">
<TR>
<TD style="WIDTH: 350px" noWrap colSpan="1" rowSpan="1"><asp:label
id="LabelCRSReports" style="Z-INDEX: 103" runat="server" Width="344px"
ToolTip="Please select the report option criteria.">My Reports
</asp:label></TD>
<td><asp:label id="LabelCRSReportOptions" style="Z-INDEX: 104"
runat="server" Width="344px" ToolTip="Please select the report option
criteria.">Reports Selection Options
</asp:label></td>
</TR>
<TR>
<TD style="WIDTH: 450px; HEIGHT: 600px" background="#80FFFF"
bgColor="#80ffff"><ie:treeview id="TreeviewReports" runat="server"
ExpandLevel="1" onselectedindexchanged="SelectedIndexChanged"
AutoPostBack="True" SystemImagesPath="/webctrl_client/1_0/treeimages/"
NAME="ReportsTreeview" BackColor="#80FFFF">
<ie:TreeNode ImageUrl="/webctrl_client/1_0/images/root.gif"
TreeNodeSrc="UIReports.xml" Text="Please click on a report below... "
Expanded="True" Expandable="CheckOnce"></ie:TreeNode>
</ie:treeview></TD>
<TD style="WIDTH: 450px" background="#990000" bgColor="#990000"
height="490"><iframe id="doc" onresize="reSize()" style="BACKGROUND-COLOR:
#990000" name="doc" frameBorder="no"
width="100%" scrolling="auto" height="100%"></iframe>
</TD>
</TD></TR>
</TABLE>
</form>
</body>
</HTML>
==========================
Public Class Reports
Inherits System.Web.UI.Page

#Region " Web Form Designer Generated Code "

'This call is required by the Web Form Designer.
<System.Diagnostics.DebuggerStepThrough()> Private Sub
InitializeComponent()

End Sub
Protected WithEvents LabelReportMainMenu As
System.Web.UI.WebControls.Label
Protected WithEvents LabelCRSReports As System.Web.UI.WebControls.Label
Protected WithEvents TreeviewReports As
Microsoft.Web.UI.WebControls.TreeView
Protected WithEvents LabelCRSReportOptions As
System.Web.UI.WebControls.Label

'NOTE: The following placeholder declaration is required by the Web Form
Designer.
'Do not delete or move it.
Private designerPlaceholderDeclaration As System.Object

Private Sub Page_Init(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Init
'CODEGEN: This method call is required by the Web Form Designer
'Do not modify it using the code editor.
InitializeComponent()
End Sub

#End Region

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
End Sub
Sub SetFocus()
Dim s As String = "<SCRIPT
language='javascript'>document.forms[0].doc.focus()</SCRIPT>"
RegisterStartupScript("focus", s)
End Sub

Public Sub SelectedIndexChanged(ByVal sender As Object, ByVal e As
Microsoft.Web.UI.WebControls.TreeViewSelectEventArgs) Handles
TreeviewReports.SelectedIndexChange
'SetFocus()

'Response.Write(TreeviewReports.GetNodeFromIndex(TreeviewReports.SelectedNodeIndex.ToString).FindNodeAttribute("Level"))
'LabelNodeValue.Text =
TreeviewReports.GetNodeFromIndex(TreeviewReports.SelectedNodeIndex.ToString).Text()
'If
TreeviewReports.GetNodeFromIndex(TreeviewReports.SelectedNodeIndex.ToString).Type().Equals("Group") Then
'LabelNodeValue.Text += " (Grouping)"
'Else
'LabelNodeValue.Text += " " +
TreeviewReports.GetNodeFromIndex(TreeviewReports.SelectedNodeIndex.ToString).Type()
'End If

'TreeviewReports.GetNodeFromIndex(TreeviewReports.SelectedNodeIndex.ToString).Target()

'TreeviewReports.GetNodeFromIndex(TreeviewReports.SelectedNodeIndex.ToString).NavigateUrl()
=
TreeviewReports.GetNodeFromIndex(TreeviewReports.SelectedNodeIndex.ToString).Target()
'TreeviewReports.SelectedImageUrl =
TreeviewReports.GetNodeFromIndex(TreeviewReports.SelectedNodeIndex.ToString).Target()
End Sub
End Class


==========================

ReportGroupingHelp.aspx

<%@ Page Language="vb" AutoEventWireup="false"
Codebehind="ReportGroupingHelp.aspx.vb"
Inherits="Treeview.ReportGroupingHelp" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<title>ReportGroupingHelp</title>
<meta name="GENERATOR" content="Microsoft Visual Studio .NET 7.1">
<meta name="CODE_LANGUAGE" content="Visual Basic .NET 7.1">
<meta name="vs_defaultClientScript" content="JavaScript">
<meta name="vs_targetSchema" content="
http://schemas.microsoft.com/intellisense/ie5">
</HEAD>
<body MS_POSITIONING="GridLayout" bottomMargin="0" bgColor="#990000"
leftMargin="0" background="#990000">
<form id="FormReportGroupingHelp" method="post" runat="server">
<asp:Label id="LabelReportGroupHelp" style="Z-INDEX: 101; LEFT: 16px;
POSITION: absolute; TOP: 256px"
runat="server" Width="216px">
<FONT color="#ffffff">Later we can add report help...</FONT></asp:Label>
</form>
</body>
</HTML>
 
Ad

Advertisements


Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top