I'm trying to create an excel spreadsheet with a landing page where I input a specific week number, period number and/or year.
I would then click a button to open an instance of Internet Explorer, navigate to the web form, input the data from the cells in the spreadsheet and then load up the reports selected.
Code for the web form
<br>
<body>
</body>
</html>
<head>
<!--include file="../../Connections/SQL.asp" -->
<title>Performance Reporting</title>
<link href="../../CSS/KPI_Style.css" rel="stylesheet" type="text/css">
<link href="../../CSS/KPI_Style.css" rel="stylesheet" type="text/css">
<link href="../CSS/KPI_Style.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
.style45 {color: #990000}
-->
</style>
<script type="text/javascript" language="javascript">
<!--
function makeDisable(){
var y=document.getElementById("store")
var x=document.getElementById("CHNSplits")
if (y.value=='CP11')
{
x.disabled=true
}
}
function makeEnable(){
var x=document.getElementById("CHNSplits")
x.disabled=false
}
-->
</script>
</head>
<body>
<div align="center">
<link href="../CSS/PL_Style.css" rel="stylesheet" type="text/css" />
<style type="text/css">
<!--
.style2 {font-size: 16px}
.style33 {color: #ffffff}
-->
</style>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td bgcolor="#001446" class="border9"><div align="left"><img src="80.gif" alt="DSGi" /></div></td>
<td valign="bottom" bgcolor="#001446" class="border16"><div align="right" class="xbig style1 style33"><span class="style2">Store Performance</span> </div></td>
</tr>
</table>
<br>
<br>
<style type="text/css">
<!--
body,td,th {
font-family: Arial, Helvetica, sans-serif;
}
body {
background-image: url();
}
.style1 {
color: #d33;
font-size: 18px;
}
.style2 {color: #000000; font-size: 2px; }
.style10 {color: #d33}
.style15 {font-size: 12px}
-->
</style>
<title></title>
</div>
<link href="../../../Testing/KPI/NewKPI/Digital_KPI/stylesheet.css" rel="stylesheet" type="text/css">
<div align="center"><span class="reportname"> Reporting Selection</span></div>
<form name="form1" id="form1" method="post" action="Get_Page_V4.asp">
<input name="store" type="hidden" value="2397" >
<input name="ViewType" type="hidden" value="store" >
<table width="60%" border="1px" align="center" cellpadding="0" cellspacing="0" bordercolor="#000000">
<td colspan="2"><div align="center" class="formnamesmall">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr height="4">
<td></td>
</tr>
<tr height="5">
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td colspan="6"><div align="center" class="formtextverylarge">Selected Location:</span> 1111</div></td>
</tr>
<tr>
<td><input name="RadioGroup1" type="radio" value="1" checked></td>
<td class="formnamesmall" ><strong>Yesterday</td>
<td class="formtext"> </td>
<td class="formtext"> </td>
<td class="formtext"> </td>
<td class="formtext"> </td>
</tr>
<tr height="15">
<td height="10"></td>
<td height="10" class="formtext"></td>
<td height="10" class="formtext"></td>
<td height="10" class="formtext"></td>
<td height="10" class="formtext"></td>
<td height="10" class="formtext"></td>
</tr>
<tr class="formtext">
<td><input type="radio" name="RadioGroup1" value="2"></td>
<td class="formnamesmall" ></td>
<td class="formtext"> </td>
<td class="formtext"> </td>
<td class="formnamesmall"> </td>
<td class="formtext">
<input name="datebox" type="hidden" id="datebox" value="07/10/2018" size="10" maxlength="10"></td>
</tr>
<tr height="15">
<td height="10"></td>
<td height="10" class="formtext"></td>
<td height="10" class="formtext"></td>
<td height="10" class="formtext"></td>
<td height="10" class="formtext"></td>
<td height="10" class="formtext"></td>
</tr>
<tr>
<td><input type="radio" name="RadioGroup1" value="3"></td>
<td class="formnamesmall" ><strong>Week</td>
<td class="formtext"> </td>
<td class="formtext"> </td>
<td class="formnamesmall">Enter Week </td>
<td class="formtext">
<input name="week" type="text" id="week" value="24" size="2" maxlength="2"></td>
</tr>
<tr>
<td> </td>
<td class="formtext"> </td>
<td class="formtext"> </td>
<td class="formtext"> </td>
<td class="formnamesmall">Enter Financial Year </td>
<td class="formtext">
<input name="weekyear" type="text" id="weekyear" value="2019" size="4" maxlength="4"></td>
</tr>
<tr height="15">
<td height="10"></td>
<td height="10" class="formtext"></td>
<td height="10" class="formtext"></td>
<td height="10" class="formtext"></td>
<td height="10" class="formtext"></td>
<td height="10" class="formtext"></td>
</tr>
<tr class="formtext">
<td><label>
<input type="radio" name="RadioGroup1" value="4">
</label></td>
<td class="formnamesmall" ><strong>Period</td>
<td class="formtext"> </td>
<td class="formtext"> </td>
<td class="formnamesmall">Enter Period </td>
<td class="formtext">
<input name="period" type="text" id="period" value="6" size="2" maxlength="2"></td>
</tr>
<tr class="formtext">
<td> </td>
<td class="formtext"> </td>
<td class="formtext"> </td>
<td class="formtext"> </td>
<td class="formnamesmall">Enter Financial Year </td>
<td class="formtext">
<input name="periodyear" type="text" id="periodyear" value="2019" size="4" maxlength="4"></td>
</tr>
<tr height="15">
<td height="10"></td>
<td height="10" class="formtext"></td>
<td height="10" class="formtext"></td>
<td height="10" class="formtext"></td>
<td height="10" class="formtext"></td>
<td height="10" class="formtext"></td>
</tr>
<tr height="15">
<td height="10"></td>
<td height="10" class="formtext"></td>
<td height="10" class="formtext"></td>
<td height="10" class="formtext"></td>
<td height="10" class="formtext"></td>
<td height="10" class="formtext"></td>
</tr>
<tr class="formtext">
<td><input type="radio" name="RadioGroup1" value="6"></td>
<td class="formnamesmall" ><strong>Year </td>
<td class="formtext"> </td>
<td class="formtext"> </td>
<td class="formnamesmall">Enter Financial Year </td>
<td class="formtext">
<input name="YearYear" type="text" id="YearYear" size="4" maxlength="4" value="2019" ></td>
</tr>
<tr><td height="10"> </td>
<td height="10"> </td>
<td height="10"> </td>
<td height="10"> </td>
<td height="10"> </td>
<td height="10"> </td>
</tr>
<!--
<tr>
<td colspan="4"><div align="center"><span class="formnamesmall style45">Select Report Type</span></div></td>
<td> </td>
<td colspan="2" class="formname" ><strong></td>
</tr>
-->
<td height="10"> </td>
<td height="10"> </td>
<td height="10"> </td>
<td height="10"> </td>
<td height="10"> </td>
<td height="10"> </td>
<tr>
<!--
<td><div align="center">
<input name="RadioGroup2" type="radio" class="Style10" value="1" >
</div></td>
<td>
<div align="right" class="formnamesmall style45">
<div align="left">Charts </div>
</div></td>
-->
<input name="RadioGroup2" type="hidden" class="Style10" value="6" checked="Checked">
<!--
<td><div align="right" class="formnamesmall">
<div align="left" class="style45">League Tables
</div>
</div></td>
-->
<td class="formnamesmall" colspan="4"> </td>
<td><input type="submit" name="Submit" value="Display Report"></td>
</tr>
</table>
<p> </p>
</div></td>
</tr>
</table>
<input name="page_name" type="hidden" value="Region_Page1_" />
</form>
<br>
<br>
<style type="text/css">
<!--
.style1 {
font-size: 10px;
color: #FFFFFF;
}
-->
</style>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td valign="bottom" bgcolor="#001446"><div align="right" class="xbig style1 style1"> </div></td>
</tr>
</table>
</body>
VBA code
Sub Get_Data()
Dim i As Long
Dim IE As Object
Dim objElement As Object
Dim objCollection As Object
Dim HWNDSrc As Long
Dim dates As Object
Set IE = CreateObject("InternetExplorer.Application")
With IE
.Visible = True
.navigate "http://INTRANETSITE/Summary_Select.asp"
Do Until .readyState = 4 And Not .Busy
DoEvents
Loop
.document.all.Item("radioGroup1")(3).Checked = True 'Select the 4th checkbox down on the list
.document.forms(0).submit 'Submit the form to generate the result
End With
Pause (2)
With IE
.navigate "http://INTRANETSITE/ReportDetail2.asp?"
Do Until .readyState = 4 And Not .Busy
DoEvents
Loop
End With
End Sub
The code above navigates to the web form and does select the 4th radio button which is for period reports, then submits the form and displays the first page.
How do I interact with the text boxes to also amend which week or period I want to select reports for?
Also, when it tries to navigate to ReportDetail2.asp it returns the following error and then crashes the VBA code.
Method 'Navigate' of object 'IWebBrowser2' failed
The long term goal of this is to navigate through 20+ pages of reports, pulling the data from each table into a tab on the spreadsheet, so if it can't navigate between the reports, even before we get to the code to pull the data, then that's a problem.
Try something like the following. I am showing the different options you might consider so remember to comment out those you don't want to use.
You need to add a reference to Microsoft Internet Controls via VBE > Tools > References or use late bound call of
Dim ie As New InternetExplorer : Set ie = CreateObject("InternetExplorer.Application")
VBA:
Option Explicit
Public Sub MakeSelections()
Dim ie As New InternetExplorer
Const URL As String = "yourURL"
With ie
.Visible = True
.navigate URL
While .Busy Or .readyState < 4: DoEvents: Wend
With .document
.querySelector("[value='1']").Checked = True 'Yesterday. CSS attribute = value selector
.querySelector("[value='3']").Checked = True 'Week
.querySelector("[value='4']").Checked = True 'Period
.querySelector("[value='6']").Checked = True 'Year
.getElementById("week").Value = 6 'week value
.getElementById("weekyear").Value = 2018 'financial year value
.getElementById("period").Value = 6 'period value
.getElementById("periodyear").Value = 2018 'period financial year value
.getElementById("yearyear").Value = 2019 'financial year value
.querySelector("[value='Display Report']").Click 'display report
End With
Stop '<== Delete me later
'.Quit '<== Remember to quit application
End With
End Sub
my xml file name is product_file.xml and i have an xslt file , i am using a xml control in my webpage by binding xml & xslt files to the control but i am not getting the output properly. It showing only header multiple times
<?xml version="1.0" encoding="utf-8" ?>
<productlist>
<product>
<itemnumber>1</itemnumber>
<name>Staple Superior Men’s Jacket</name>
<description>The Staple Superior T-bone PU Jacket is classic hood with a drawstring fastening, long and a zip up front fastening.</description>
<color>BLACK</color>
<image>Staplesuperior1.gif</image>
<price>$140</price>
<size>69</size>
<quantity>1</quantity>
<category>Men</category>
</product>
<product>
<itemnumber>2</itemnumber>
<name>Afends Mens t-shirt</name>
<description>The Afends Thrash For Cash Raglan Tee has a scooped hemline, a 100% cotton composition, and a regular fit.</description>
<color>Beach Heather & Black</color>
<image>Afends1.gif</image>
<price>$90</price>
<size>80</size>
<quantity>1</quantity>
<category>Men</category>
</product>
<product>
<itemnumber>3</itemnumber>
<name>Wrangler Men Blue Vegas Skinny Fit Jeans</name>
<description>Blue 5 pocket jeans, stretchable, has a zip fly with buttoned closure in front, 2 scoop pockets at sides</description>
<image>Wrangler1.gif</image>
<color>BLUE</color>
<price>$125</price>
<size>32</size>
<quantity>1</quantity>
<category>Men</category>
</product>
<product>
<itemnumber>4</itemnumber>
<name>Roadster Women Top</name>
<description>Black top, knit, V neck, short extended sleeves, lattice like fabric manipulation detail at shoulders</description>
<color>BLACK</color>
<image>Roadster.gif</image>
<price>$55</price>
<size>Small</size>
<quantity>1</quantity>
<category>Women</category>
</product>
and my xslt file is
<xsl:template match="product">
<html>
<head>
<title>Products XSLT Demo</title>
</head>
<body>
<h2>Products Information</h2>
<br/>
<!--<xsl:copy>
<xsl:apply-templates select="#* | node()"/>
</xsl:copy>-->
<table bgcolor="#008BE7" border="1">
<xsl:for-each select="itemnumber">
<tr>
<td>Item Number</td>
<td>
<xsl:value-of select="itemnumber"/>
</td>
</tr>
<tr> <td>name</td>
<td>
<xsl:value-of select="name"/>
</td>
</tr>
<tr>
<td>description</td>
<td>
<xsl:value-of select="description"/>
</td>
</tr>
<tr>
<td>color</td>
<td>
<xsl:value-of select="color"/>
</td>
</tr>
<tr>
<td>price</td>
<td>
<xsl:value-of select="price"/>
</td>
</tr>
<tr>
<td>size</td>
<td>
<xsl:value-of select="size"/>
</td>
</tr>
<tr> <td>quantity</td>
<td>
<xsl:value-of select="quantity"/>
</td>
</tr>
<tr>
<td>category</td>
<td>
<xsl:value-of select="category"/>
</td>
</tr>
</xsl:for-each>
</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
now the error is the foreach expression not working so the ouput showing only heading multiple times
This seems to be working for me. changing the templatematch to productlist and foreach to product
<xsl:template match="productlist">
<html>
<head>
<title>Products XSLT Demo</title>
</head>
<body>
<h2>Products Information</h2>
<br/>
<!--<xsl:copy>
<xsl:apply-templates select="#* | node()"/>
</xsl:copy>-->
<table bgcolor="#008BE7" border="1">
<xsl:for-each select="product">
<tr>
<td>Item Number</td>
<td>
<xsl:value-of select="itemnumber"/>
</td>
</tr>
<tr> <td>name</td>
<td>
<xsl:value-of select="name"/>
</td>
</tr>
<tr>
<td>description</td>
<td>
<xsl:value-of select="description"/>
</td>
</tr>
<tr>
<td>color</td>
<td>
<xsl:value-of select="color"/>
</td>
</tr>
<tr>
<td>price</td>
<td>
<xsl:value-of select="price"/>
</td>
</tr>
<tr>
<td>size</td>
<td>
<xsl:value-of select="size"/>
</td>
</tr>
<tr> <td>quantity</td>
<td>
<xsl:value-of select="quantity"/>
</td>
</tr>
<tr>
<td>category</td>
<td>
<xsl:value-of select="category"/>
</td>
</tr>
</xsl:for-each>
</table>
</body>
</html>
</xsl:template>
Change the foreach to
<xsl:for-each select=".">
I'd like to know where i have gone wrong, i want to apply font verdana to "to change this font to verdana."
I have removed contend from other table rows to make the code appear clearer. I have set the css styling to this section but when uploading the font does not change at all.
Code is:
<style type="text/css">
#form1 tbody tr td {
font-family: Verdana, Geneva, sans-serif;
}
</style>
<table width="500" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#ffffff">
<tr>
<form action="upload_ac.php" method="post" enctype="multipart/form-data" name="form1" id="form1">
<tr>
<td><strong>Title 1</strong></td>
</tr>
<tr>
<td>To Change this font to verdana.<br>
<br></td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td></td>
</tr>
<tr>
<td align="center"> </td>
</tr>
</form>
<tr>
<td>
<!-- start here-->
<form action="http://www./cookie5payment/freecontact2formprocess.php" method="post">
<table class="freecontact2form" border="0" width="400px">
<tbody>
<tr>
<td colspan="2"><span style="font-size: x-small;"> </span> <br /> <br /></td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td><br></td>
<td></td>
</tr>
<tr>
<br>
<td valign="top"> </td>
</tr>
<tr>
<td style="text-align:center" colspan="2"><br /><br />
<br /><br />
<br /><br /></td>
</tr>
</tbody>
</table>
</form>
<!-- end here -->
</td>
</tr>
</table>
</tr>
Your code is not working as expected because you use the identifier #form1 to target the table inside that form, but you start the table outside the form so the css selector can not find it. Change the order of your html as follows (i.e. switch the form and table tag)
<form action="upload_ac.php" method="post" enctype="multipart/form-data" name="form1 id="form1">
<table width="500" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#ffffff">
Here is a fiddle to illustrate this
I have a xslt file that fetches data from a xml file and displays them accordingly. Some of the data in the xml file are in lower-case. Is there any way by which I can change it to upper-case inside the xslt while displaying it in the table? my xslt file is as given below:
<?xml version="1.0" encoding="iso-8859-1"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<html>
<head>
<title>VPGate Media Mixer</title>
<meta http-equiv="expires" content="0"/>
<meta http-equiv="pragma" content="no-cache"/>
<meta http-equiv="cache-control" content="no-cache, must-revalidate"/>
<meta http-equiv="refresh" content="15"></meta>
<script src="/Common/common.js\" type="text/javascript"></script>
<link rel="stylesheet" type="text/css" href="style001.css" />
<link rel="stylesheet" type="text/css" href="Grid.Default.css" />
</head>
<body class="WorkArea">
<div class="divSummaryHeader" id="SummaryHeader">
<h1>Media Mixer - VPGate</h1>
<xsl:for-each select="MMDiagnostics/Conference">
<h1>
Media Mixer - <xsl:value-of select="name"/>
</h1>
</xsl:for-each>
</div>
<div class="RadGrid RadGrid_Default" id="SummaryData" style="position:absolute;width:810px;height:510px;overflow:auto">
<table border="0" class="rgMasterTable rgClipCells" cellspacing="0" cellpadding="0" >
<tr>
<input type="button" class="formEditBtn" id="SubBtn" value="Refresh" onclick="window.location=window.location;"/>
</tr>
<tr>
<td class="rgHeader SummaryTableHdrRow" style="font-weight:bold;" colspan="2">Conference Summary</td>
</tr>
<tr>
<td>
<table border="0" class="rgMasterTable rgClipCells" cellspacing="0" cellpadding="0" >
<tr>
<td class="rgHeader SummaryTableHdrRow" style="font-weight:bold;">Conference Name</td>
<td class="rgHeader SummaryTableHdrRow" style="font-weight:bold;">Conference ID</td>
<td class="rgHeader SummaryTableHdrRow" style="font-weight:bold;">Composite Address</td>
<td class="rgHeader SummaryTableHdrRow" style="font-weight:bold;">Composite Port</td>
<td class="rgHeader SummaryTableHdrRow" style="font-weight:bold;">Composite Ssrc</td>
<td class="rgHeader SummaryTableHdrRow" style="font-weight:bold;">No Of Participants</td>
</tr>
<xsl:if test="MediaMixer!= ''">
<xsl:for-each select="MediaMixer/Conference">
<!--<xsl:sort select="Name"/>-->
<xsl:if test="Name !=''">
<xsl:if test="(position() mod 2 = 0)">
<tr class="rgAltRow SummaryTableDataRow">
<td valign = "top">
<xsl:value-of select="Name"/>
</td>
<td valign = "top">
<xsl:value-of select="ConfId"/>
</td>
<td valign = "top">
<xsl:value-of select="CompositeAddress"/>
</td>
<td valign = "top">
<xsl:value-of select="CompositePort"/>
</td>
<td valign = "top">
<xsl:value-of select="CompositeSsrc"/>
</td>
<td valign = "top">
<xsl:value-of select="NoOfParticipants"/>
</td>
</tr>
</xsl:if>
<xsl:if test="(position() mod 2 = 1)">
<td>
<tr class="rgRow SummaryTableDataRow">
<td valign = "top">
<xsl:value-of select="Name"/>
</td>
<td valign = "top">
<xsl:value-of select="ConfId"/>
</td>
<td valign = "top">
<xsl:value-of select="CompositeAddress"/>
</td>
<td valign = "top">
<xsl:value-of select="CompositePort"/>
</td>
<td valign = "top">
<xsl:value-of select="CompositeSsrc"/>
</td>
<td valign = "top">
<xsl:value-of select="NoOfParticipants"/>
</td>
</tr>
</td>
</xsl:if>
</xsl:if>
</xsl:for-each>
</xsl:if>
<xsl:if test="MediaMixer = ''">
<td valign = "top">
<xsl:text>No Data </xsl:text>
</td>
</xsl:if>
</table>
</td>
</tr>
</table>
<table border="0" class="rgMasterTable rgClipCells" cellspacing="1" cellpadding="1" >
<tr>
<td class="rgHeader SummaryTableHdrRow" style="font-weight:bold;" colspan="2">Conference Details</td>
</tr>
<tr>
<td>
<table border="0" class="rgMasterTable rgClipCells" cellspacing="0" cellpadding="0" >
<tr>
<td class="rgHeader SummaryTableHdrRow" style="font-weight:bold;">Conference Name</td>
<td class="rgHeader SummaryTableHdrRow" style="font-weight:bold;">Conference ID</td>
<td class="rgHeader SummaryTableHdrRow" style="font-weight:bold;">Participant ID 1</td>
<td class="rgHeader SummaryTableHdrRow" style="font-weight:bold;">Participant ID 2</td>
<td class="rgHeader SummaryTableHdrRow" style="font-weight:bold;">Participant Address</td>
<td class="rgHeader SummaryTableHdrRow" style="font-weight:bold;">Participant Listening Port</td>
<td class="rgHeader SummaryTableHdrRow" style="font-weight:bold;">MM Listening Port</td>
<td class="rgHeader SummaryTableHdrRow" style="font-weight:bold;">SSRC From Participant</td>
<td class="rgHeader SummaryTableHdrRow" style="font-weight:bold;">SSRC From MM</td>
</tr>
<xsl:if test="MediaMixer!= ''">
<xsl:for-each select="MediaMixer/Conference">
<xsl:for-each select="Participant">
<xsl:if test="(position() mod 2 = 0)">
<tr class="rgAltRow SummaryTableDataRow">
<td valign = "top">
<xsl:value-of select="../Name"/>
</td>
<td valign = "top">
<xsl:value-of select="../ConfId"/>
</td>
<td valign = "top">
<xsl:variable name="text" select="'Upper'" />
<xsl:value-of select="translate($text, 'abcdefghijklmnopqrstuvwxyz', 'ABCDEFGHIJKLMNOPQRSTUVWXYZ')" />
</td>
<td valign = "top">
<xsl:value-of select="ID2"/>
</td>
<td valign = "top">
<xsl:value-of select="ParticipantAddress"/>
</td>
<td valign = "top">
<xsl:value-of select="ParticipantListeningPort"/>
</td>
<td valign = "top">
<xsl:value-of select="MMListeningPort"/>
</td>
<td valign = "top">
<xsl:value-of select="SSRCFromParticipant"/>
</td>
<td valign = "top">
<xsl:value-of select="SSRCFromMM"/>
</td>
</tr>
</xsl:if>
<xsl:if test="(position() mod 2 = 1)">
<td>
<tr class="rgRow SummaryTableDataRow">
<td valign = "top">
<xsl:value-of select="../Name"/>
</td>
<td valign = "top">
<xsl:value-of select="../ConfId"/>
</td>
<td valign = "top">
<xsl:value-of select="ID1"/>
</td>
<td valign = "top">
<xsl:value-of select="ID2"/>
</td>
<td valign = "top">
<xsl:value-of select="ParticipantAddress"/>
</td>
<td valign = "top">
<xsl:value-of select="ParticipantListeningPort"/>
</td>
<td valign = "top">
<xsl:value-of select="MMListeningPort"/>
</td>
<td valign = "top">
<xsl:value-of select="SSRCFromParticipant"/>
</td>
<td valign = "top">
<xsl:value-of select="SSRCFromMM"/>
</td>
</tr>
</td>
</xsl:if>
</xsl:for-each>
</xsl:for-each>
</xsl:if>
<xsl:if test="MediaMixer= ''">
<td valign = "top">
<xsl:text>No Data </xsl:text>
</td>
</xsl:if>
</table>
</td>
</tr>
</table>
<div style="display:none">
<iframe id="frameUpdate" name="frameUpdate" width="100%"></iframe>
</div>
</div>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
Let us assume that I wish to change ID1 to upper-case. How do i do it ?
Add at the top, before <xsl:template match="/">:
<xsl:variable name="smallcase" select="'abcdefghijklmnopqrstuvwxyz'" />
<xsl:variable name="uppercase" select="'ABCDEFGHIJKLMNOPQRSTUVWXYZ'" />
And your ID1 selector will be probably:
<td valign = "top">
<xsl:value-of select="translate(ID1, $smallcase, $uppercase)" />
</td>
I have a VB.NET web application where I am opening a window when a user clicks on a link to view some external tabular data. The data I'm displaying definitely requires a vertical scrollbar in order to see everything...For some reason I cannot get a vertical scrollbar to show up when the new window loads.
Here's the JS that opens the window:
function showDataTable(id, type) {
var pageUrl = "queries/ReportData.aspx";
windowHandle = window.open(pageUrl, "FarmQuery", 'resizable=yes,scrollbars=yes');
windowHandle.focus();
}
The corresponding Page_Load method for the window being opened:
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Dim db As New UtilDb
Dim errMsg As String = ""
If (Not Page.IsPostBack) Then
db.OpenGeoDb(MyGlobals.GeodataServiceName, errMsg)
LoadFarmInfo(db, errMsg)
LoadQueryData(db, errMsg)
db.CloseGeoDb()
End If
End Sub
And for what it's worth I added
style="overflow: scroll;"
To the div containing the data table.
It almost seems like the data table is rendering after the rest of the "page" has been contructed. Any suggestions?
EDIT
The problem occurs in Firefox and IE. I modified the window parameters argument in the JS from 'resizable=yes,scrollbars=yes' to 'resizable=yes,scrollbars=yes,toolbar=yes' and did get the toolbar to show up which indicates those options are "working".
Unfortunately I cannot post the HTML.
EDIT
Here's the sample HTML
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title>
Farm Query
</title><link href="../Default.css" type="text/css" rel="stylesheet" /><link href="ReportData.css" type="text/css" rel="stylesheet" /></head>
<body>
<form name="form1" method="post" action="ReportData.aspx?wfpId=DES-046&type=1" id="form1">
<div>
<input type="hidden" name="__EVENTTARGET" id="__EVENTTARGET" value="" />
<input type="hidden" name="__EVENTARGUMENT" id="__EVENTARGUMENT" value="" />
<input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="#" />
</div>
<script type="text/javascript">
//<![CDATA[
var theForm = document.forms['form1'];
if (!theForm) {
theForm = document.form1;
}
function __doPostBack(eventTarget, eventArgument) {
if (!theForm.onsubmit || (theForm.onsubmit() != false)) {
theForm.__EVENTTARGET.value = eventTarget;
theForm.__EVENTARGUMENT.value = eventArgument;
theForm.submit();
}
}
//]]>
</script>
<div>
<input type="hidden" name="__EVENTVALIDATION" id="__EVENTVALIDATION" value="/wEWAwKP2r/ZCgLbzub6CgKJ+/qJC4VfHXBxZJkelz+i1sSmIFdWB5tZ" />
</div>
<div style="overflow: auto;">
<table class="dxgvControl" cellspacing="0" cellpadding="0" id="FarmerInfoGridView" border="0" style="width:600px;border-collapse:collapse;border-collapse:separate;">
<tr>
<td><table id="FarmerInfoGridView_DXMainTable" class="dxgvTable" cellspacing="0" cellpadding="0" border="0" style="width:100%;border-collapse:collapse;empty-cells:show;">
<tr id="FarmerInfoGridView_DXDataRow0" class="dxgvDataRow">
<td id="FarmerInfoGridView_tcrow0" colspan="7" style="border-right-width:0px;border-bottom-width:0px;">
<table width="100%" cellpadding="5" cellspacing="5">
<tr>
<td class="keyDescription">WFP ID:</td>
<td>asdf</td>
</tr>
<tr>
<td class="keyDescription">Name:</td>
<td>Name, Name</td>
</tr>
<tr>
<td class="keyDescription">Company Name:</td>
<td>Acme</td>
</tr>
<tr>
<td class="keyDescription">Address:</td>
<td>123 Lotus Lane</td>
</tr>
<tr>
<td class="keyDescription">City/State:</td>
<td>NY, NY</td>
</tr>
<tr>
<td class="keyDescription">Zip:</td>
<td>11111</td>
</tr>
</table>
</td>
</tr>
</table><img id="FarmerInfoGridView_IADD" src="#" alt="|" style="border-width:0px;position:absolute;visibility:hidden;" /><img id="FarmerInfoGridView_IADU" src="/SAM_Project/WebResource.axd" alt="|" style="border-width:0px;position:absolute;visibility:hidden;" /><img id="FarmerInfoGridView_IDHF" src="/SAM_Project/WebResource.axd" alt="Hide" style="border-width:0px;position:absolute;visibility:hidden;" /><div id="FarmerInfoGridView_LP" align="center" style="left:0px;top:0px;z-index:30000;display:none;">
<table class="dxgvLoadingPanel" cellspacing="0" cellpadding="0" border="0" style="border-collapse:collapse;">
<tr>
<td class="dx"><img src="/SAM_Project/WebResource.axd" alt="" align="middle" style="border-width:0px;" /></td><td class="dx" style="padding-left:0px;">Loading…</td>
</tr>
</table>
</div><div id="FarmerInfoGridView_LD" class="dxgvLoadingDiv" style="display:none;z-index:29999;position:absolute;">
</div><input type="hidden" name="FarmerInfoGridView$DXSelInput" id="FarmerInfoGridView_DXSelInput" /><table id="FarmerInfoGridView_DXStyleTable" border="0" style="display:none;">
<tr>
<td></td>
</tr><tr class="dxgvEditingErrorRow">
<td class="dxgv" colspan="7" style="border-right-width:0px;"></td>
</tr><tr class="dxgvSelectedRow">
<td></td>
</tr><tr class="dxgvFocusedRow">
<td></td>
</tr><tr class="dxgvFocusedGroupRow">
<td></td>
</tr><tr class="dxgvDataRow">
<td></td>
</tr>
</table><input type="hidden" name="FarmerInfoGridView$CallbackState" id="FarmerInfoGridView_CallbackState" value="#" /></td>
</tr>
</table><script id="dxss_27477558" type="text/javascript">
<!--
var dxo = new ASPxClientGridView('FarmerInfoGridView');
window['FarmerInfoGridView'] = dxo;
dxo.callBack = function(arg) { WebForm_DoCallback('FarmerInfoGridView',arg,aspxCallback,'FarmerInfoGridView',aspxCallbackError,true); };
dxo.callBacksEnabled=true;
dxo.pageRowCount=1;
dxo.pageRowSize=10;
dxo.selectedWithoutPageRowCount=0;
dxo.visibleStartIndex=0;
dxo.focusedRowIndex=-1;
dxo.allowFocusedRow=false;
dxo.allowMultiSelection=false;
dxo.isColumnsResizable=false;
dxo.isVerticalScrolling=false;
dxo.isHorizontalScrolling=false;
dxo.isMainControlResizable=false;
dxo.callbackOnFocusedRowChanged=false;
dxo.callbackOnSelectionChanged=false;
dxo.autoFilterDelay='1200';
dxo.ClearColumns();
dxo.CreateColumn('',0,'WFP_ID',1);
dxo.CreateColumn('',1,'Last_Name',1);
dxo.CreateColumn('',2,'First_name',1);
dxo.CreateColumn('',3,'Farm_Name',1);
dxo.CreateColumn('',4,'Address',1);
dxo.CreateColumn('',5,'City_State',1);
dxo.CreateColumn('',6,'Zip',1);
dxo.InlineInitialize();
//-->
</script>
<table class="dxgvControl" cellspacing="0" cellpadding="0" id="AnimalGridView" border="0" style="width:600px;border-collapse:collapse;border-collapse:separate;">
<tr>
<td><table id="AnimalGridView_DXMainTable" class="dxgvTable" cellspacing="0" cellpadding="0" border="0" style="width:100%;border-collapse:collapse;empty-cells:show;">
<tr id="AnimalGridView_DXDataRow0" class="dxgvDataRow">
<td id="AnimalGridView_tcrow0" colspan="43" style="border-right-width:0px;border-bottom-width:0px;">
<table cellpadding="5" cellspacing="5" width="100%" id="rounded-corner">
<tr>
<th colspan="8" class="tableHeader">Animal Inventory</th>
</tr>
<tr>
<td colspan="2">Updated:</td>
<td colspan="2">11/14/2007</td>
<td colspan="2">Total AU:</td>
<td colspan="2">0</td>
</tr>
<tr>
<td>Mature Dairy</td>
<td>0</td>
<td>Dairy Heifers</td>
<td>0</td>
<td>Veal</td>
<td>0</td>
<td>Beef</td>
<td>0</td>
</tr>
<tr>
<td>Calves</td>
<td>0</td>
<td>Bulls</td>
<td>0</td>
<td>Ducks</td>
<td>0</td>
<td>Elk</td>
<td>0</td>
</tr>
<tr>
<td>Sheep</td>
<td>0</td>
<td>Lambs</td>
<td>0</td>
<td>Geese</td>
<td>0</td>
<td>Buffalo</td>
<td>0</td>
</tr>
<tr>
<td>Goats</td>
<td>2</td>
<td>Kids</td>
<td>0</td>
<td>Rabbits</td>
<td>0</td>
<td>Bears</td>
<td>0</td>
</tr>
<tr>
<td>Pigs</td>
<td>0</td>
<td>Piglets</td>
<td>0</td>
<td>Emu</td>
<td>0</td>
<td>Mountain Lion</td>
<td>0</td>
</tr>
<tr>
<td>Horses</td>
<td>0</td>
<td>Foals</td>
<td>0</td>
<td>Ostrich</td>
<td>0</td>
<td>Guinea Pigs</td>
<td>0</td>
</tr>
<tr>
<td>Donkeys</td>
<td>0</td>
<td>Oxen</td>
<td>0</td>
<td>Walaroo</td>
<td>0</td>
<td>Greenhouse</td>
<td>0</td>
</tr>
<tr>
<td>Chickens</td>
<td>0</td>
<td>Turkeys</td>
<td>0</td>
<td>Llama</td>
<td>0</td>
<td>Vegetables</td>
<td>0</td>
</tr>
<tr>
<td>Ginny Hens</td>
<td>0</td>
<td>Peacock</td>
<td>0</td>
<td>Alpaca</td>
<td>0</td>
<td>Pheasant</td>
<td>0</td>
</tr>
<tr>
<td>Deer</td>
<td>0</td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
</table>
</td>
</tr>
</table><img id="AnimalGridView_IADD" src="/SAM_Project/WebResource.axd" alt="|" style="border-width:0px;position:absolute;visibility:hidden;" /><img id="AnimalGridView_IADU" src="/SAM_Project/WebResource.axd" alt="|" style="border-width:0px;position:absolute;visibility:hidden;" /><img id="AnimalGridView_IDHF" src="/SAM_Project/WebResource.axd" alt="Hide" style="border-width:0px;position:absolute;visibility:hidden;" /><div id="AnimalGridView_LP" align="center" style="left:0px;top:0px;z-index:30000;display:none;">
<table class="dxgvLoadingPanel" cellspacing="0" cellpadding="0" border="0" style="border-collapse:collapse;">
<tr>
<td class="dx"><img src="/SAM_Project/WebResource.axd" alt="" align="middle" style="border-width:0px;" /></td><td class="dx" style="padding-left:0px;">Loading…</td>
</tr>
</table>
</div><div id="AnimalGridView_LD" class="dxgvLoadingDiv" style="display:none;z-index:29999;position:absolute;">
</div><input type="hidden" name="AnimalGridView$DXSelInput" id="AnimalGridView_DXSelInput" /><table id="AnimalGridView_DXStyleTable" border="0" style="display:none;">
<tr>
<td></td>
</tr><tr class="dxgvEditingErrorRow">
<td class="dxgv" colspan="43" style="border-right-width:0px;"></td>
</tr><tr class="dxgvSelectedRow">
<td></td>
</tr><tr class="dxgvFocusedRow">
<td></td>
</tr><tr class="dxgvFocusedGroupRow">
<td></td>
</tr><tr class="dxgvDataRow">
<td></td>
</tr>
</table><input type="hidden" name="AnimalGridView$CallbackState" id="AnimalGridView_CallbackState" value="#" /></td>
</tr>
</table><script id="dxss_1369069069" type="text/javascript">
<!--
var dxo = new ASPxClientGridView('AnimalGridView');
window['AnimalGridView'] = dxo;
dxo.callBack = function(arg) { WebForm_DoCallback('AnimalGridView',arg,aspxCallback,'AnimalGridView',aspxCallbackError,true); };
dxo.callBacksEnabled=true;
dxo.pageRowCount=1;
dxo.pageRowSize=10;
dxo.selectedWithoutPageRowCount=0;
dxo.visibleStartIndex=0;
dxo.focusedRowIndex=-1;
dxo.allowFocusedRow=false;
dxo.allowMultiSelection=false;
dxo.isColumnsResizable=false;
dxo.isVerticalScrolling=false;
dxo.isHorizontalScrolling=false;
dxo.isMainControlResizable=false;
dxo.callbackOnFocusedRowChanged=false;
dxo.callbackOnSelectionChanged=false;
dxo.autoFilterDelay='1200';
dxo.ClearColumns();
//-->
</script>
<div style="margin-left: auto; margin-right: auto; width: 450px;padding: 5px 5px;"><input id="btnClose" type="submit" value="Close Window" onclick="window.close();" /></div>
</div>
<script type="text/javascript">
//<![CDATA[
WebForm_InitCallback();//]]>
</script>
</form>
</body>
</html>
If you want to always force a scroll bar on a page, try adding the following CSS to the page:
html {
overflow-y:scroll;
}
This will cause the page to always have a vertical scrollbar no matter if it is needed or not.
You might also want to change your code to use:
windowHandle = window.open(pageUrl, "FarmQuery", 'resizable=1,scrollbars=1');
as 1=yes/true but yes does not necessarily equal 1/true (funny cross browser logic!).
This definitely sounds like a CSS issue to me.
Try stripping your link to the CSS file out of the popup page and then see if the problem still exists (I bet it won't).
Then, this becomes a new question: What CSS could cause the scrollbars to disappear on a page?
A rule of overflow: hidden; on the body is a very likely culprit.
Have you tried sizing your main browser window to approximately the size of your popup window and directly navigating to the page that you would display in your popup? Do the scrollbars appear when you load the page directly? The popup window is possibly a red herring.
Scrollbars should just appear when you open a new window if the content doesn't fit the client area. Try adding "width=600,height=600" in your options to reduce the window size right down...if no bars are appearing it is more likely a css problem.
Remove your "default.css" line. Do you still get the problem?
When I tried the html you provided, and I resize the window so the content don't fit, I get scrollbars on the div (which appears slightly smaller than the full window). I tried to remove the style="overflow: auto;" on the div tag, and the scrollbar was only applied on the full window. This seems to work, and when you say that the scrollbars dont apply, my first thought is that it is something defined in your CSS files that causes the problem. It might be in either ../Default.css or ReportData.css .
If the style for div is set to overflow:hidden in one of the css files, you can override this to set style="overflow: visible;" in the div tag on your page. This will cause the content of the div not to be clipped, and scrolling is handled by the window instead of the div tag.
If it is not the div tag that is the problem, it might be some other tags. Look for overflow: hidden on any tags in your css files to see if that might be the problem.
There could be a Position:fixed in your css file which is preventing the scrollbars to appear.
window.open('CHFPhoneMonitoringChecklist.html', 'CHFwin', 'resizable=yes,location=1,status=1,scrollbars=1,width=1250,height=1000');