TryParse not passing correct values?

All,
I'm trying to parse text box input to an integer.  Then based on the value of that integer a sub will set values for various other variables (integers).  Then the integers that are obtained from the sub are passed to a sb.appendline.
I am doing this for about 20 text boxes.  However, sometimes it works and sometimes it doesn't.  Sometimes every line in the text file will contain the correct quotas (integers).  Sometimes the first line in the text file contains
all zeros for the quotas and the rest of the lines in the text file contain the correct quotas.  Sometimes all of the lines will contain either incorrect values for the quotas or all zeros for the quotas.
I am baffled as to why.  Any help would be greatly appreciated.
James
Public Class Form1
Public inBW As Integer
Public outBW As Integer
Public inTCP As Integer
Public inUDP As Integer
Public inICMP As Integer
Public inIGMP As Integer
Public outTCP As Integer
Public outUDP As Integer
Public outICMP As Integer
Public outIGMP As Integer
Public tempInt As Integer
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Dim FileName As String
Dim FileNameAndPath As String
FileName = "Test.txt"
FileNameAndPath = IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, FileName)
Dim sb As New System.Text.StringBuilder
'Get Bandwidth 1 Quotas
Integer.TryParse(txtInboundBW1.Text, inBW)
Integer.TryParse(txtOutboundBW1.Text, outBW)
Get_Quotas()
'Write Bandwidth 1 quotas to file
sb.AppendLine(("create Quotas -bw_in ") & txtInboundBW1.Text & (" -bw_out ") & txtOutboundBW1.Text & (" -in_tcp_quota " & inTCP & " -in_udp_quota " & inUDP & " -in_icmp_quota " & inICMP & " -in_igmp_quota " & inIGMP & " -out_tcp_quota " & outTCP & " -out_udp_quota " & outUDP & " -out_icmp_quota " & outICMP & " -out_igmp_quota " & outIGMP))
'Get Bandwidth 2 Quotas
Integer.TryParse(txtInboundBW2.Text, inBW)
Integer.TryParse(txtOutboundBW2.Text, outBW)
Get_Quotas()
'Write Bandwidth 2 quotas to file
sb.AppendLine(("create Quotas -bw_in ") & txtInboundBW2.Text & (" -bw_out ") & txtOutboundBW2.Text & (" -in_tcp_quota " & inTCP & " -in_udp_quota " & inUDP & " -in_icmp_quota " & inICMP & " -in_igmp_quota " & inIGMP & " -out_tcp_quota " & outTCP & " -out_udp_quota " & outUDP & " -out_icmp_quota " & outICMP & " -out_igmp_quota " & outIGMP))
SaveFileDialog1.InitialDirectory = My.Computer.FileSystem.SpecialDirectories.Desktop
SaveFileDialog1.FileName = FileName
SaveFileDialog1.Filter = "txt files (*.txt)|*.txt|All files (*.*)|*.*"
If SaveFileDialog1.ShowDialog = Windows.Forms.DialogResult.OK Then
IO.File.WriteAllText(SaveFileDialog1.FileName, sb.ToString)
Process.Start(SaveFileDialog1.FileName)
End If
End Sub
Public Sub Get_Quotas()
'5,000 kbps = 80,50,10,10
'10,000 kbps = 75,50,9,9
'100,000 kbps= 75,50,2,2
'1,000,000 kbps= 75,50,1,1
'10,000,000 kbps= 75,50,1,1
'40,000,000 kbps= 75,50,1,1
If inBW > 0 And inBW <= 5000 Then
inTCP = 80
inUDP = 50
inICMP = 10
inIGMP = 10
End If
If outBW > 0 And outBW <= 5000 Then
outTCP = 80
outUDP = 50
outICMP = 10
outIGMP = 10
End If
If inBW > 5000 And inBW <= 10000 Then
inTCP = 70
inUDP = 50
inICMP = 9
inIGMP = 9
End If
If outBW > 5000 And outBW <= 10000 Then
outTCP = 70
outUDP = 50
outICMP = 9
outIGMP = 9
End If
If inBW > 10000 And inBW <= 100000 Then
inTCP = 70
inUDP = 50
inICMP = 2
inIGMP = 2
End If
If outBW > 10000 And outBW <= 100000 Then
outTCP = 70
outUDP = 50
outICMP = 2
outIGMP = 2
End If
If inBW > 100000 And inBW <= 4000000 Then
inTCP = 70
inUDP = 50
inICMP = 1
inIGMP = 1
End If
If outBW > 100000 And outBW <= 4000000 Then
outTCP = 70
outUDP = 50
outICMP = 1
outIGMP = 1
End If
End Sub
End Class

