Switch Expression
=Switch(Fields!SALES_ORDER_LINE_NO.Value <> 1 AND Fields!SALES_ORDER_LN_MILLING_DESC.Value Like "*FMC*", Fields!SALES_ORDER_LN_SHIPPED_PART_DESC.Value, Fields!SALES_ORDER_LN_MILLING_DESC.Value & "FSC MIXED CREDIT", Fields!SALES_ORDER_LINE_NO.Value
<> 1 AND Fields!SALES_ORDER_LN_MILLING_DESC.Value Like "*FSC*", Fields!SALES_ORDER_LN_SHIPPED_PART_DESC.Value, Fields!SALES_ORDER_LN_MILLING_DESC.Value & "100% PURE")
If the string for this field contains FMC, then I want to concatenate FSC MIXED CREDIT to the field based on the value of the first field, if FSC, then 100% PURE.
The following works in an IIF statement, but I need to evaluate two different scenarios...FMC and FSC.
=iif(Fields!SALES_ORDER_LINE_NO.Value <> 1 AND Fields!SALES_ORDER_LN_MILLING_DESC.Value Like "*FMC*", Fields!SALES_ORDER_LN_SHIPPED_PART_DESC.Value, Fields!SALES_ORDER_LN_MILLING_DESC.Value & "FSC MIXED CREDIT")
Hi Rex,
As per my understanding, if the field SALES_ORDER_LN_MILLING_DESC contains “FMC”, you want to concatenate “FSC MIXED CREDIT” to the field. If it contains “FSC”, then concatenate “100% PURE” to the field, else returns SALES_ORDER_LN_SHIPPED_PART_DESC field.
We have two ways to achieve your goal:
If we want to use Switch function, please refer to the expression below:
=Switch(Fields!SALES_ORDER_LINE_NO.Value <> 1 AND Fields!SALES_ORDER_LN_MILLING_DESC.Value Like "*FMC*", Fields!SALES_ORDER_LN_MILLING_DESC.Value & "FSC MIXED CREDIT", Fields!SALES_ORDER_LINE_NO.Value <> 1 AND Fields!SALES_ORDER_LN_MILLING_DESC.Value Like "*FSC*", Fields!SALES_ORDER_LN_MILLING_DESC.Value & "100% PURE",
True, Fields!SALES_ORDER_LN_SHIPPED_PART_DESC.Value)
If we want to use a nested IIF function, please refer to the expression below:
=iif(Fields!SALES_ORDER_LINE_NO.Value <> 1 AND Fields!SALES_ORDER_LN_MILLING_DESC.Value Like "*FMC*", Fields!SALES_ORDER_LN_MILLING_DESC.Value & "FSC MIXED CREDIT",
iif(Fields!SALES_ORDER_LINE_NO.Value <> 1 AND Fields!SALES_ORDER_LN_MILLING_DESC.Value Like "*FSC*",Fields!SALES_ORDER_LN_MILLING_DESC.Value & "100% PURE",Fields!SALES_ORDER_LN_SHIPPED_PART_DESC.Value))
For more information about Switch and IIF functions, please refer to the following article:
http://technet.microsoft.com/en-us/library/ms157328(v=SQL.105).aspx
If you have any more questions, please feel free to ask.
Thanks,
Wendy Fu
Similar Messages
-
Cisco 2950 - 24 WS switch express install issue
Hi Guys,
Got a Cisco 2950 24 port switch that I need to setup and I can't seem to get the page for Express install
In firefox when trying to connect to 10.0.0.1 I get the message "connection was reset" in internet explorer "page cannot be displayed"
when doing a arp -a I can see that the switch does get the IP address 10.0.0.1 and I can also ping the switch ok.
Have followed the instructions and reset the switch and all the mode lights are green etc.
my ethernet adapter does get the address 10.0.0.2 given from the switch (however connectivity is limited / not sure if this is supposed to be like this or not)
have tried earlier versions of firefox (even 1x 2x 3x 4x) etc and also older versions of IE incase there is something weird going on there. have also tried using a mac and trying safari which gives similar results.
So i think the http server is enabled on the switch, as it should be by default when it is reset etc. according to cisco's documentation.
I know using the console cable would be alot easier however I don't have one available and not easy for me to get
any ideas? has anyone ever successfully been able to use this express install web page on a cisco 2950 before? It has Version 12.1(22)EA14 so express install should work on this switch!
cheers,managed to get hold of a console cable. checked switch and http-server command was enabled so have no idea why this feature was not working...
did some research and someone suggested that it is fussy with the version of java you are running on the pc ( requires old version of java?) .. possibly that may have an influence who knows?
Think ill just carry around a Console cable in future! -
Using a Switch statement for Infix to Prefix Expressions
I am stuck on the numeric and operator portion of the switch statement...I have the problem also figured out in an if/else if statement and it works fine, but the requirements were for the following algorithm:
while not end of expression
switch next token of expression
case space:
case left parenthesis:
skip it
case numeric:
push the string onto the stack of operands
case operator:
push the operator onto the stack of operators
case right parenthesis:
pop two operands from operand stack
pop one operator from operator stack
form a string onto operand stack
push the string onto operand stack
pop the final result off the operand stack
I know that typically case/switch statement's can only be done via char and int's. As I said I am stuck and hoping to get some pointers. This is for a homework assignment but I am really hoping for a few pointers. I am using a linked stack class as that was also the requirements. Here is the code that I have:
import java.io.*;
import java.util.*;
import java.lang.*;
/*--------------------------- PUBLIC CLASS INFIXTOPREFIX --------------------------------------*/
/*-------------------------- INFIX TO PREFIX EXPRESSIONS --------------------------------------*/
public class infixToPrefix {
private static LinkedStack operators = new LinkedStack();
private static LinkedStack operands = new LinkedStack();
// Class variable for keyboard input
private static BufferedReader stdin = new BufferedReader(new InputStreamReader(System.in));
// Repeatedly reads in infix expressions and evaluates them
public static void main(String[] args) throws IOException {
// variables
String expression, response = "y";
// obtain input of infix expression from user
while (response.charAt(0) == 'y') {
System.out.println("Enter a parenthesized infix expression."); // prompt the user
System.out.println("Example: ( ( 13 + 2 ) * ( 10 + ( 8 / 3 ) ) )");
System.out.print("Or as: ((13+2)*(10+(8/3))): ");
expression = stdin.readLine(); // read input from the user
// output prefix expression and ask user if they would like to continue
System.out.println("The Prefix expression is: " + prefix(expression)); // output expression
System.out.println("Evaluate another? y or n: "); // check with user for anymore expressions
response = stdin.readLine(); // read input from user
if (response.charAt(0) == 'n') { // is user chooses n, output the statement
System.out.println("Thank you and have a great day!");
} // end if statement
} // end while statement
} // end method main
/*------------- CONVERSION OF AN INFIX EXPRESSION TO A PREFIX EXPRESSION ------------*/
/*--------------------------- USING A SWITCH STATEMENT ------------------------------*/
private static String prefix(String expression) {
// variables
String symbol, operandA, operandB, operator, stringA, outcome;
// initialize tokenizer
StringTokenizer tokenizer = new StringTokenizer(expression, " +-*/() ", true);
while (tokenizer.hasMoreTokens()) {
symbol = tokenizer.nextToken(); // initialize symbol
switch (expression) {
case ' ':
break; // accounting for spaces
case '(':
break; // skipping the left parenthesis
case (Character.isDigit(symbol.charAt(0))): // case numeric
operands.push(symbol); // push the string onto the stack of operands
break;
case (!symbol.equals(" ") && !symbol.equals("(")): // case operator
operators.push(symbol); // push the operator onto the stack of operators
break;
case ')':
operandA = (String)operands.pop(); // pop off first operand
operandB = (String)operands.pop(); // pop off second operand
operator = (String)operators.pop(); // pop off operator
stringA = operator + " " + operandB + " " + operandA; // form the new string
operands.push(stringA);
break;
} // end switch statement
} // end while statement
outcome = (String)operands.pop(); // pop off the outcome
return outcome; // return outcome
} // end method prefix
} // end class infixToPrefixAny help would be greatly appreciated!so, i did what flounder suggested:
char e = expression.charAt(0);
while (tokenizer.hasMoreTokens()) {
symbol = tokenizer.nextToken(); // initialize symbol
switch (e) {
case ' ':
break; // accounting for spaces
case '(':
break; // skipping the left parenthesis
case '0':
case '1':
case '2':
case '3':
case '4':
case '5':
case '6':
case '7':
case '8':
case '9':
operands.push(symbol); // push the string onto the stack of operands
break; // case numeric
case '+':
case '-':
case '*':
case '/':
operators.push(symbol); // push the operator onto the stack of operators
break; // case operator
case ')':
operandA = (String)operands.pop(); // pop off first operand
operandB = (String)operands.pop(); // pop off second operand
operator = (String)operators.pop(); // pop off operator
stringA = operator + " " + operandB + " " + operandA; // form the new string
operands.push(stringA);
break;
default:
} // end switch statement
} // end while statement
outcome = (String)operands.pop(); // pop off the outcome
return outcome; // return outcomeafter this, I am able to compile the code free of errors and I am able to enter the infix expression, however, the moment enter is hit it provides the following errors:
Exception in thread "main" java.lang.NullPointerException
at LinkedStack$Node.access$100(LinkedStack.java:11)
at LinkedStack.pop(LinkedStack.java:44)
at infixToPrefix.prefix(infixToPrefix.java:119)
at infixToPrefix.main(infixToPrefix.java:59)
Any ideas as to why? I am still looking through seeing if I can't figure it out, but any suggestions? Here is the linked stack code:
public class LinkedStack {
/*--------------- LINKED LIST NODE ---------------*/
private class Node {
private Object data;
private Node previous;
} // end class node
/*-------------- VARIABLES --------------*/
private Node top;
/*-- Push Method: pushes object onto LinkedStack --*/
public void push(Object data) {
Node newTop = new Node();
newTop.data = data;
newTop.previous = top;
top = newTop;
} // end function push
/*--- Pop Method: pop obejct off of LinkedStack ---*/
public Object pop() {
Object data = top.data;
top = top.previous;
return data;
} // end function pop
} // end class linked stackEdited by: drmsndrgns on Mar 12, 2008 8:10 AM
Edited by: drmsndrgns on Mar 12, 2008 8:14 AM
Edited by: drmsndrgns on Mar 12, 2008 8:26 AM -
i know char and integers are accepted by switch statements as arguments..
me and my friend are just wondering why the creators of java doesnt included Strings...
ex.
case "myFirstChoice":
{statement}
case "mySecondChoice":
{statement}
case "myThirdChoice":
{statement}etc
we know that we can simplify it by just using char or integer as
case 'A':
case 'B':
case 'C':or
case '1':
case '2':
case '3':we hope someone knows the answer.. thank you very much.. have a nice day!The JLS says this:
The prohibition against using null as a switch label prevents one from writing code that can never be executed. If the switch expression is of a reference type, such as a boxed primitive type or an enum, a run-time error will occur if the expression evaluates to null at run-time.
It follows that if the switch expression is of an enum type, the possible values of the switch labels must all be enum constants of that type.
Compilers are encouraged (but not required) to provide a warning if a switch on an enum-valued expression lacks a default case and lacks cases for one or more of the enum type's constants. (Such a statement will silently do nothing if the expression evaluates to one of the missing constants.) Here's the [link.|http://java.sun.com/docs/books/jls/third_edition/html/statements.html] -
Hi guys...
in the switch statement can i leave the "default: " blank without having any statement to excute ...is that ok?
.<code>switch (expression) {
case cond1: code_block_1;
case cond2: code_block_2;
case condn: code_block_n;
{color:#ff0000}default: {color}
}</code>
I don't need a else else like state ment here, but i need to specify the "default:" otherwise i'm getting a warning to add default statement ,
that;s the reason that i'm asing whether i can leave this default blank?
Thanks in advancedear folk,
you will be knowing how to run a java application. please write the main program put your Code (switch) in the main method and test it yourself thats the better way to understand it -
"default" mixed between "case" in switch-statement
I was surprised to see some working code today like the following :
switch (i) {
default:
return false;
case 1:
return true;
case 2:
return false;
Does somebody know if it has always been the case that a default-switch is allowed anywhere within the switch-statement without disturbing the correct use of the code (i.e. reacting correctly on values 1 or 2) ?
Or has this been changed at one point in the Java implementation (i.a.w. can I expect different behaviour on different implementations/versions of the JVM) ?
regards,
MichielI ripped the following from the Java Language Specification.
SwitchStatement:
switch ( Expression ) SwitchBlock
SwitchBlock:
{ SwitchBlockStatementGroupsopt SwitchLabelsopt }
SwitchBlockStatementGroups:
SwitchBlockStatementGroup
SwitchBlockStatementGroups SwitchBlockStatementGroup
SwitchBlockStatementGroup:
SwitchLabels BlockStatements
SwitchLabels:
SwitchLabel
SwitchLabels SwitchLabel
SwitchLabel:
case ConstantExpression :
default :As you can see, one or more 'SwitchLabels' can be associated with a 'BlockStatement'. A switchlabel can either be 'defaul' or a 'case ConstantExpression'. There is no restriction of any order of those labels imposed on those SwitchBlockStatementGroups. The paragraph following this syntax list does impose a restriction upon the 'default' label, i.e. it is allowed at most once in a switch statement.
kind regards -
Hi folks,
I would like to produce a "minimal" boolean expression in disjunctive normal form.
Something like a AND b OR c to
DNF: ab or ac
Therefor i have developed a parser which produces that normal form, but the performance decreases very much if i parse expressions with lots of variables or nested expressions like:
(a AND (b OR c OR d) AND (e OR f OR g)) OR ((b OR c OR d) AND (e OR f OR g) AND h) OR (i AND (e OR f OR g))
It lastes up to 5 seconds.
Do u know any free api, which i could use for this purpose?.
Thanks in advance.Thats the code:
package com.audatex.axn.ui.vsic.datamodel.util;
import java.util.Vector;
public class BooleanExpressionsParser
private static final Logger _logger = new Logger( JATOTest.class );
public static int nVars;
public static int nAmount;
public static String sActiveVars;
public static String sValidInput;
public boolean isK0, isK1, isKsd, isKlinear, isKmonoton;
public static boolean[] arResults;
private static CBoolFkt cBoolFkt = new CBoolFkt();
public static int format(String exp) {
int result = cBoolFkt.format(exp);
if (result == CBoolFkt.OK) {
nVars = cBoolFkt.nMinVars;
nAmount = 1 << nVars;
sActiveVars = cBoolFkt.sActiveVars.toString();
sValidInput = cBoolFkt.sValidInput.toString();
return result;
public static String doCalc() {
arResults = new boolean[nAmount];
for (int i = 0; i < nAmount; i++) {
for (int run = 0; run < nVars; run++) {
cBoolFkt.Vars[cBoolFkt.sActiveVars.charAt(run)] = isBitSet(i,
nVars - run - 1);
arResults[i] = cBoolFkt.evaluate();
return doNF();
public static String convertExpression(String boolExpression){
_logger.debug(" " + boolExpression);
int result = format(boolExpression);
String res = "";
if(result == CBoolFkt.OK){
_logger.debug("The format is O.k ,doing calculation ");
res = doCalc();
return res;
private static String doNF() {
StringBuffer sMDNF = new StringBuffer();
return doQuineMcClusky( sMDNF);
private static String doQuineMcClusky(StringBuffer sMDNF) {
Vector arConjunctions = new Vector();
Vector arUsedVars = new Vector();
Vector arMarked = new Vector();
int nUsedVarsMask = nAmount - 1;
for (int i = 0; i < nAmount; i++) {
if (arResults) {
arConjunctions.addElement(new Integer(i));
arUsedVars.addElement(new Integer(nUsedVarsMask));
arMarked.addElement(new Boolean(false));
_logger.debug("arConjunctions.size(): " + arConjunctions.size());
for (int level = 0; level < nVars; level++) {
int nConjunctions = arConjunctions.size();
if (nConjunctions <= 1) {
break;
for (int checknr = 0; checknr < nConjunctions - 1; checknr++) {
for (int comparenr = checknr + 1; comparenr < nConjunctions;
comparenr++) {
if (((Integer) arUsedVars.elementAt(checknr)).intValue() ==
((Integer) arUsedVars.elementAt(comparenr)).intValue()) {
int checkval = ((Integer) arConjunctions.elementAt(
checknr)).intValue();
int compareval = ((Integer) arConjunctions.elementAt(
comparenr)).intValue();
int DifferMask = xOrBits(checkval, compareval);
if (bitCount(DifferMask) == 1) {
arMarked.setElementAt(new Boolean(true), checknr);
arMarked.setElementAt(new Boolean(true), comparenr);
int NewConj = andBits(checkval, compareval);
int NewMask = xOrBits(DifferMask,
((Integer) arUsedVars.
elementAt(checknr)).intValue());
arConjunctions.addElement(new Integer(NewConj));
arUsedVars.addElement(new Integer(NewMask));
arMarked.addElement(new Boolean(false));
nConjunctions = arConjunctions.size();
for (int checknr = 0; checknr < nConjunctions - 1; checknr++) {
if (((Boolean) arMarked.elementAt(checknr)).booleanValue() == false) {
for (int comparenr = checknr + 1; comparenr < nConjunctions;
comparenr++) {
if (((Boolean) arMarked.elementAt(comparenr)).
booleanValue() == false) {
int checkval = ((Integer) arConjunctions.elementAt(
checknr)).intValue();
int compareval = ((Integer) arConjunctions.
elementAt(comparenr)).intValue();
int checkmask = ((Integer) arUsedVars.elementAt(
checknr)).intValue();
int comparemask = ((Integer) arUsedVars.elementAt(
comparenr)).intValue();
int maskand = andBits(checkmask, comparemask);
if (checkmask == comparemask) {
if (checkval == compareval) {
arMarked.setElementAt(new Boolean(true),
comparenr);
} else {
if ((maskand == checkmask) &&
(andBits(compareval, maskand) == checkval)) {
arMarked.setElementAt(new Boolean(true),
comparenr);
if ((maskand == comparemask) &&
(andBits(checkval, maskand) == compareval)) {
arMarked.setElementAt(new Boolean(true),
checknr);
for (int cleanup = nConjunctions - 1; cleanup >= 0; cleanup--) {
if (((Boolean) arMarked.elementAt(cleanup)).booleanValue() == true) {
arConjunctions.removeElementAt(cleanup);
arUsedVars.removeElementAt(cleanup);
arMarked.removeElementAt(cleanup);
for (int i = 0; i < arConjunctions.size(); i++)
int nUsed = ((Integer) arUsedVars.elementAt(i)).intValue();
int nConj = ((Integer) arConjunctions.elementAt(i)).intValue();
for (int run = 0; run < nVars; run++) {
if (isBitSet(nUsed, nVars - run - 1)) {
if (!isBitSet(nConj, nVars - run - 1)) {
sMDNF.append("!");
sMDNF.append(cBoolFkt.sActiveVars.charAt(run));
sMDNF.append(" | ");
// _logger.debug(arConjunctions.toString());
//_logger.debug(arUsedVars.toString());
//_logger.debug(arMarked.toString());
sMDNF.setLength(sMDNF.length() - 3);
return sMDNF.toString();
public static boolean isBitSet(int Number, int Bit) {
return (Number & (1 << Bit)) > 0;
public static int andBits(int a, int b) {
int Result = 0;
int CurrBit = 0;
while ((a > 0) || (b > 0)) {
if (isBitSet(a, 0) && isBitSet(b, 0)) {
Result += 1 << CurrBit;
CurrBit++;
a >>= 1;
b >>= 1;
return Result;
public static int xOrBits(int a, int b) {
int Result = 0;
int CurrBit = 0;
while ((a > 0) || (b > 0)) {
if (isBitSet(a, 0) != isBitSet(b, 0)) {
Result += 1 << CurrBit;
CurrBit++;
a >>= 1;
b >>= 1;
return Result;
public static int bitCount(int Number) {
int Result = 0;
while (Number > 0) {
if ((Number & 1) != 0) {
Result++;
Number >>= 1;
return Result;
* @return Returns the cBoolFkt.
public CBoolFkt getCBoolFkt() {
return cBoolFkt;
* @param boolFkt The cBoolFkt to set.
public void setCBoolFkt(CBoolFkt boolFkt) {
cBoolFkt = boolFkt;
public class CBoolFkt {
// Constants to handle exceptions
public static final int OK=0, NOTOKEN=1, UNKNOWNTOKEN=2,
NOVARS=3, VAREXPECTED=4,
BRACKETEXPECTED=5, BRACKETNOTALLOWED=6;
// max. number of diferent vbles in the boolean expression
public final int nMaxVars = 12;
// Amount of current dif. vbles in the boolean exp.
public int nMinVars;
// Name of the current bool. exp sorted by alph. order
public StringBuffer sActiveVars;
public StringBuffer sValidInput;
// Wertebelegung der Variablen by ASCII-Namen, also z.B. Vars['a']=true
public boolean[] Vars = new boolean[128];
// Name of the vbles.
final char A='a', B='b', C='c', D='d',
E='e', F='f', G='g', H='h',
I='i', J='j', K='k', L='l',
// operators
OR='|', AND='&', XOR='+', EQU='=', _NOT='!',
LOG='>', LB='(', RB=')', TRUE='1', _FALSE='0',
_END=0;
// Words that are replaced by the symbols behind
final String[] arLongNames = { "or","oder","and","und",
"xor","not","nicht","=>" };
final char[] arLongToken = { '|','|','&','&','+','!','!','>' };
private StringBuffer sExpression;
private int iExpressionCount;
private char cToken;
// Detection of no valid syntax and integration of the expression with the language
// of the parser
public int format(String expression)
boolean bForceVar = true;
int nBracketCount = 0;
sValidInput = new StringBuffer();
if (expression.length()==0)
return NOTOKEN;
// convert to lower case
expression = expression.toLowerCase();
// for replacing the key words by symbols
StringBuffer sNoLongNames = new StringBuffer(expression);
// process de convertion
for (int i=0; i<arLongNames.length; i++)
while(sNoLongNames.toString().indexOf(arLongNames[i])!=-1)
StringBuffer sTemp = new StringBuffer();
// saveing word address
int index = sNoLongNames.toString().indexOf(arLongNames[i]);
if (index>0)
sTemp.append(sNoLongNames.toString().substring(0,index));
// replacing word
sTemp.append(arLongToken[i]);
if ((index+arLongNames[i].length())<sNoLongNames.length())
sTemp.append(sNoLongNames.toString().substring(index+arLongNames[i].length()));
sNoLongNames = sTemp;
// convertion complete
expression = sNoLongNames.toString();
for (int i=0; i<expression.length(); i++)
// Testing tokens
switch(expression.charAt(i))
case ' ': continue;
// valid tokens
case FALSE:; case TRUE:;
case A:; case B:; case C:; case D:;
case E:; case F:; case G:; case H:;
case I:; case J:; case K:; case L:
// every next token ist ok
bForceVar = false;
// ok
sValidInput.append(expression.charAt(i));
break;
case _NOT:;
// the next token must be vble
bForceVar = true;
// ok
sValidInput.append(expression.charAt(i));
break;
case AND:; case OR:; case XOR:; case LOG:; case _EQU:;
if (bForceVar)
return VAREXPECTED;
// the next token must be vble
bForceVar = true;
// ok
sValidInput.append(expression.charAt(i));
break;
case _LB:;
nBracketCount++;
bForceVar = true;
// ok
sValidInput.append(expression.charAt(i));
break;
case _RB:;
if (bForceVar||(nBracketCount==0))
return BRACKETNOTALLOWED;
nBracketCount--;
// ok
sValidInput.append(expression.charAt(i));
break;
// not valid token
default: return UNKNOWNTOKEN;
if (nBracketCount!=0)
return BRACKETEXPECTED;
if (bForceVar)
return VAREXPECTED;
// Counter of the number of vbles
nMinVars=0;
sActiveVars = new StringBuffer();
// limitating pos vble names
String sAllVars = "abcdefghijkl";
// testing the vbles
int i;
for (i=0; i<nMaxVars; i++)
if (sValidInput.toString().indexOf(sAllVars.charAt(i))!=-1)
nMinVars++;
sActiveVars.append(sAllVars.charAt(i));
if (nMinVars==0)
return NOVARS;
expression = sValidInput.toString();
sExpression = sValidInput;
sExpression.append(_END);
return OK;
public boolean evaluate()
sExpression = sValidInput;
iExpressionCount = 0;
return doEqu(true);
private boolean doEqu(boolean get)
boolean left = doLog(get);
for (;;)
if (cToken==_EQU)
left=(doLog(true)==left);
else
return left;
private boolean doLog(boolean get)
boolean left = doOr(get);
for (;;)
if (cToken==_LOG)
// a>b=!a|b
left=doOr(true)||!left;
else
return left;
private boolean doOr(boolean get)
boolean left = doXor(get);
for (;;)
if (cToken==_OR)
left|=doXor(true);
else
return left;
private boolean doXor(boolean get)
boolean left = doAnd(get);
for (;;)
if (cToken==_XOR)
left^=doAnd(true);
else
return left;
private boolean doAnd(boolean get)
boolean left = doPrimary(get);
for (;;)
switch (cToken)
case _AND:
left&=doPrimary(true); break;
case A:; case B:; case C:; case D:;
case E:; case F:; case G:; case H:;
case I:; case J:; case K:; case L:;
case LB:; case NOT:
left&=doPrimary(false); break;
default:
return left;
private boolean doPrimary(boolean get)
if (get)
getToken();
boolean temp;
switch (cToken)
case A:; case B:; case C:; case D:;
case E:; case F:; case G:; case H:;
case I:; case J:; case K:; case L:;
temp = Vars[cToken];
getToken();
return temp;
case _NOT:
return !doPrimary(true);
case _TRUE:
getToken();
return true;
case _FALSE:
getToken();
return false;
case _LB:
temp = doEqu(true);
getToken();
return temp;
default: return true;
private void getToken()
cToken = sExpression.charAt(iExpressionCount++);
I try to convert the expression, not to evaluate it.
For example:
(a and b) or c and (d and b) ---> DNF: b & c & d l a & b -
Multi Columns Report Switch replacement
Hi, I have a multiple columns report with 2 fix columns and 10 selectable ones.
I'm selecting the columns with a checklistbox an it works
The Header is easy just have to put "=Parameters!Columns.Label(0-10)" as an expression in each columns heading
The hard part that I'm not getting is that I'm currently using a Switch statement in the fields values and I want to put it into Custom Code.
Why Custom Code is that I was ask to insert 15 other fields value in my selection list. I just don't want to be ask to add more fields x 10 columns.
Here's part of my Switch, I have 10 of them (0-10) for each columns.
=Switch(Parameters!Columns.Value(0)="Phone"
,Fields!Phone.Value,
Parameters!Columns.Value(0)="FirstTime"
,SSRS.Utility.TimeFromMilliSeconds(Fields!RingTime.Value),
Parameters!Columns.Value(0)="ProcessTime"
,SSRS.Utility.TimeFromMilliSeconds(Fields!ProcessTime.Value),
Parameters!Columns.Value(0)="TalkTime"
,SSRS.Utility.TimeFromMilliSeconds(Fields!TalkTime.Value),
Parameters!Columns.Value(0)="Transferred"
,Fields!Transferred.Value)
Notes that some of the fields are FIELDS and others are call in function (assembly's)
Here's one of my many variation of custom code
Public Shared Function FixColumns(Byref Colonne as String) As String
SELECT CASE Colonne
CASE "Phone"
Return "Fields!Phone.Value"
CASE "FirstTime"
Return "SSRS.Utility.TimeFromMilliSeconds(Fields!RingTime.Value)"
END SELECT
End Function
in the value columns fields
=CODE.Fixcolumns(Parameters!Columns.Label(0))
I would greatly appreciate any help
Denis B.Hi Denis B,
If I understand correctly, you want to use custom code replace Switch expression in your report. Please refer to the following custom code:
Public Shared Function FixColumns(Byref Colonne as String, A as String, B as String, …… , F AS String) as String
Select Case Colonne
Case "Phone"
Return A
Case "FirstTime"
Return B
Case Else
Return F
End Select
End Function
Then, we can use following expression to calculate the values:
=CODE.Fixcolumns(Parameters!Columns.Label(0), Fields!Phone.Value, SSRS.Utility.TimeFromMilliSeconds(Fields!RingTime.Value), …… , Fields!Transferred.Value)
As per my understanding, Return Statement in a Function, Get, or Operator must return a value, we cannot return an expression via custom code. So, we use this fields or assembly as a variable in the custom code.
Hope this helps.
Regards,
Alisa Tang
If you have any feedback on our support, please click
here.
Alisa Tang
TechNet Community Support -
Airport express speaker selection
Is it possible to have multiple airport expresses on the same network and select a specific express with speakers and then be able to switch expresses/speakers i.e a different room or area?
Thanks.Yes, you can have multiple Airport Express Base Stations (AX), each connected to speakers or an audio receiver. You can then stream from iTunes (or other sources) to one or multiple AXs simultaneously.
-
Switch and IIF Functions keep adding values.
Help,
My Report is adding my values with both Switch and IIF Functions.
I have reworked the below Switch expression as an IIF Function, I have used Null and IsNothing in replace of "0", I have replaced True with Not(Fields!January2014.Value =
"0"). But Unfortunately, no matter what I do in the below syntax it adds my values. The goal is to run a projection either from this
year's numbers or last year's, so if this year's numbers have not been created or equal "0" to use last years. Unfortunately, when there is a this year and there is a last year it is adding those two values. Any ideas? Please provide input.
Thank you,
=Switch(Fields!January2014.Value =
"0",CDbl(Fields!January2013.Value),True,CDbl(Fields!January2014.Value))What does your IIf statement look like?
=IIf(Fields!January2014.Value="0",CDbl(Fields!January2013.Value),CDbl(Fields!January2014.Value))
How is the January2014 field created in the dataset? And the January2013 field?
"You will find a fortune, though it will not be the one you seek." -
Blind Seer, O Brother Where Art Thou
Please Mark posts as answers or helpful so that others may find the fortune they seek. -
Airport Express won't connect to Extreme by ethernet
Hi,
Here is my setup:
a) Airport Extreme (802.11n 2nd gen) connected by ethernet to cable modem
b) Airport Express #1 setup to wirelessly extend network
This has worked fine for quite some time.
Now, what I tried to is add a 2nd Airport Express via ethernet, so
the new setup is:
1) cable modem via ethernet to Airport Extreme
2) ethernet connection from Airport Extreme to D-Link 8 port gigabit switch
3) ethernet from switch to several devices (Tivo, GoogleTV,etc) and also to an in-wall ethernet connection to another part of my house
4) ethernet from that in-wall ethernet to another D-Link switch
5) ethernet from that other switch to printer (currently works fine) and to Airport Express #2
6) Airport Express #1 still connected wirelessly
Problem: Airport Express #2 will not connect. Won't show up in Airport Utility. Nothing.
I have tried several factory resets.
After many tries, I finally tried connecting it wirelessly. This worked, and I was able to see AEX#2 in the Airport Utility. But, when I then tried to connect it by ethernet, it shut down my entire network. I can not anywhere find step by step instructions on how to connect the AEX by ethernet to the Extreme.
I have reviewed http://support.apple.com/kb/HT4145 but find no help there.
Looking forward to some great help.
- BlueIf I switch Express#2 (the one I would lilke to connect by ethernet) to "create" a network, with the same SSID and PW, then I can only see Express#2 in the utility and the Extreme and Express#1 dissappear.
As soon as you set the Express #2 to "Create a wireless network, the setting for Connection Sharing will change from Bridge Mode to Share a public IP address. That is likely what is throwing you off.
Setup Express #2 to "Create a wireless network" using the same wireless network name, same wireless security and same password.
The next...and last....and critical....step before you click Update must be to change the setting for Connection Sharing from Share a public IP address to Off (Bridge Mode).
Now click Update and wait for a green light on Express #2.
Then, you have to power cycle the entire network.
Power off everything in any order you want.
Wait a minute
Start the modem first and let it run a minute
Start the AirPort Extreme next the same way
Then the switch, etc.
You get the idea....keep starting devices one at a time until the entire network is back up.
Now all the AirPorts will be on the same subnet and visible in AirPort Utility. -
Re: Difference between switcher component and router activity
Hi all,
Here i want to know the difference between switcher component and router activity.
Can anybody give the difference between them or suggest any blog for this.
Thanks,
Syam<af:switcher> component is an ADF Faces component. You can use it within (the source of) a JSF page or fragment to include a particular group of other JSF components depending on the switcher expression's value.
Router activity is not a JSF component, i.e. you cannot use it within a JSF page of fragment. It is an ADF taskflow activity. You can use it as an activity within an ADF Taskflow to route transitions between some other activities in the taskflow depending on the router's expression.
Dimitar -
How do i connect airport express to blue ray player
wondering if i can connect airport express to blue ray player using usb for streaming, etc?
Good question. The single port on the AirPort Express places it somewhat at a disadvantage in a situation like this. It's tempting to think that a setup like this will work:
Modem > Ethernet Switch > Express & Blu-Ray Player both connected to the switch
But, unfortunately, it won't. The reason is that the modem has only one IP address it can deliver and it can't go to two devices at the same time. It will be matter of chance as to which device...the Express or Blu-Ray Player....gets the IP address. The other device will not be able to connect to the Internet.
Instead, what is required is a simple "wired only" router connected to the modem. So the corrrect setup will look like this:
Modem > Wired Only Router > Express and Blu-Ray Player both connected to the router
The router "shares" the IP address that it receives from the modem (an ethernet switch cannot do this) and provides simultaneous Internet connections to the devices that are plugged into the ethernet ports on the router. -
Hi,
I am extremely new to TestStand, please see question below and offer advice.
I want to set up a simple test sequence.
I want a message to popup on screen that asks the operator which unit of 6(max 10) Units to test(i.e. there are say 6-10 box's to select from).
Then the sequence goes to the particular part of the sequence and performs the test on which ever unit was selected.
What is the best way to do this?
Could i use message popups to do this?and if so what do i need to do link it to the correct part of the sequence file?
Do message popups only allow 6 options to select from?
Thanks,
Solved!
Go to Solution.Hi,
You can do using message popup method. You can ask the user which unit want to execute by inserting message in message expression in message popup step settings.Something like below
"Enter unit number to execute
1. Unit1
2. Unit 2
10. Unit 10"
then check "Enable response text box" from options tab in step settings.When user enters unit number you can get the user entered value by inserting the below statement in post expression of message popup step settings
Locals.String = Step.Result.Response
Note : String is a local variable to be defined.
Convert that string in to number and send that output to switch expression there by you can use a sequence call step to call sequence whichever to be executed. (I hope your each unit will be seperate sequence file)
I hope these resolves your problem. If you don't understand let me know so that I can develop a small example and send it to.
Cheers,
krishna -
Multiple colours in matrix cell based on condition.
Hi All,
I have a requirement to fill the different colours in one Matrix cell based on the conditions. there are seven conditions if one of these condition fulfil then one colour. if two condition full fill then two different color in same matrix cell if three conditions
full fill then three different color in same cell .....
Thanks in advance.
Zaim Raza.
http://zaimraza.wordpress.com/Hi Raza,
Yes, my above Switch expressions works in such a way as mentioned your sample screen.
But only thing is you need to modify the expression as per your requirements.
For Example:
Take Month and Year wise Sales amount shown as below:
The Expression would be like below(Not Tested)
=Switch
Fields!Salesamount.Value=100,"Orange",
Fields!Salesamount.Value=200,"Aqua",
Fields!Salesamount.Value=300,"Blue",
Fields!Salesamount.Value=400,"Tomato",
Fields!Salesamount.Value=500,"DarkViolet",
Fields!Salesamount.Value=600,"Red",
Fields!Salesamount.Value=700,"Blue"
So, in a single cell "Year-2001"you will get all 7 colors.
Please let me know still you need any info.
bala krishna
Maybe you are looking for
-
IPhone 5s screen flashes on and off during voice calls?
Operation is perfect with every other app except whenever the phone detects I'm making or receiving a voice call. No problem on facetime. The screen will instantly black out and to bring it back I have to press the main button, then screen will reapp
-
I have downloaded Pages 09 on the i-Mac with the Lion version. In the e-mail for confirming was mentioned an Ordenr....... and a long nr of 12 figures...... After making a document,it was not possible to save or print out. I get a sjabloon with the
-
I want to SHARE Sync Settings with my Family Members & Friends, How Can I Share Some of My Settings like tabs, bookmarks, browser extension with them. Also it is obvious I would not like to share my Passwords. Can you please help. This feature "Shari
-
Text Animation Presets do not load.
Text animation presets do not load in After Effects CC (or Adobe Bridge when browsing presets). They don't show up in Effects & Presets panel. I believe they used to show up but no longer. They are in the presets folder so I'm not sure why they won't
-
Does not do the sorting if I click twice to the same column.
Hello I am new to winforms. I have a listview. I want it to toggle the sorting of the records of the listview when the columns are clicked Please guide me as to how to do the same. The code that I have attached does not do the sorting if I click twic