I am currently trying to do the following.
I have 2 Textfields, One is Taken from the Dataset (in the Pictures below i have used 400 as a plain number to make things more straight Forward).
now what i want is for one of them to be used as a Variable (not sure if this is the right Term)
i want the value that Text1 is given to automatically be divided from Text2.
Below you will see the Text1 (named Divide) Properties.
and this is Text2 where I am trying to use the Value of Text 1:
I Know everything about having to Convert The field into an Int or some Number, and everything,
what i don't get is how I am supposed to use Textfield1 in Textfield2 ?
Thanks for your Answers in Advance.
What programming language is that?
if it's C# you can do something like:
int x = int.Parse(Text2.Text);
this will convert the string of Text2 (Textfield) to an integer,
if it's java it would be like:
int x = Integer.parseInt(Text2.getText());
But if the user enter some character that isn't a number the problem will crash.
Here is the Answer, thanks again to Visakh16
=400/ReportItems!Divide.value
and here the link: Use Textfield as a Variable Possible ? - Social MSDN
Related
I'm using Report Builder 3.0. Long story short, I want to make the font bold for the text in the red box that you see in the image below:
Basically, it's just one expression in the legend field of my value, however, for clarity's sake (for my end users) I wish to make the "title part" bold. I found the following solution for textboxes in a tablix using Html by checking off the "HTML – Interpret HTML tags as styles." checkbox within the Textbox's properties. (http://www.sqlchick.com/entries/2010/10/31/using-different-formats-within-a-single-textbox-in-ssrs.html)
However, I can't find anything similar for graphs! I mean if MS thought about it for tables, I presume they must've given it some thought for a chart setting too.
Thanks to all!
p.s. As an aesthetic solution to my problem, I did think of simply creating a new title field, moving it to the exact same location and formating it. But I'm surious whether there'd be some more "proper" way of doing this.
I'm using the same approach for one of my charts.
STEPS.
Select the Chart series to open property pane. In my case, the chart series name is TWR Chart Series
Select the color property and select to build the expression.
I'm posting one of my expression. You can build your own expression base don your field names etc.
=IIF(Fields!ProductID.Value = 1 OR Fields!ProductID.Value = 6,"#00425E",
IIF(Fields!ProductID.Value = 3 ,"#6B8797",
IIF(Fields!ProductID.Value = 5 OR Fields!ProductID.Value = 7,"#799179",
IIF(Fields!ProductID.Value = 4 AND Fields!sort.Value=99,"#6bb1be","#48597B"))))
If used sensibly, you should get your desired results.Good luck.
I am using to UFT and having a problem in describing multiple properties for an object.
b_username = "html id:=txtUsername","type:=text"
Trying this has not helped me. Even tried the ";" delimiter but that too is not working.
I think you have misunderstood how to reference an object using Descriptive Programming.
You still use the UFT syntax of Browser().Page().WebEdit() (for example) and because you are trying to set an object reference you need the Set keyword. Try something like:
Set b_username = Browser("micclass:=Browser").Page("micclass:=Page").WebEdit("html id:=txtUsername","type:=text")
This will allow you to use b_username to reference the text box with the html id of txtUsername:
b_username.Set myUsernameValue
For a pretty good basic introduction to descriptive programming, check out LearnQTP.com
What you are more closing attempting to do is to build a Description Object.
You need something like the following:
'Creating a description object
Set btncalc = Description.Create()
'Add descriptions and properties
btncalc("type").value = "Button"
btncalc("name").value = "calculate"
btncalc("html tag").value = "INPUT"
' Use the same to script it
Browser("Math Calc").Page("Num Calculator").WebButton(btncalc).Click
This SO article has a good explanation of a little more advanced technique.
How to create description object model at runtime in uft/qtp?
Please let me know if this clears up some confusion.
I would suggest you to use the below library for descriptive programming. It saves you from creating tons of descriptive objects. Check the usage in the link below.
http://www.testautomationguru.com/qtpuft-advanced-descriptive-programming/
To enter some value in the all the textboxes (no need to iterate)
Browser("creationTime:=0").Page("micclass:=Page").getChildObjects("micclass:=WebEdit").SetValue "1"
To enter some value in a textbox whose name starts with ‘guru’
Browser("creationTime:=0").Page("micclass:=Page").getChildObjects("micclass:=WebEdit,name:=guru.*").SetValue "1"
The above example can also be written as
Browser("creationTime:=0").Page("micclass:=Page").getChildObjects("micclass:=WebEdit").WithRegExProperty("name:=guru.*").SetValue "1"
To get the fifth visible child object which has the name as guru.
Browser("creationTime:=0").Page("micclass:=Page").getChildObjects("micclass:=WebEdit").WithRegExProperty("name:=guru.*").Index(4).Set "1"
To enter the values only in the visible text boxes
Browser("creationTime:=0").Page("micclass:=Page").getChildObjects("micclass:=WebEdit").WithRegExProperty("name:=guru.*").VisibleChildObjects.SetValue "1"
To select all visible check boxes
Browser("creationTime:=0").Page("micclass:=Page").getChildObjects("micclass:=WebCheckBox").VisibleChildObjects.SetValue "ON"
To get items count
Browser("creationTime:=0").Page("micclass:=Page").getChildObjects("micclass:=WebCheckBox,type:=checkbox,name:=jqg_list.*").VisibleChildObjects.getCount()
To match certain property values
Browser("creationTime:=0").Page("micclass:=Page").getChildObjects("micclass:=WebEdit").WithRegExProperty("name:=guru.*").VisibleChildobjects().Set "1"
To give some delay between 2 ‘Set’ – [if required for something]
Browser(“creationTime:=0”).Page(“micclass:=Page”).getChildObjects(“micclass:=WebEdit”).WithRegExProperty(“name:=guru.*”).VisibleChildobjects().DelayEachSetBy(1).Set “1”
I need to add a drop down for selecting the minutes.I have tried through component parameters in FLA and through XML.When i gave the value 00,01..etc they are taken as 0,1.But i need 00,01..etc.
How it is possible.Thanks in advance.
I would assume that they're being treated as Numbers, my advice would be:
var numAsString:String = myNumber.toString();
if (numAsString.length<2) {numAsString = "0"+numAsString;}
That should force it to show in the format you want. Just be sure to use parseInt(numAsString) if you need to do any manipulation.
As I must to add image on several group on the same form, I'd to customize my procédure to do that.
Indeed, actualy, I have something like that,
if(value=="17"){
gv17.addElement(imAc);
v17.setStyle("backgroundColor",'#ffffff');
}
My goal is to do something like that:
if(value=="18"){
gv18.addElement(imAc);
v18.setStyle("backgroundColor",'#ffffff');
}
if(value=="17"){
gv17.addElement(imAc);
v17.setStyle("backgroundColor",'#ffffff');
}
if(value=="16"){
gv16.addElement(imAc);
v16.setStyle("backgroundColor",'#ffffff');
}
Do you have a solution to solve that.
Indeed, I think it's stupid to write X times (3 in example) to do that. I can refer to object by Name as name is a string.
I'd like to do something like that :
var mytarget:string = "gv16";
mytarget.addElement(imAc);
Thanks
Depending on how your objects are named, you might try:
this['gv' + value].addElement(imAc);
this['v' + value].setStyle('backgroundColor', '#ffffff');
As long as your value number equates to the symbol name numbers, and the logic holds true for every element, this should solve your problem without getting overly complex.
I have SSRS solution for SQL 2005 and 2008.
I am showing output in the form of chart- column chart with each column representing different database.
Is there a way to display each column in different color?
Regards
Manjot
You can use a formula to set the colour of each column, but that would work best if you knew what the individual series values ('databases'?) were going to be.
Right-click on your chart and bring up its properties. Now switch to the Data tab and select the first item in the Values list. Click the Edit... button to show the properties for the values (the columns) in your chart. Over on the Appearance tab there's a Series Style... button which takes you to another dialog.
On this new Style Properties dialog, switch to the Fill tab. That's where you set the colour for each of your columns. This can be a formula, so you might make it something like:
=Switch(
Fields!Database.Value = "master", "Blue",
Fields!Database.Value = "msdb", "Red",
"Green")
If you don't know in advance which 'databases' are going to be represented on the chart, this method won't work very well. In that case you might be able to come up with a formula which hashes the database name and comes up with a colour to match. That sounds like an interesting challenge, so add to your question if you need help doing something like that.
Edit
I just got a hash-based-colour-scheme working. It's a pretty nasty piece of code, but it did manage to get me a unique colour for every (string valued) column. Perhaps someone can come up with a better algorithm and post it here. Here's mine:
="#" & left(Hex(Fields!Database.GetHashCode()), 6)
So that's getting the HashCode for the string (a numeric value) and converting it to hex, then taking the leftmost six characters and prepending it with a "#" sign. That gives us a string that looks like a colour value (eg #AB12F0).