Version with XML comments (IntelliSense support):
Option Strict On
Option Explicit On
Option Infer Off
Namespace James
Public Class BandwidthPolicy
''' <summary>
''' An enumerator for the policy type (currently five).
''' </summary>
''' <remarks></remarks>
Public Enum PolicyType
Global_Policy
Web_Policy
Mail_Policy
FTP_Policy
DNS_Policy
End Enum
Private _global_PolicyQuota As BandwidthQuota
Private _web_PolicyQuota As BandwidthQuota
Private _mail_PolicyQuota As BandwidthQuota
Private _fTP_PolicyQuota As BandwidthQuota
Private _dNS_PolicyQuota As BandwidthQuota
Public Sub New()
End Sub
''' <summary>
''' Gets the DNS policy quota.
''' </summary>
''' <value></value>
''' <returns></returns>
''' <remarks></remarks>
Public ReadOnly Property DNS_PolicyQuota As BandwidthQuota
Get
Return _dNS_PolicyQuota
End Get
End Property
''' <summary>
''' Gets the FTP policy quota.
''' </summary>
''' <value></value>
''' <returns></returns>
''' <remarks></remarks>
Public ReadOnly Property FTP_PolicyQuota As BandwidthQuota
Get
Return _fTP_PolicyQuota
End Get
End Property
''' <summary>
''' Gets the Global policy quota.
''' </summary>
''' <value></value>
''' <returns></returns>
''' <remarks></remarks>
Public ReadOnly Property Global_PolicyQuota As BandwidthQuota
Get
Return _global_PolicyQuota
End Get
End Property
''' <summary>
''' Gets the Mail policy quota.
''' </summary>
''' <value></value>
''' <returns></returns>
''' <remarks></remarks>
Public ReadOnly Property Mail_PolicyQuota As BandwidthQuota
Get
Return _mail_PolicyQuota
End Get
End Property
''' <summary>
''' Gets the Web policy quota.
''' </summary>
''' <value></value>
''' <returns></returns>
''' <remarks></remarks>
Public ReadOnly Property Web_PolicyQuota As BandwidthQuota
Get
Return _web_PolicyQuota
End Get
End Property
''' <summary>
''' A method to set the policy quota for any of the policy types.
''' This method requires that you have already created/initialized
''' the BandwidthQuota.
''' </summary>
''' <param name="type">The enumerator to indicate which policy type
''' to initialize.</param>
''' <param name="bq">The instance of PolicyType to set this policy
''' to.</param>
Public Sub SetPolicy(ByVal type As PolicyType, _
ByVal bq As BandwidthQuota)
Try
Select Case type
Case PolicyType.DNS_Policy
_dNS_PolicyQuota = bq
Case PolicyType.FTP_Policy
_fTP_PolicyQuota = bq
Case PolicyType.Global_Policy
_global_PolicyQuota = bq
Case PolicyType.Mail_Policy
_mail_PolicyQuota = bq
Case PolicyType.Web_Policy
_web_PolicyQuota = bq
End Select
Catch ex As Exception
Throw
End Try
End Sub
''' <summary>
''' A method to set the policy quota for any of the policy types.
''' This method will create/initialize the BandwidthPolicy for any
''' of the policy types.
''' </summary>
''' <param name="type">The enumerator to indicate which policy
''' type to initialize.</param>
''' <param name="bandwidthIn">The bandwidth input value.</param>
''' <param name="bandwidthOut">The bandwidth output value.</param>
''' <remarks></remarks>
Public Sub SetPolicy(ByVal type As PolicyType, _
ByVal bandwidthIn As Integer, _
ByVal bandwidthOut As Integer)
Try
Select Case type
Case PolicyType.DNS_Policy
_dNS_PolicyQuota = New BandwidthQuota(bandwidthIn, bandwidthOut)
Case PolicyType.FTP_Policy
_fTP_PolicyQuota = New BandwidthQuota(bandwidthIn, bandwidthOut)
Case PolicyType.Global_Policy
_global_PolicyQuota = New BandwidthQuota(bandwidthIn, bandwidthOut)
Case PolicyType.Mail_Policy
_mail_PolicyQuota = New BandwidthQuota(bandwidthIn, bandwidthOut)
Case PolicyType.Web_Policy
_web_PolicyQuota = New BandwidthQuota(bandwidthIn, bandwidthOut)
End Select
Catch ex As Exception
Throw
End Try
End Sub
''' <summary>
''' A method which will return a formatted string indicating the
''' values of the BandwidthQuota for any of the policy types.
''' </summary>
''' <param name="type">The enumerator to indicate which policy type
''' to retrieve.</param>
''' <param name="throwIfNotInitialized">OPTIONAL: A boolean value
''' indicating whether or not to throw an exception if the policy
''' type chosen has not been initialized. Default: False.</param>
''' <returns></returns>
''' <remarks></remarks>
Public Function GetFormattedString(ByVal type As PolicyType, _
Optional ByVal throwIfNotInitialized As Boolean = False) As String
Dim retVal As String = String.Empty
Try
Dim bq As BandwidthQuota
Select Case type
Case PolicyType.DNS_Policy
If _dNS_PolicyQuota.BW_In > 0 AndAlso _dNS_PolicyQuota.BW_Out > 0 Then
bq = _dNS_PolicyQuota
With bq
retVal = _
String.Format("create DNSPolicy" & _
" -bw_in {0}" & _
" -bw_out {1}" & _
" -in_tcp_quota {2}" & _
" -in_udp_quota {3}" & _
" -in_icmp_quota {4}" & _
" -in_igmp_quota {5}" & _
" -out_tcp_quota {6}" & _
" -out_udp_quoata {7}" & _
" -out_icmp_quota {8}" & _
" -out_igmp_quota {9}", _
.BW_In, .BW_Out, .TCP_In, _
.UDP_In, .ICMP_In, .IGMP_In, _
.TCP_Out, .UDP_Out, .ICMP_Out, _
.IGMP_Out)
End With
Else
If throwIfNotInitialized Then
Throw New ArgumentException("The DNS policy has not been initialized.")
End If
End If
Case PolicyType.FTP_Policy
If _fTP_PolicyQuota.BW_In > 0 AndAlso _fTP_PolicyQuota.BW_Out > 0 Then
bq = _fTP_PolicyQuota
With bq
retVal = _
String.Format("create FTPPolicy" & _
" -bw_in {0}" & _
" -bw_out {1}" & _
" -in_tcp_quota {2}" & _
" -in_udp_quota {3}" & _
" -in_icmp_quota {4}" & _
" -in_igmp_quota {5}" & _
" -out_tcp_quota {6}" & _
" -out_udp_quoata {7}" & _
" -out_icmp_quota {8}" & _
" -out_igmp_quota {9}", _
.BW_In, .BW_Out, .TCP_In, _
.UDP_In, .ICMP_In, .IGMP_In, _
.TCP_Out, .UDP_Out, .ICMP_Out, _
.IGMP_Out)
End With
Else
If throwIfNotInitialized Then
Throw New ArgumentException("The FTP policy has not been initialized.")
End If
End If
Case PolicyType.Global_Policy
If _global_PolicyQuota.BW_In > 0 AndAlso _global_PolicyQuota.BW_Out > 0 Then
bq = _global_PolicyQuota
With bq
retVal = _
String.Format("create GlobalPolicy" & _
" -bw_in {0}" & _
" -bw_out {1}" & _
" -in_tcp_quota {2}" & _
" -in_udp_quota {3}" & _
" -in_icmp_quota {4}" & _
" -in_igmp_quota {5}" & _
" -out_tcp_quota {6}" & _
" -out_udp_quoata {7}" & _
" -out_icmp_quota {8}" & _
" -out_igmp_quota {9}", _
.BW_In, .BW_Out, .TCP_In, _
.UDP_In, .ICMP_In, .IGMP_In, _
.TCP_Out, .UDP_Out, .ICMP_Out, _
.IGMP_Out)
End With
Else
If throwIfNotInitialized Then
Throw New ArgumentException("The Global policy has not been initialized.")
End If
End If
Case PolicyType.Mail_Policy
If _mail_PolicyQuota.BW_In > 0 AndAlso _mail_PolicyQuota.BW_Out > 0 Then
bq = _mail_PolicyQuota
With bq
retVal = _
String.Format("create MailPolicy" & _
" -bw_in {0}" & _
" -bw_out {1}" & _
" -in_tcp_quota {2}" & _
" -in_udp_quota {3}" & _
" -in_icmp_quota {4}" & _
" -in_igmp_quota {5}" & _
" -out_tcp_quota {6}" & _
" -out_udp_quoata {7}" & _
" -out_icmp_quota {8}" & _
" -out_igmp_quota {9}", _
.BW_In, .BW_Out, .TCP_In, _
.UDP_In, .ICMP_In, .IGMP_In, _
.TCP_Out, .UDP_Out, .ICMP_Out, _
.IGMP_Out)
End With
Else
If throwIfNotInitialized Then
Throw New ArgumentException("The Mail policy has not been initialized.")
End If
End If
Case PolicyType.Web_Policy
If _web_PolicyQuota.BW_In > 0 AndAlso _web_PolicyQuota.BW_Out > 0 Then
bq = _web_PolicyQuota
With bq
retVal = _
String.Format("create WebPolicy" & _
" -bw_in {0}" & _
" -bw_out {1}" & _
" -in_tcp_quota {2}" & _
" -in_udp_quota {3}" & _
" -in_icmp_quota {4}" & _
" -in_igmp_quota {5}" & _
" -out_tcp_quota {6}" & _
" -out_udp_quoata {7}" & _
" -out_icmp_quota {8}" & _
" -out_igmp_quota {9}", _
.BW_In, .BW_Out, .TCP_In, _
.UDP_In, .ICMP_In, .IGMP_In, _
.TCP_Out, .UDP_Out, .ICMP_Out, _
.IGMP_Out)
End With
Else
If throwIfNotInitialized Then
Throw New ArgumentException("The Web policy has not been initialized.")
End If
End If
End Select
Catch ex As Exception
Throw
End Try
Return retVal
End Function
End Class
Public Structure BandwidthQuota
Private Enum InOut
Input
Output
End Enum
''' <summary>
''' Gets the minimum value for bandwidth.
''' </summary>
''' <remarks>Note that this is "hard-coded".</remarks>
Public Shared ReadOnly MinValue As Integer = 1
''' <summary>
''' Gets the maximum value for bandwidth.
''' </summary>
''' <remarks>Note that this is "hard-coded".</remarks>
Public Shared ReadOnly MaxValue As Integer = 40000000
Private _bW_In As Integer
Private _bW_Out As Integer
Private _tCP_In As Integer
Private _tCP_Out As Integer
Private _uDP_In As Integer
Private _uDP_Out As Integer
Private _iCMP_In As Integer
Private _iCMP_Out As Integer
Private _iGMP_In As Integer
Private _iGMP_Out As Integer
''' <summary>
''' The constructor for this structure.
''' </summary>
''' <param name="bandwidthIn">The value of the input bandwidth.</param>
''' <param name="bandwidthOut">The value of the output bandwidth.</param>
''' <remarks></remarks>
Public Sub New(ByVal bandwidthIn As Integer, _
ByVal bandwidthOut As Integer)
Try
If bandwidthIn < MinValue Then
Throw New _
ArgumentOutOfRangeException("Bandwidth In", _
"The minimum value is " & _
MinValue.ToString & _
" kBPS")
ElseIf bandwidthIn > MaxValue Then
Throw New _
ArgumentOutOfRangeException("Bandwidth In", _
"The maximum value is " & _
MaxValue.ToString & _
" kBPS")
ElseIf bandwidthOut < MinValue Then
Throw New _
ArgumentOutOfRangeException("Bandwidth Out", _
"The minimum value is " & _
MinValue.ToString & _
" kBPS")
ElseIf bandwidthOut > MaxValue Then
Throw New _
ArgumentOutOfRangeException("Bandwidth Out", _
"The maximum value is " & _
MaxValue.ToString & _
" kBPS")
Else
_bW_In = bandwidthIn
_bW_Out = bandwidthOut
ComputeValues(bandwidthIn, InOut.Input)
ComputeValues(bandwidthOut, InOut.Output)
End If
Catch ex As Exception
Throw
End Try
End Sub
''' <summary>
''' Gets the value of the input bandwidth.
''' </summary>
''' <value></value>
''' <returns></returns>
''' <remarks></remarks>
Public ReadOnly Property BW_In() As Integer
Get
Return _bW_In
End Get
End Property
''' <summary>
''' Gets the value of the output bandwidth.
''' </summary>
''' <value></value>
''' <returns></returns>
''' <remarks></remarks>
Public ReadOnly Property BW_Out() As Integer
Get
Return _bW_Out
End Get
End Property
''' <summary>
''' Gets the value for the input ICMP.
''' </summary>
''' <value></value>
''' <returns></returns>
''' <remarks></remarks>
Public ReadOnly Property ICMP_In() As Integer
Get
Return _iCMP_In
End Get
End Property
''' <summary>
''' Gets the value for the output ICMP.
''' </summary>
''' <value></value>
''' <returns></returns>
''' <remarks></remarks>
Public ReadOnly Property ICMP_Out() As Integer
Get
Return _iCMP_Out
End Get
End Property
''' <summary>
''' Gets the value for the input IGMP.
''' </summary>
''' <value></value>
''' <returns></returns>
''' <remarks></remarks>
Public ReadOnly Property IGMP_In() As Integer
Get
Return _iGMP_In
End Get
End Property
''' <summary>
''' Gets the value for the output IGMP.
''' </summary>
''' <value></value>
''' <returns></returns>
''' <remarks></remarks>
Public ReadOnly Property IGMP_Out() As Integer
Get
Return _iGMP_Out
End Get
End Property
''' <summary>
''' Gets the value for the input TCP.
''' </summary>
''' <value></value>
''' <returns></returns>
''' <remarks></remarks>
Public ReadOnly Property TCP_In() As Integer
Get
Return _tCP_In
End Get
End Property
''' <summary>
''' Gets the value for the output TCP.
''' </summary>
''' <value></value>
''' <returns></returns>
''' <remarks></remarks>
Public ReadOnly Property TCP_Out() As Integer
Get
Return _tCP_Out
End Get
End Property
''' <summary>
''' Gets the value for the input UDP.
''' </summary>
''' <value></value>
''' <returns></returns>
''' <remarks></remarks>
Public ReadOnly Property UDP_In() As Integer
Get
Return _uDP_In
End Get
End Property
''' <summary>
''' Gets the value for the output UDP.
''' </summary>
''' <value></value>
''' <returns></returns>
''' <remarks></remarks>
Public ReadOnly Property UDP_Out() As Integer
Get
Return _uDP_Out
End Get
End Property
Private Sub ComputeValues(ByVal value As Integer, _
ByVal io As InOut)
If value > 0 AndAlso value <= 5000 Then
SetValues(80, 50, 10, 10, io)
ElseIf value > 5000 AndAlso value <= 10000 Then
SetValues(75, 50, 9, 9, io)
ElseIf value > 10000 AndAlso value <= 100000 Then
SetValues(75, 50, 2, 2, io)
ElseIf value > 100000 AndAlso value <= 40000000 Then
SetValues(75, 50, 1, 1, io)
End If
End Sub
Private Sub SetValues(ByVal tcp As Integer, _
ByVal udp As Integer, _
ByVal icmp As Integer, _
ByVal igmp As Integer, _
ByVal io As InOut)
Select Case io
Case InOut.Input
_tCP_In = tcp
_uDP_In = udp
_iCMP_In = icmp
_iGMP_In = igmp
Case InOut.Output
_tCP_Out = tcp
_uDP_Out = udp
_iCMP_Out = icmp
_iGMP_Out = igmp
End Select
End Sub
End Structure
End Namespace
Still lost in code, just at a little higher level.

