how to create a hyper-link in iReport? - ireport

I'm using iReport-3.7.6
I have created a sample_Report1 with one parameter as (Project_name) and
I have created the Sample_Report2 with one parameter as (Employee_No)
Now I want to create a hyper-link in Sample_Report1 to Sample_Report2.
(pass the employee_no as a parameter to Sample_Report2 from Sample_Report1 using hyper-link)

rclick on the text field > link parameter
hyperlink target: Self
hyperlink type: ReportExecution
A. add "link parameter name" = uri (well in my repository setup this is what I use)
then Value Expression is the URL enclosed in " "
B. Click on add again "parameter name" value will be the field parameter
when you click mouse over on the link it should be like this
www.yoursite.com/reports/executeReports.jsp?uri=/path/report/yearend&year=2010
this is your URI = "uri=/path/report/yearend"
this is your parameter = "year=2010"
hope this helps...

Related

Calling step in step definitons

I'm trying to call a step that takes an argument in an another step definitions but i'm getting an error like
Cucumber::UndefinedDynamicStep: Undefined dynamic step: "And user
select Electronics as category group from dropdown list"
.feature file
And user fill the create new category form "Electronics"
.rb file
And(/^user fill the create new category form "([^"]*)"$/) do |name|
step "And user type name #{name}"
And(/^user type name "([^"]*)"$/) do |name|
find(:id, 'namePanelGroup').set(name)
end
How can i handle with this situation?
You need to add escaped double quotes because the step you are calling has double quotes around the regex, and you need to remove the "And" like so:
step "user type name \"#{name}\""

"Type mismatch in expression." Visual Studio 2013 with Access 2013 DB

I'm trying to do a simple "Advanced Search Button". This project is using 3 tables within 1 database. The page loads up but when I try to hit the "search button" after entering values into the textbox of website, it gives me "Type mismatch in expression."
Here is the code for search button;
SqlDataSource1.SelectCommand = "SELECT m.musterino, m.adi, m.soyadi, m.adres, u.urunno, u.parca, u.marka, u.modelisim, u.modelno, u.fiyat, s.satisno, s.odeme, s.urun, s.garanti, s.tarih FROM musteri m, satis s, urunler u WHERE m.musterino = s.musterino AND u.urunno = s.urunno AND s.satisno = #ara"
SqlDataSource1.SelectParameters.Add("ara", TextBox1.Text)
SqlDataSource1.Select(System.Web.UI.DataSourceSelectArguments.Empty)
If the field s.satisno is of numeric type then this line is ambigous.
SqlDataSource1.SelectParameters.Add("ara", TextBox1.Text)
You add a parameter without specifying its type. So you leave open any kind of interpretation on it and because you add a string it is possible that something doesn't go as you expect here.
I would try to be more specific on the type of the value passed for the parameter
SqlDataSource1.SelectParameters.Add("ara", DbType.Int32, TextBox1.Text)

Checking Text exist or not?

Say I am on StackOverFlow "All Questions" page.
I want to search for a user say "user2402616" (which is present on 3rd page) on first page.
If not present then click on next button until it is found.
I tried below code using Xpath but getting error.
boolean bPres = driver.findElement(By.xpath("//a[contains(text(),'user2402616')]")).isDisplayed();
System.out.println(bPres);
while (!bPres) {
driver.findElement(By.xpath("//a[contains(text(),'next')]")).click();
}
Since the xpath has text in both the cases i.e for clicking on the user and the next button . You can use the By.linkText method and pass in the value which you want to click
boolean bPres = driver.findElement(By.linkText("user2402616")).isDisplayed();
System.out.println(bPres);
while (!bPres) {
driver.findElement(By.xpath("next").click();
}

How to pass & (ampersand symbol) in ajax get or post method?

I have a text box to enter description
If i submits that need to be send through ajax and store in db.
Problem:-
Example text in textbox:- "Hi all & solve my problem"
in the next page i am getting till "Hi all"
Remaining text is missing, If I pass through get or post method using ajax.
Give me the solution. How to get all the content I placed in text box along with "&"
You need to urlencode string with escape or encodeURIComponent functions.
Yes, I have faced same type issue and find out solution that we need to pass data as a key value pair,
I had passed data in Ajax like:
data : email=" + email + "&name='" + name
But right way for passing data in Ajax is :
data: {
email : email,
name : name
}

How to click on an AutoCompleteExtender with Watin

For my acceptance testing I'm writing text into the auto complete extender and I need to click on the populated list.
In order to populate the list I have to use AppendText instead of TypeText, otherwise the textbox looses focus before the list is populated.
Now my problem is when I try to click on the populated list. I've tried searching the UL element and clicking on it; but it's not firing the click event on the list.
Then I tried to search the list by tagname and value:
Element element = Browser.Element(Find.By("tagname", "li") && Find.ByValue("lookupString"));
but it's not finding it, has anyone been able to do what I'm trying to do?
The shorter version of that is:
string lookupString = "string in list";
Element list = Browser.Element("li", Find.ByText(new Regex(lookupString)));
list.MouseDown();
Regexs will do a partial match so you don't need to specify .* either side and use string.Format. This assumes however that the lookupString doesn't contain any characters special to Regexs, they'd need to be escaped.
In case someone has the same problem. It works with the next code:
string lookupString = "string in list";
Regex lookup = new Regex(string.Format(".*{0}.*", lookupString));
Element list = Browser.Element("li", Find.ByText(lookup));
list.MouseDown();

Resources