Similar Messages

  • Japanese characters alone are not passing correctly (passing like ??? or some unreadable characters) to Adobe application when we create input variable as XML data type. The same solution works fine if we change input variable data type to document type a

    Dear Team,
    Japanese characters alone are not passing correctly (passing like ??? or some unreadable characters) to Adobe application when we create input variable as XML data type. The same solution works fine if we change input variable data type to document type. Could you please do needful. Thank you

    Hello,
    most recent patches for IGS and kernel installed. Now it works.

  • Mozilla does not pass correctly greek letters from mailto command to email program while IE passes them correctly

    I am using windows xp greek with greek regional seetings and when I run a javascript using mailto command (either with utf-8 or iso 8859-7 encoding) , the subject and body of the message which were in Greek do not pass correctly to my email program while in IE pass correctly. Can you help me because many of the users who run the javascript are using mozilla firefox

    Hi Nancy, nice to see you again. The CSS validator showed no errors.
    The HTML validator showed irrelevant errors, e.g., missing alt tags and also the prefererence for  using UTF-8 encoding instead of the older iso-8859-1 used throughout my website (because it displays better in DW 5.5).
      The CSS validator link is quite useful, as I don't have a CSS validator in DW 5.5, unless I am missing something. For HTML validation, I can use "Shft-F6".

  • Selecting an lov parameter value sometimes not passed correctly

    When selecting a value from an LOV parameter, sometimes the parameter value doesn't seem to get passed correctly to the data template query.
    For example, let's say I have the following LOV parameter called "risk":
    Some Risk
    New Risk
    Other Risk
    Last Risk
    When I select "Some Risk", I would get correct results and when viewing the "Data" xml, I can see the parameter with the right value:
    <RISK>Some Risk</RISK>
    But when I select "New Risk" the results are incorrect and the xml shows:
    <RISK />
    as if the value was not passed as the bind parameter value for the dataset query.
    Any idea what I'm doing wrong? Is this a BIP bug or is there a workaround?

    Hi, thanks for the reply.
    The LOV is of "SQL Query" type (not fixed data) and the values were retrieved from the database.
    Supposing this was the sql query for my "risk" parameter LOV:
    select dimvaltl.GENERIC_VAL_NAME
    from GENERIC_VAL_TL dimvaltl,
    GENERIC_TL dimtl
    where dimtl.GENERIC_NAME = 'Risk'
    and dimvaltl.GENERIC_ID = dimtl.GENERIC_ID
    order by dimvaltl.GENERIC_VAL_NAME
    And supposing this was the sql query in the data template dataset:
    select pdimv.ID
    from GENERIC_V pdimv
    where pdimv.NAME = 'Risk'
    and pdimv.VALUE in (:risk)))
    If risk is empty, obviously the query would not work. I noticed the xml generated sometimes show the selected parameter value and sometimes don't, as if BIP is not passing it to the dataset query as bind parameter value.
    Incidentally I have other lov parameters that works fine, the only difference I can think of is that for this LOV query I am doing a join instead of a simple select statement from one table.

  • Dynamic Select List not displaying correct value

    Hi there!
    I have a page with a dynamic repeat region.
    As I press one record I get up all the details based on id on an edit page.
    The problem is that the info that is inserted via a Select List is not displaying correct on edit page.
    All the other values are correct, also the values in the repeat region on index page,
    but the value from the Select List on edit page is just displaying the initially selected item.
    Have tried using SELECT DISTINCT in the SQL statement, but no luck.
    Any other ideas?
    Cut and paste from form:
    <select name="Vegtype" class="ProvDet" id="Vegtype" title="<%=(rsAs.Fields.Item("VegType").Value)%>">
                        <option value="Ev" selected="selected">Ev</option>
                        <option value="Fv">Fv</option>
                        <option value="Rv">Rv</option>
                        <option value="Kv">Kv</option>
                      </select>
    Recordset
    <%
    Dim rsAs
    Dim rsAs_cmd
    Dim rsAs_numRows
    Set rsAs_cmd = Server.CreateObject ("ADODB.Command")
    rsAs_cmd.ActiveConnection = MM_LabCon_STRING
    rsAs_cmd.CommandText = "SELECT DISTINCT DatoM, DatoR, DatoU, Distr, FagFelt, Felt, IntNr, Km, KontrNr, Kontrollor, Masse, MasseBK, Punkt, Resept, TestID, UserID, VegHp, VegNavn, VegNr, VegType FROM tblTest WHERE TestID = ?"
    rsAs_cmd.Prepared = true
    rsAs_cmd.Parameters.Append rsAs_cmd.CreateParameter("param1", 5, 1, -1, rsAs__MMColParam) ' adDouble
    Set rsAs = rsAs_cmd.Execute
    rsAs_numRows = 0
    %>
    Regards,
    Christian
    DWCS5 | .Asp | MS Access

    Ok, here goes the top down approach...
    In the HTML header of my page, i have this reference to a js file containing the javascript - <script src="#WORKSPACE_IMAGES#108.js" type="text/javascript"></script>
    Then in an HTML Region I have the following code to create the divs that will be shown and hidden - <div id="divREGION" class="divs">Select region to get list of countries.</div>
    <div id="divCOUNTRY" class="divs">Select country to get list of cities.</div>
    <div id="divCITY" class="divs">Select city and then press "Get Employees". </div>
    Note that these divs contain static content. You may be able to create dynamic content for these divs by creating dynamic query regions and putting div tags around the region (i havent tried this, it may require template modification).
    The select boxes have this code in the "HTML form elements attributes" - onFocus="javascript:showHideDiv(this,true)" onBlur="javascript:showHideDiv(this,false)"
    This onFocus and onBlur call the showHideDiv() function, passing in the object reference of the select box and a true/false to show/hide the related div.
    The actual javascript function that is contained in the 108.js file is:
    function showHideDiv(objThis, inBool){
         var divid = "div" + objThis.id.substring(3);
         if (inBool) {
         ShowDiv(divid);
         else {
    HideDiv(divid);
    That function in turn calls either the ShowDiv() or HideDiv() functions, depending on the true or false, passing in the ID of the div to be changed...
    function ShowDiv(divid){
         eval('document.all'+ '["' + divid + '"]' + '.style' +'.display = "inline"');
    function HideDiv(divid){
         eval('document.all'+ '["' + divid + '"]' + '.style' +'.display = "none"');
    Hope this helps.

  • Parameter is not passed correct to BSP in UWL..??

    Hi Workflow and Portal Gurus,
      i try to call BSP App from a Workitem in UWL, this works fine as far.
      now i also pass a Parameter from my apprisal Workitem (Document-ID) -> as ID to the BSP Page, my Problem is that the Parameter is passed but the first 2 charecters in the parameter ID are not passed through...any idea why??
    e.g.: Correct parameter: 0123456789, but this Parameter is passed: 23456789 (without 01).
    Here is my XML File uploaded in UWL:
    <?xml version="1.0" encoding="utf-8"?>
    <!DOCTYPE UWLConfiguration PUBLIC '-//SAP//UWL1.0//EN'
    'uwl_configuration.dtd' [ ]>
    <UWLConfiguration>
    <ItemTypes>
    <ItemType name="uwl.task.webflow.TS12300110.SAP_HR_200" connector="WebFlowConnector"
    defaultView="DefaultView" defaultAction="launchSAPAction" executionMode="optimistic">
    <ItemTypeCriteria connector="WebFlowConnector" externalType="TS12300110" />
    <CustomAttributes>
    <CustomAttributeSource id="ABAP_BOR" objectIdHolder="externalObjectId" objectType="APPR_DOC"
    cacheValidity="final">
    <Attribute name="ID" type="string" displayName="ID"/>
    </CustomAttributeSource>
    </CustomAttributes>
    <Actions>
    <Action name="launchSAPAction" handler="SAPAppLauncher" returnToDetailViewAllowed="yes"
    launchInNewWindow="yes">
    <Properties>
    <Property name="SAPIntegrator" value="pcd:portal_content/com.xxxxxxxxxxxperformance_management_document_1" />
    <Property name="DynamicParameter" value="ID=${item.ID}"/>
    </Properties>
    <Descriptions default="" />
    </Action>
    </Actions>
    </ItemType>
    </ItemTypes>
    </UWLConfiguration>

    the solution.
    You need to make specific changes in xml file for each task by adding customer parameter.
           <CustomAttributes>
              <CustomAttributeSource id="ABAP_BOR" objectIdHolder="externalObjectId" objectType="APPR_DOC" cacheValidity="final">
               <Attribute name="PlanVersion" type="string" displayName="Plan Version"/>
              <Attribute name="ID" type="string" displayName="Appraisal ID"/>
              <Attribute name="PartID" type="string" displayName="Part ID"/>
              </CustomAttributeSource>
           </CustomAttributes>
    Also you need to add dynamic parameter.
                   <Property name="DynamicParameter" value="ID=${item.PlanVersion}${item.ID}${item.PartID}X"/>

  • NSV w/RT FIFO Read does not return correct value

    I have a cRIO which is hosting a NSV w/ RT FIFO enabled.  I can observe its value in the DSM.
    I have a LabVIEW exe that reads this NSV with a SV node on the diagram.  This read value is incorrect.
    If a run the same vi from the development environment then the correct value is read.  If I remove the RT FIFO option then 
    the exe version will work correctly.  According to the NI SV white paper, each reader of a NSV w RT FIFO recieves its own
    client side buffer so there should not be any interference.  It should be mentioned that I am also creating a SV reference to this same NSV on the cRIO
    for read only use.

    Hello,
    Have you tried using a Network Published shared variable to communicate between the host and target? This architecture would use a Network Published Shared Variable in a normal priority loop to pass data to a Single Process RT FIFO enabled shared variable on the target to move data to the time critical loop. Is the cRIO that you are accessing the only one present on the network? Also,. if you slow down your loop speeds, do you get correct values?
    -Zach
    Certified LabVIEW Developer

  • Stock Ledger Report in Day Wise not giving correct values for Opening Stock

    Dear Experts,
    I m working on Sock ledger report to give the day wise data.
    since yesterdays closing Stock will become opening stock of today,
    To get Opening Stock,
    I have restricted the stock key figure with 2 variables on calday        
                                  (DATE FROM var with <=(Lessthan or equal to) and offset -1
                                   DATE TO      var with <=(Lessthan or equal to) and offset -1)
    To get Closing Stock,
    I have restricted the Stock key figure with 2 variables on calday        
                                  (DATE FROM var with <=(Lessthan or equal to)
                                   DATE TO      var with <=(Lessthan or equal to) )
    But in the output Opening stock values are not coming correctly and for given range of dates,
    for last date, opening stock is showing as Zero.
    Could you please tell me how can I achieve the correct values for opening stock.
    Thanks in advance.

    Hi Arjun,
    Seems like you are making it more complicated. What is your selection screen criteria?
    Ideally you should only use the offset.
    You will have say Calday in rows and stock in Column
    ____________Opening Stock_____________Closing Stock
    01/06/2009___(Closing stock of 31/05/2009)_(Stock of 01/06/2009)
    02/06/2009___(Closing stock of 01/06/2009)_(Stock of 02/06/2009)
    03/06/2009___(Closing stock of 02/06/2009)_(Stock of 03/06/2009)
    So, from above scenario, create one RKFs and include Calday in it. Create a replacement path variable on calday and apply the offset as -1.
    So, your Opening Stock will be calculated by closign stock of previous day.
    - Danny

  • Filters 'OR' function not passing the values to the sql

    Hi,
    I am facing an issue with the 'OR' function on the filters that are used in the reports.
    The report needs to fetch all the records on the three tables as the user enters the value in the dashboard prompts.
    eg: [   update_dt_A1 is prompted
    and user_name_A1 is prompted ]
    or
    [    update_dt_B1 is prompted
    and user_name_B1 is prompted ]
    or
    [    update_dt_C1 is prompted
    and user_name_C1 is prompted ]
    The values entered in the dashboard prompt gets passed to the filter, but the vaules are not passed over to the SQL that runs on the database, hence the reports shows all values and does not reflect the values entered.
    When the 'OR' function is replaced with 'AND' the values get passed to the SQL.
    Can anyone help on what is the issue on the filters?
    Thanks

    Here is how my Filters are set up
    Vendor Name is Prompted
    AND
    Vendor Number is Prompted
    AND
    [   [Last_update_date_Vendor is prompted
    AND
    User_name_Vendor is prompted]
    OR
    [Last_update_date_Site is prompted
        AND
        User_name_Site is prompted]
    OR
    [Last_update_date_Bank is prompted
        AND
        User_name_Bank is prompted]
    The values from the dashboard prompts gets passed to the filter, but the sql that runs does not take the values in the where clause.

  • Drill Down are not giving correct values

    Hi
    We created sales Order values as a character and putting them in Rows and populating data by writing update rule. We created variables on calendar month in order to choose specific period of data in the query. For example if we need 02/2008 to 0/42008 which gives two months of data. When I drill down on Sales Order or billing document on the report it’s not giving variable interval data instead it’s pulling all the sales orders and billing documents in the Cube. With out drilling down the values are showing OK.  If I restrict with same period in the cube it's giving correct values
    Please let us know if you have any ideas.
    Thanks
    Naga

    Aah, I guessed it correctly!
    Remove the local var of the Stop button & place the terminal itself inside the inner while loop & directly wire it to the conditional terminal of the outer while loop.
    Please see the attached pic...
    Message Edited by parthabe on 07-30-2009 07:12 AM
    - Partha
    LabVIEW - Wires that catch bugs!
    Attachments:
    arrayreq_mod.jpg ‏97 KB
    arrayreq_mod.jpg ‏97 KB
    arrayreq_mod.jpg ‏99 KB

  • BI Query with Hierarchy in VC does not get correct values

    Hello Gurus,
    I am building a model in VC for Performance Score card using Query as data service.
    I have  the following problem.
    When I execute query in BEx with Hierachy_node variable , it is getting correct values, but the same is getting incorrect values in VC.
    The Hierarcynode variable I am using is a TOP node, then the values including child nodes are also should be displayed, which is working fine with BEx query but not in VC.
    When I execute the query with hierarchy node value as child node I am getting correct values both in VC and in BEx.
    The correct values are not shown only when I use top nodes.
    Please help me in this regard.
    Thanks in advance
    Ganesh

    Hi
    We are facing the same issue. Is this issue resolved? Pls let us know the solution
    Regards
    Aruna

  • JComboBox setSelectedIndex not displaying correct value

    Hi,
    Not sure if this is a bug or implementation issue.
    When trying to use the setSelectedItem(int) method of JComboBox, what's being displayed in the panel is not the same item that is selected when you open the dropdown.
    If you run the example code below a few times in a row you'll see that it eventually displays something other than "Item 2". However, if you open the combobox it will always display the correct value. So, just on a whim I surrounded the setSelectedIndex(int) call with the SwingUtilities.invokeLater method and it all started to work. I was able to run it 6 times in a row and always displayed the correct value. Whereas without it usually by the 3rd run, I'd see the issue.
    So, my question is - Should I be putting all setSelectedXXX() methods in SwingUtilities.invokeLater methods? We originally found this issue in our JApplets. I made the code below so I could post it, but essentially it's the same thing. We do use Javascript to call back into the JApplet to set the indexes. I'm guessing I DO need to since we're dealing with different Threads and Swing?
    Thanks,
    - Tim
    import java.util.logging.Level;
    import java.util.logging.Logger;
    import javax.swing.JComboBox;
    import javax.swing.JFrame;
    import javax.swing.JScrollPane;
    import javax.swing.SwingUtilities;
    * To change this template, choose Tools | Templates
    * and open the template in the editor.
    * @author tmulle
    public class Test {
        public static void main(String[] args) {
            // Create the Frame
            JFrame f = new JFrame();
            final JComboBox combo = new JComboBox();
            // Add some items to the combo
            for (int x = 0; x < 20; x++) {
                combo.addItem("Item " + x);
            // Create a scrollpane
            JScrollPane pane = new JScrollPane(combo);
            f.getContentPane().add(pane);
            f.setSize(300, 200);
            f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            // Tester thread
            Thread t = new Thread(new Runnable() {
                public void run() {
                    try {
                        Thread.sleep(5000);
                    } catch (InterruptedException ex) {
                        Logger.getLogger(Test.class.getName()).log(Level.SEVERE, null, ex);
                    // Uncomment this and things seem to work consistently
    //                SwingUtilities.invokeLater(new Runnable() {
    //                    public void run() {
    //                        combo.setSelectedIndex(2);
                    // Comment this out when uncommenting above
                    // This is supposed to select the 2 index in the list
                    // However, run running the example multiple times you'll see
                    // that it sometimes displays something other than the correct
                    // value. But the correct items is selected in the dropdown
                    combo.setSelectedIndex(2);
            // Start the thread
            t.start();
            // Show the frame
            f.setVisible(true);
    }

    You do need to set the selected index from the EDT, as shown in the code you commented out. Or, the SwingWorker class is very useful for simplifying your threading code.
    Also, if I may, I think Darryl is suggesting you also create the gui components in the EDT as well. People often use this construct in the main method since the main method is run in a separate thread from the EDT, just like the threads you create. It is technically not safe to make Swing calls from the main() method.
    public static void main(String args[])
            SwingUtilities.invokeLater(new Runnable()
                public void run()
                    createAndShow();
    }Edited by: mpmarrone on Apr 27, 2010 1:08 PM

  • MessageChoice does not return correct value

    Hi
    I am problem with MessgeChoiceBean's improver beharior
    For the first time it retunrs blank and subsequently In one page if I select Yes, it returns No.
    In another page it does not return any thing for the first two selections. And I reciev flip values.
    I ran VO outside, VO is returning correct values.
    MessageChoice attributes and associated PPR:
    Data Type: Varchar2
    Initial Value: N
    Pick List view Definition: oracle.apps.xxx.docs.common.lov.server.YesNoVO
    Pick List View Instance: YesNoVO3
    Pick List Display Attribute: Meaning
    Pick List Value AttributeL LookupCode
    ActionType: firePartialAction
    Event: handleNewLocationFlagChange
    Parameter Name: newLocationFlag
    Parameter Value: ${oa.CustomerInfoVO1.NewShipToLocationFlag}
    ProcessParameterForm Code:
    if ("handleNewLocationFlagChange".equals(event))
    String newLocationFlag = pageContext.getParameter("newLocationFlag");
    Serializable[] parameters = { ""+newLocationFlag};
    Class[] paramTypes = { String.class};
    am.invokeMethod("handleNewLocationFlagChange", parameters, paramTypes);
    VO definition:
    select LOOKUP_CODE,MEANING
    FROM ONLINE_DOCS_LOOKUPS
    WHERE ONLINE_DOCUMENT_CODE = 'ALL'
    AND LOOKUP_TYPE = 'YESNO'
    ORDER BY ATTRIBUTE1
    View output:
    LOOKUP_CODE     MEANING
    N     No
    Y     Yes
    I have quite a bit number of columns to change render property.
    Any help will be appreciated.
    Thanks
    Prasad

    Your question is not clear, are you saying the values in the messageChoiceBean is not displayed properly. As far as I can see from the definition the poplist picks the values from a lookup(Yes, No) values and has a PPR action associated with it. Did you check what this method handleNewLocationFlagChange is doing in the AM ?

  • Not getting correct values in ODS

    BW gurus
      when i do delta loads for ODS i am getting strange values into my ods.How ever if i do full loads on ods ,i am getting correct values(same values as RSA3).
    1 .Any idea why i am getting wrong values if i do delta   loads .
    2.If i make this ods as full load(currently delta) ,there are already few reports on this ods ,Will there be any effect on those reports?

    Riccardo,Tony
    Thanks for your quick reply.
    I have in ods as follows
    Asset  fisper   qty
      1     006.2006   2
      1     007.2006   3
    Now i have added 2 more assets to period 6
    in RSA3 is ok as follows
    Asset  fisper   qty
      1     006.2006   4
      1     007.2006   3
    In ods with delta load is  not ok as follows
    Asset  fisper   qty
      1     006.2006   9
      1     007.2006   3
    In ods with full load is OK as follows
    Asset  fisper   qty
      1     006.2006   4
      1     007.2006   3
    any advice greatly appreciated

  • PO query not giving correct values

    Hi
    I am running the following query in PL?SQL Developer
    SELECT hou.name Operating_unit,
           pha.segment1 po_number,
           pha.revision_num,
           ap.vendor_name,
           hla1.location_code,
           papf.full_name Buyer,
           to_char(pha.creation_date, 'DD-MON-RRRR HH24:MI:SS') creation_date,
           pdta.type_name,
           assa.vendor_site_code,
           hla2.location_code,
           initcap(pha.authorization_status) po_status,
           pha.currency_code,
           pla.line_num,
           pltt.line_type,
           msib.segment1 item,
           (mcb.segment1 || '.' || mcb.segment1) category,
           msib.description,
           msib.primary_unit_of_measure UOM,
           pla.quantity,
           pla.unit_price,
           (pla.quantity * pla.unit_price) amount,
           (gcc.segment1 || '-' || gcc.segment2 || '-' || gcc.segment3 || '-' ||
           gcc.segment4 || '-' || gcc.segment5) charge_account,
           pla.list_price_per_unit,
           at.name,
           pha.freight_terms_lookup_code,
           pha.fob_lookup_code,
           initcap(pha.pay_on_code) pay_on_code,
           pha.acceptance_required_flag,
           ood.organization_code,
           ood.organization_name,
           msib.primary_unit_of_measure UOM,
           pla.quantity,
           plla.country_of_origin_code,
           (gcc.segment1 || '-' || gcc.segment2 || '-' || gcc.segment3 || '-' ||
           gcc.segment4 || '-' || gcc.segment5) charge_account,
           (pla.quantity * pla.unit_price) amount,
           plla.receive_close_tolerance,
           plla.invoice_close_tolerance,
           plla.quantity,
           plla.quantity_received,
           plla.quantity_cancelled,
           plla.quantity_billed,
           plla.match_option,
           plla.accrue_on_receipt_flag,
           plla.enforce_ship_to_location_code,
           plla.days_early_receipt_allowed,
           plla.days_late_receipt_allowed,
           plla.receipt_days_exception_code,
           plla.qty_rcv_tolerance,
           initcap(plla.qty_rcv_exception_code),
           plla.allow_substitute_receipts_flag,
           plla.receiving_routing_id,
           plla.enforce_ship_to_location_code,
           initcap(pda.destination_type_code),
           papf.full_name requestor,
           hla3.location_code,
           --pda.quantity_ordered,  -- commented because giving wrong value
           (select quantity_ordered
              from po_distributions_all
             where po_header_id IN (select po_header_id
                                      from po_headers_all
                                     where segment1 = pha.segment1)) quantity_ordered, -- Added
           (gcc.segment1 || '-' || gcc.segment2 || '-' || gcc.segment3 || '-' ||
           gcc.segment4 || '-' || gcc.segment5) po_charge_account,
           haou.name,
           prha.segment1,
           prla.line_num,
           to_char(prla.rate_date, 'DD-MON-RRRR') rate_date,
           (gcc.segment1 || '-' || gcc.segment2 || '-' || gcc.segment3 || '-' ||
           gcc.segment4 || '-' || gcc.segment5) po_charge_account,
           (SELECT acc.segment1 || '-' || acc.segment2 || '-' || acc.segment3 || '-' ||
                   acc.segment4 || '-' || acc.segment5
              FROM gl_code_combinations acc
             WHERE acc.code_combination_id = pda.accrual_account_id) accrual_account,
           (SELECT acc.segment1 || '-' || acc.segment2 || '-' || acc.segment3 || '-' ||
                   acc.segment4 || '-' || acc.segment5
              FROM gl_code_combinations acc
             WHERE acc.code_combination_id = pda.variance_account_id) variance_account,
           pla.line_num,
           plla.shipment_num,
           ood.organization_code,
           ood.organization_name,
           msib.segment1,
           msib.description,
           pla.quantity
      FROM hr_operating_units           hou,
           po_headers_all               pha,
           ap_suppliers                 ap,
           hr_locations_all             hla1,
           per_all_people_f             papf,
           po_document_types_all        pdta,
           po_document_types_all_b      pdtab,
           ap_supplier_sites_all        assa,
           hr_locations_all             hla2,
           po_lines_all                 pla,
           po_line_types_b              pltb,
           po_line_types_tl             pltt,
           mtl_system_items_b           msib,
           po_line_locations_all        plla,
           mtl_categories_b             mcb,
           po_distributions_all         pda,
           gl_code_combinations         gcc,
           ap_terms                     at,
           org_organization_definitions ood,
           hr_locations_all             hla3,
           po_requisition_headers_all   prha,
           po_req_distributions_all     prda,
           po_requisition_lines_all     prla,
           hr_all_organization_units_tl haou
    WHERE 1 = 1
       AND pha.segment1 = '6395'        --&po_number
       AND hou.organization_id = 204    --&operating_unit
       AND hou.organization_id = pha.org_id
       AND pha.vendor_id = ap.vendor_id
       AND hla1.location_id = pha.ship_to_location_id
       AND papf.person_id = pha.agent_id
       AND SYSDATE BETWEEN papf.effective_start_date AND papf.effective_end_date
       AND ((pdtab.document_type_code IN ('PO', 'PA') AND
           pdtab.document_subtype = pha.type_lookup_code))
       AND pdta.document_subtype = pdtab.document_subtype
       AND pdta.document_type_code = pdtab.document_type_code
       AND pdta.org_id = Pdtab.org_id
       AND pha.org_id = pdta.org_id
       AND ap.vendor_id = assa.vendor_id
       AND pha.org_id = assa.org_id
       AND pha.vendor_id = assa.vendor_id
       AND pha.vendor_site_id = assa.vendor_site_id
       AND pha.bill_to_location_id = hla2.ship_to_location_id
       AND pla.po_header_id = pha.po_header_id
       AND pltb.line_type_id = pla.line_type_id
       AND pla.line_type_id = pltt.line_type_id
       AND pltt.language = USERENV('LANG')
       AND msib.inventory_item_id = pla.item_id
       AND plla.po_line_id = pla.po_line_id
       AND msib.organization_id = plla.ship_to_organization_id
       AND mcb.category_id = pla.category_id
       AND pda.po_line_id = pla.po_line_id
       AND pda.po_header_id = pha.po_header_id
       AND pda.code_combination_id = gcc.code_combination_id
       AND at.term_id = pha.terms_id
       AND ood.organization_id = plla.ship_to_organization_id
       AND pda.deliver_to_person_id = papf.person_id
       AND hla3.location_id = pda.deliver_to_location_id
       AND haou.organization_id = prha.org_id
       AND haou.language = USERENV('LANG')
       AND prha.org_id = pha.org_id
       AND prha.requisition_header_id = prla.requisition_header_id
       AND pda.req_distribution_id = prda.distribution_id
       AND prda.requisition_line_id = prla.requisition_line_id
       AND haou.organization_id = hou.organization_id
       AND prla.org_id = pha.org_id
       AND prda.code_combination_id = gcc.code_combination_id    --added
       AND hla3.inventory_organization_id = msib.organization_id   --added
       AND pda.line_location_id = prla.line_location_id  --added
       AND plla.po_header_id = pha.po_header_id  --added
    I tested it for 10 POs. for 2 the query is giving right value. but for others it is giving wrong value.
    Mainly the PO Charge Account, accrual and variance account values are not matching. What changes I can make to get the correct data?
    I am using r12 version
    Thanks

    Hi Srini,
    Thanks for replying. I check and the application context is set.
    I think we might be missing certain conditions. Can you help me with that.

Maybe you are looking for

  • Insert/Delete in a servlet to dbase  - URGENT!!

    I have an urgent question. If I use a query to select from values based on a variable from a JSP (subject code)...... and then based on the values returned by this query (i.e code, year and semester,unit) I then want to add/delete these values to a n

  • E-mail addresses in Apple Mail not showing up in Apple Contacts (iCloud All Contacts)

    I've been going though my contacts in the Apple Contacts app, which I have set up to use iCloud, deleting old contacts and cleaning up messy ones. And I've noticed there are a lot of e-mail addresses that I have in Apple Mail - I just start to type a

  • WIP Report in CO does not reconcile with FI

    Hi All, I currently facing an issue related to reconciling WIP in FI and CO. There seems to be a single production order that is not reflected in FI.  It is not the same production order but rather a new one every month.  It is very easy to isolate b

  • WL6.1 Stub bug ?

    Hello, can someone help me ? Thanks in advance I have this exception : weblogic.utils.AssertionError: ***** ASSERTION FAILED *****[ must initialize before invoke ] at weblogic.utils.Debug.assert(Debug.java:84) at weblogic.rmi.cluster.ReplicaAwareRemo

  • Error message said I did not have authority to download Adobe Flash Player

    In updating Adobe Flash Player an error message said I did not have authority to download it. I am listed as Administrator through the control panel and have been doing this for years! What do I do?