Thursday 30 April 2020

Tip : None of the features at [classpath:features] matched the filters: [@scenario_AddMarketingAccount, @scenario_AddMarketingUser] OR tags for command line execution of cucumber scenarios

Hi,

If we try to provide tags individually as below in main method for command line usage, we may end-up getting the error message saying .. None of the features at classpath matched the filters.

"-t","@scenario_AddMarketingAccount,
"-t","@scenario_AddMarketingUser",


None of the features at [classpath:features] matched the filters: [@scenario_AddMarketingAccount, @scenario_AddMarketingUser]

0 Scenarios

0 Steps
0m0.000s


Provide a single tag with comma separated literals/scenario tags. 
i.e., 
"-t","@scenario_AddMarketingAccount,@scenario_AddMarketingUser"

Below is how the tags should be written for CLI (command line interface)

package com.sadakar.selenium.common;
import org.openqa.selenium.WebDriver;

public class BasePage {
 
 public  static WebDriver driver; 
 
 public static void main(String args[]) throws Throwable{
  try {
   cucumber.api.cli.Main.main(
     new String[]{
     "classpath:features",
     "-g", "com.sadakar.cucumber.stepdefinitions/", 
     "-g","com.sadakar.cucumber.common",
     "-t","@scenario_AddMarketingAccount,@scenario_AddMarketingUser",
     "-p","pretty", 
     "-p","json:target/cucumber-reports/Cucumber.json",
     "-p", "html:target/cucumber-reports",
     "-m"
     }
   ); 
  }
  catch(Throwable e) {
    e.printStackTrace();
    System.out.println("Main method exception");
  }
 }
}


NOTE : 
When you run executable jar file, it executes ALL the scenarios given with "-t" tag.

1) Build the jar file 
clean compile assembly:single install

2) Run the jar file
java -DtestEnv=local -jar SADAKAR_POC-0.0.1-SNAPSHOT-jar-with-dependencies.jar

Tip : Run specific cucumber scenario from command line for an executable jar file

Hi,

Syntax: 
java -Dcucumber.options="-tags @<ScenarioName>" - jar <executable-jar-file>

java  -Dcucumber.options="--tags @scenario_AddUser" -jar SADAKAR_CUCUMBER_POC-0.0.1-SNAPSHOT-jar-with-dependencies.jar

Snapshot:




References: 
https://stackoverflow.com/questions/37559861/run-a-single-cucumber-scenario-from-an-executable-jar

Locators for selenium | finding xpath for legend tag using contains


Label content on the web:

xpath: 
//legend[contains(.,'Add Marketing User')]

HTML inspector :


Wednesday 22 April 2020

Tip : Code snippet of isSelected() and getAttribute("value") to validate checkbox in a Store page form using java-selenium-cucumber

Hi,

Use case : In a Store page form,
PASS the test : if the store belongs to an internal office
FAIL the test : if the store belongs to external office for sales

NOTE : While creating the Store in the form selected the checkbox so it is an internal store.

label and input type : Is Internal Store ( it is a check box )

@Then("^I verify all the Store details with the values given while creating a new Store$")
public void i_verify_all_the_Store_details_with_the_values_given_while_creating_a_new_Store() throws Throwable {
 try {
  Log.debug("Comparing Internal Store with the selection while a new Store is created");
  Log.debug("Internal Store value while the Store is created is=true");
  Log.debug("Get Value of internal Store from UI: "+driver.findElement(By.xpath("//*[@id='isInternalStore']")).getAttribute("value"));
  
  if(
    (driver.findElement(By.xpath("//*[@id='isInternalStore']")).isSelected()) && 
    (driver.findElement(By.xpath("//*[@id='isInternalStore']")).getAttribute("value").toString().equals("true"))
  ) {
    Log.debug("Store is equals with the selection while account is created");
  }else
  {
   Assert.fail("else block..........  Store is NOT internal one");
   System.out.println("Store is NOT internal one");
  }
 }catch(Exception e) {
  Assert.fail("catch block.........Store is NOT internal one"+e);
  System.out.println("Store is NOT internal one"+e);
 }
}

- Sadakar Pochampalli 

Tuesday 14 April 2020

AutoIT script for windows based chrome authentication in Selenium or Cucumber

Hi,

The following AutoIt script can be used for windows based chrome authentication.

1. Open the website in chrome with windows based pop-up.
2. Open the AutoIT tool and move the "Finder Tool" on to the window.
3. Make a note of "Title" and "Class" of the window.
4. Use the following script with values updated with the "Title" and "Class".
5. Save the file, for example : atuoit_chrome_credentials.au3  (extension should be .au3)
6. Compile the script (right click from the location where the file is saved and compile).
7. Compile generates .exe file , in this case it is : atuoit_chrome_credentials.exe

Call the .exe file before the website get loaded in java file


Runtime.getRuntime().exec("\path to the .exe file\"+"autoit_chorme_credentials.exe");


AutoIT code snippet


;RequireAdmin ; unsure if it's needed
;$iSleep = 2000
Opt("WinSearchChildren", 1)
$sUsername = "admin"
$sPassword = "PaSSWorD2%"
Sleep(1000)
For $i = 1 To 20 Step 1
    Sleep(3000)
    $sTitle = WinGetTitle("Sign in")
    If $sTitle = "sadakar.network.com - Google Chrome" or WinWaitActive("[CLASS:Chrome_WidgetWin_1]")  or WinWaitActive("Sign in") Then
        Send($sUsername)
        Send("{TAB}")
        Send($sPassword,1);$SEND_RAW (1)
        Send("{TAB}")
        Send("{ENTER}")
        Exit 0
    Else
        ContinueLoop
    EndIf
Next
Exit 1


How to find Title and Class from AutoIt tool ? 



Auto reads the credentials while the program runs for chrome based windows authentication pop-up.



- Sadakar Pochampalli

Tip : Multiple markers at this line - Step definitions detection works only when the project is configured as cucumber project.

This is usually seen in the feature file as a warning message. 

If you install feature file plugin from eclipse market place and if you restart the tool, the existing feature files gets this warning. 

I've observed it in the following eclipse installation: 
Version: 2020-03 (4.15.0)
Build id: 20200313-1211

Right click on the eclipse project -> Configure -->  Convert to Cucumber Project...


References: 
https://stackoverflow.com/questions/58327032/step-definition-detection-only-works-when-project-is-configured-as-cucumber-proj

Saturday 11 April 2020

Export excel test data to executable jar file(bundle excel within jar) and read it from the jar for java-selenium-cucumber projects (OR) Read excel test data from the eclipse resources (OR) Read excel test data from the location where jar is generated

In this post, I'd like to share some fundamental coding techniques for the following questions. These techniques are useful when working on selenium based QA projects or generally in java based projects. It is pretty handy to play with excel read/write while working in tools, for instance Eclipse but what if the project needs a distribution to lab environments.

Problem statement : 
1) How to read excel test file/content data from eclipse project folder structure ?
2) How to bundle and read the excel test data file/content within the executable jar file ?
3) How to read the excel test data file from the location where jar is generated ?

Google search helped me to achieve the question-1, the latter ones are achieved through a java expert folk(thank you for the inputs and explanation). I'd like to keep it open for the community folks who are beginners with selenium frameworks.

Here we go.!
Maven based eclipse project structure:


Common code in all the 3 scenarios above: 

Read the excel data using getResourceAsSteam 

public static InputStream getResource(String filename) {
        InputStream inputStream = ExcelUtils.class.getResourceAsStream(filename);
        if (null == inputStream) {
            //fail("Resource not found: `" + filename + "`");
            Log.error("Resource not found: `" + filename + "`");
        }
        return inputStream;
    }
1) How to read excel test file/content data from eclipse project folder structure ? 

This is useful to feed the forms with excel test data from the eclipse project.

a) Create a "data" folder in src/main/resources and
             add "Accounts_Test_Data_Automation.xlsx"  file.

b) Below piece of code does the trick.
fileName = "/data/" + fileName;
ExcelFile = getResource(fileName);


2) How to bundle and read the excel test data file/content within the executable jar file ?

This piece of code does the trick of  bundling excel file into jar. Same as in question-1, look at the setExcelfile method.
//This code ships the excel file into the jar
ExcelFile = getResource("/data/"+fileName);

//Instead of above one case use blow direct project path for the excel file to be bundled
//ExelFile = getResource("/data/Accounts_Test_Data_Automation.xlsx");

pom.xml should be included with the maven-assembly-plugin

<plugin>
 <!-- NOTE: We don't need a groupId specification because the group is
   org.apache.maven.plugins ...which is assumed by default.
  -->
 <artifactId>maven-assembly-plugin</artifactId>
 <version>3.1.1</version>
 <configuration>
 <archive>
   <manifest>
    <addClasspath>true</addClasspath>
    <mainClass>com.sadakar.selenium.common.BasePage</mainClass>
   </manifest>
  </archive>
   <descriptorRefs>
  <descriptorRef>jar-with-dependencies</descriptorRef>
   </descriptorRefs>
 </configuration>
 <executions>
  <execution>
  <id>make-assembly</id>
  <phase>package</phase>
  <goals>
   <goal>single</goal>
  </goals>
  </execution>
 </executions>
</plugin>

Use below command while building the Maven project
clean compile assembly:single install

It will generated the jar file in .m2 repository. Extract of jar should contain the excel file within the "data" folder. While running the command use DtestEnv environment variable. By passing this variable from the command prompt, the code checks for the logic(above jar code) written to read the excel path.

String testEnv = System.getProperty("testEnv");

C:\Users\sadakar\.m2\repository\SADAKAR_POC\SADAKAR_POC\0.0.1-SNAPSHOT>java -DtestEnv=local -jar SADAKAR_POC-0.0.1-SNAPSHOT-jar-with-dependencies.jar

3) How to read the excel test data file from the location where jar is generated ?
Every time when you run scenario(s) or run the jar you CAN NOT edit the excel data file that is bundled inside the jar and it become cumbersome to manually update the excel then bundle it.
This may be tedious job if the test data is huge. To overcome this, it is always a good practice to keep the excel file externally where the jar is going to be generated or where the jar is going be deployed, so I file kept in such location can be accessible with the following snippet in the method.

//This piece of code search for the excel file where the jar is generated or deployed
  fileName = "./" + fileName;
  ExcelFile = new FileInputStream(fileName);


Complete picture of these 3 logic(s) are implemented in ExcelUtils.java where the file name is being sent from AddAccount.java with the Sheet name.
To get the Cell data look at readAccountsData method.
ExcelUtils.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
package com.sadakar.excel.utilities;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.InputStream;
import org.apache.poi.ss.usermodel.DataFormatter;
import org.apache.poi.xssf.usermodel.XSSFCell;
import org.apache.poi.xssf.usermodel.XSSFSheet;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;

import com.sadakar.resource.utilities.Log;

public class ExcelUtils {

    public static XSSFSheet ExcelWSheet;

    public static XSSFWorkbook ExcelWBook;

    public static XSSFCell Cell;

    public static String currentDir = System.getProperty("user.dir");

    // public static final String currentDir = System.getProperty("user.dir");

    // This method is to set the File path and to open the Excel file, Pass
    // Excel Sheet name as Arguments to this method

    public static InputStream getResource(String filename) {
        InputStream inputStream = ExcelUtils.class.getResourceAsStream(filename);
        if (null == inputStream) {
            //fail("Resource not found: `" + filename + "`");
            Log.error("Resource not found: `" + filename + "`");
        }
        return inputStream;
    }

    public static void setExcelFile(String fileName, String SheetName)
                    throws Exception {

        InputStream ExcelFile = null;

        try {
            String testEnv = System.getProperty("testEnv");
            if (testEnv != null && testEnv.equalsIgnoreCase("local")) {
                
             //This piece of code search for the excel file where the jar is generated or deployed
             fileName = "./" + fileName;
                ExcelFile = new FileInputStream(fileName);
                
                //This code ships the excel file into the jar
                //ExcelFile = getResource("/data/SMAPI_UI_Automation.xlsx");    
                
            } else {
                fileName = "/data/" + fileName;
                ExcelFile = getResource(fileName);
            }

            ExcelWBook = new XSSFWorkbook(ExcelFile);
            ExcelWSheet = ExcelWBook.getSheet(SheetName);

        } catch (FileNotFoundException e) {
            System.out.println("Excel Reading have problems : " + e);
            Log.error("Excel Reading have problems : " + e);
        }
    }

    // This method is to read the test data from the Excel cell, in this we are
    // passing parameters as Row num and Col num
    public static String getCellData(int RowNum, int ColNum) throws Exception {
        try {

            Cell = ExcelWSheet.getRow(RowNum).getCell(ColNum);
            DataFormatter formatter = new DataFormatter();
            String CellData = formatter.formatCellValue(Cell);
            return CellData;

        } catch (Exception e) {
            return "";
        }
    }

}

AddAccount.java 
(This class extends BasePage class that can be removed if you want to use the same code)
1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
package com.sadakar.cucumber.stepdefinitions;
import org.openqa.selenium.By;
import org.openqa.selenium.WebElement;
import com.sadakar.excel.utilities.ExcelUtils;
import com.sadakar.resource.utilities.Log;
import com.sadakar.selenium.common.BasePage;
import cucumber.api.java.en.Then;
import org.junit.Assert;
import java.util.concurrent.TimeUnit;

public class AddAccount extends BasePage{
 
 ExcelUtils eu = new ExcelUtils();
 
 public void readAccountsData() throws Exception{

  try { 
   Log.debug("Reading Accounts Excel data file");
   ExcelUtils.setExcelFile("Accounts_Test_Data_Automation.xlsx", "Accounts");
  }
  catch(Exception e) {
    System.out.println("\n Unable to read excel file or Sheet:\n"+e);
    Log.error("\n Unable to read excel file or Sheet:\n"+e); 
    throw e;  
  }
   
  try {
   
   Log.debug("---------Accounts Test Data------------");
   System.out.println("---------Accounts Test Data-------");
   
      
   Log.debug("AccountID* ="+ExcelUtils.getCellData(1,1));
   Log.debug("AccountName* ="+ExcelUtils.getCellData(2,1));
     
   System.out.println(ExcelUtils.getCellData(1,1)+"\n");
   System.out.println(ExcelUtils.getCellData(2,1)+"\n");
      
   Log.debug("-----------------------------------------");
   System.out.println("---------------------------------");
   
  }catch(Exception e) {
   Log.error("Unable to display Accounts test data"+e);
   System.out.println("Unable to display Accounts test data"+e);
  } 
 }
}
 

I hope this helps, someone in community.!

Cheers.!

- Sadakar Pochampalli 

Thursday 2 April 2020

Drill with in the report in jasper reports

This is an extended tutorial of my post back in 2015, today, I needed to implement the same and struggled to get the old example working, so, thought of documenting it again with server export available for the community. 

https://jasper-bi-suite.blogspot.com/2015/01/tip-intercharts-drill-down-technique-in.html
Tip : Intra charts/components linking technique in Jasper reports : HTML5 charts inter linking with in report in Jasper Studio 6.x

Problem Statement : 
How to drill down with in the report ? How to get dynamic data displayed in a table component when performed click action on particular slices from Pie Chart ?

Pie : Number of cars by Occupation
Table : Details of customer by occupation





Solution :  
1) Create a parameter say : $P{paramOccupation} for main report and give default value
         In this example default value is given as "Manual"
2) Create a data set and create the same parameter and filter the query with this parameter.
3) Design Pie graph and table component.
4) For the Pie graph category create Bucket Property
        paramOccupation = $F{paramOccupation}
4) For the pie graph Hyperlink give _report = path of the same report from J.Server.
    and add parameter as shown in below image.
  i.e.,
(NOTE : Assuming the report is published already to the server)

_report="/Praveen/Drill_with_in_reports"                  
  paramOccupation=Level1.paramOccupation   (This is the Bucket property created for category)


5) Make sure the table component "Dateset" is added with Parameter
       i.e., In table component properties --> Parameters -->
         Add paramOccupation=${paramOccupation}

6) Re publish the report to Jasper Server and hide the paramOccupation parameter
         
Download the server zip file for live example :  Click Me
Import this zip to your jasper server and run "Drill with in report" report from "Praveen" folder


JRXML: 
<?xml version="1.0" encoding="UTF-8"?>
<!-- Created with Jaspersoft Studio version 7.2.0.final using JasperReports Library version 6.6.0  -->
<jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="Drill with in reports" pageWidth="1000" pageHeight="842" columnWidth="960" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="4b0b908c-5907-4119-9d85-00671c2494af">
<property name="com.jaspersoft.studio.data.defaultdataadapter" value="foodmart"/>
<property name="com.jaspersoft.studio.data.sql.tables" value=""/>
<property name="ireport.jasperserver.url" value="http://localhost:8080/jasperserver-pro/"/>
<property name="ireport.jasperserver.user" value="superuser"/>
<property name="ireport.jasperserver.reportUnit" value="/Praveen/Drill_with_in_reports"/>
<property name="com.jaspersoft.studio.unit." value="pixel"/>
<property name="com.jaspersoft.studio.unit.pageHeight" value="pixel"/>
<property name="com.jaspersoft.studio.unit.pageWidth" value="pixel"/>
<property name="com.jaspersoft.studio.unit.topMargin" value="pixel"/>
<property name="com.jaspersoft.studio.unit.bottomMargin" value="pixel"/>
<property name="com.jaspersoft.studio.unit.leftMargin" value="pixel"/>
<property name="com.jaspersoft.studio.unit.rightMargin" value="pixel"/>
<property name="com.jaspersoft.studio.unit.columnWidth" value="pixel"/>
<property name="com.jaspersoft.studio.unit.columnSpacing" value="pixel"/>
<property name="ireport.jasperserver.report.resource" value="/Praveen/Drill_with_in_reports_files/main_jrxml"/>
<style name="Table_TH" mode="Opaque" backcolor="#F0F8FF">
<box>
<pen lineWidth="0.5" lineColor="#000000"/>
<topPen lineWidth="0.5" lineColor="#000000"/>
<leftPen lineWidth="0.5" lineColor="#000000"/>
<bottomPen lineWidth="0.5" lineColor="#000000"/>
<rightPen lineWidth="0.5" lineColor="#000000"/>
</box>
</style>
<style name="Table_CH" mode="Opaque" backcolor="#BFE1FF">
<box>
<pen lineWidth="0.5" lineColor="#000000"/>
<topPen lineWidth="0.5" lineColor="#000000"/>
<leftPen lineWidth="0.5" lineColor="#000000"/>
<bottomPen lineWidth="0.5" lineColor="#000000"/>
<rightPen lineWidth="0.5" lineColor="#000000"/>
</box>
</style>
<style name="Table_TD" mode="Opaque" backcolor="#FFFFFF">
<box>
<pen lineWidth="0.5" lineColor="#000000"/>
<topPen lineWidth="0.5" lineColor="#000000"/>
<leftPen lineWidth="0.5" lineColor="#000000"/>
<bottomPen lineWidth="0.5" lineColor="#000000"/>
<rightPen lineWidth="0.5" lineColor="#000000"/>
</box>
</style>
<subDataset name="Dataset1-table" uuid="24749c25-55a5-49c2-be2d-f5dc1ec06acb">
<property name="com.jaspersoft.studio.data.defaultdataadapter" value="foodmart"/>
<property name="com.jaspersoft.studio.data.sql.tables" value=""/>
<parameter name="paramOccupation" class="java.lang.String"/>
<queryString>
<![CDATA[select * from customer where occupation= $P{paramOccupation} limit 10]]>
</queryString>
<field name="customer_id" class="java.lang.Integer">
<property name="com.jaspersoft.studio.field.label" value="customer_id"/>
<property name="com.jaspersoft.studio.field.tree.path" value="customer"/>
</field>
<field name="account_num" class="java.lang.Long">
<property name="com.jaspersoft.studio.field.label" value="account_num"/>
<property name="com.jaspersoft.studio.field.tree.path" value="customer"/>
</field>
<field name="lname" class="java.lang.String">
<property name="com.jaspersoft.studio.field.label" value="lname"/>
<property name="com.jaspersoft.studio.field.tree.path" value="customer"/>
</field>
<field name="fname" class="java.lang.String">
<property name="com.jaspersoft.studio.field.label" value="fname"/>
<property name="com.jaspersoft.studio.field.tree.path" value="customer"/>
</field>
<field name="mi" class="java.lang.String">
<property name="com.jaspersoft.studio.field.label" value="mi"/>
<property name="com.jaspersoft.studio.field.tree.path" value="customer"/>
</field>
<field name="address1" class="java.lang.String">
<property name="com.jaspersoft.studio.field.label" value="address1"/>
<property name="com.jaspersoft.studio.field.tree.path" value="customer"/>
</field>
<field name="address2" class="java.lang.String">
<property name="com.jaspersoft.studio.field.label" value="address2"/>
<property name="com.jaspersoft.studio.field.tree.path" value="customer"/>
</field>
<field name="address3" class="java.lang.String">
<property name="com.jaspersoft.studio.field.label" value="address3"/>
<property name="com.jaspersoft.studio.field.tree.path" value="customer"/>
</field>
<field name="address4" class="java.lang.String">
<property name="com.jaspersoft.studio.field.label" value="address4"/>
<property name="com.jaspersoft.studio.field.tree.path" value="customer"/>
</field>
<field name="city" class="java.lang.String">
<property name="com.jaspersoft.studio.field.label" value="city"/>
<property name="com.jaspersoft.studio.field.tree.path" value="customer"/>
</field>
<field name="state_province" class="java.lang.String">
<property name="com.jaspersoft.studio.field.label" value="state_province"/>
<property name="com.jaspersoft.studio.field.tree.path" value="customer"/>
</field>
<field name="postal_code" class="java.lang.String">
<property name="com.jaspersoft.studio.field.label" value="postal_code"/>
<property name="com.jaspersoft.studio.field.tree.path" value="customer"/>
</field>
<field name="country" class="java.lang.String">
<property name="com.jaspersoft.studio.field.label" value="country"/>
<property name="com.jaspersoft.studio.field.tree.path" value="customer"/>
</field>
<field name="customer_region_id" class="java.lang.Integer">
<property name="com.jaspersoft.studio.field.label" value="customer_region_id"/>
<property name="com.jaspersoft.studio.field.tree.path" value="customer"/>
</field>
<field name="phone1" class="java.lang.String">
<property name="com.jaspersoft.studio.field.label" value="phone1"/>
<property name="com.jaspersoft.studio.field.tree.path" value="customer"/>
</field>
<field name="phone2" class="java.lang.String">
<property name="com.jaspersoft.studio.field.label" value="phone2"/>
<property name="com.jaspersoft.studio.field.tree.path" value="customer"/>
</field>
<field name="birthdate" class="java.sql.Date">
<property name="com.jaspersoft.studio.field.label" value="birthdate"/>
<property name="com.jaspersoft.studio.field.tree.path" value="customer"/>
</field>
<field name="marital_status" class="java.lang.String">
<property name="com.jaspersoft.studio.field.label" value="marital_status"/>
<property name="com.jaspersoft.studio.field.tree.path" value="customer"/>
</field>
<field name="yearly_income" class="java.lang.String">
<property name="com.jaspersoft.studio.field.label" value="yearly_income"/>
<property name="com.jaspersoft.studio.field.tree.path" value="customer"/>
</field>
<field name="gender" class="java.lang.String">
<property name="com.jaspersoft.studio.field.label" value="gender"/>
<property name="com.jaspersoft.studio.field.tree.path" value="customer"/>
</field>
<field name="total_children" class="java.lang.Integer">
<property name="com.jaspersoft.studio.field.label" value="total_children"/>
<property name="com.jaspersoft.studio.field.tree.path" value="customer"/>
</field>
<field name="num_children_at_home" class="java.lang.Integer">
<property name="com.jaspersoft.studio.field.label" value="num_children_at_home"/>
<property name="com.jaspersoft.studio.field.tree.path" value="customer"/>
</field>
<field name="education" class="java.lang.String">
<property name="com.jaspersoft.studio.field.label" value="education"/>
<property name="com.jaspersoft.studio.field.tree.path" value="customer"/>
</field>
<field name="date_accnt_opened" class="java.sql.Date">
<property name="com.jaspersoft.studio.field.label" value="date_accnt_opened"/>
<property name="com.jaspersoft.studio.field.tree.path" value="customer"/>
</field>
<field name="member_card" class="java.lang.String">
<property name="com.jaspersoft.studio.field.label" value="member_card"/>
<property name="com.jaspersoft.studio.field.tree.path" value="customer"/>
</field>
<field name="occupation" class="java.lang.String">
<property name="com.jaspersoft.studio.field.label" value="occupation"/>
<property name="com.jaspersoft.studio.field.tree.path" value="customer"/>
</field>
<field name="houseowner" class="java.lang.String">
<property name="com.jaspersoft.studio.field.label" value="houseowner"/>
<property name="com.jaspersoft.studio.field.tree.path" value="customer"/>
</field>
<field name="num_cars_owned" class="java.lang.Integer">
<property name="com.jaspersoft.studio.field.label" value="num_cars_owned"/>
<property name="com.jaspersoft.studio.field.tree.path" value="customer"/>
</field>
<field name="fullname" class="java.lang.String">
<property name="com.jaspersoft.studio.field.label" value="fullname"/>
<property name="com.jaspersoft.studio.field.tree.path" value="customer"/>
</field>
</subDataset>
<parameter name="paramOccupation" class="java.lang.String">
<defaultValueExpression><![CDATA["Manual"]]></defaultValueExpression>
</parameter>
<queryString>
<![CDATA[select occupation, sum(num_cars_owned) cars  from customer
group by occupation
 order by occupation]]>
</queryString>
<field name="occupation" class="java.lang.String">
<property name="com.jaspersoft.studio.field.label" value="occupation"/>
<property name="com.jaspersoft.studio.field.tree.path" value="customer"/>
</field>
<field name="cars" class="java.lang.Long">
<property name="com.jaspersoft.studio.field.label" value="cars"/>
</field>
<background>
<band splitType="Stretch"/>
</background>
<summary>
<band height="420" splitType="Stretch">
<componentElement>
<reportElement x="0" y="80" width="400" height="340" uuid="07f8444d-5b85-4950-aefc-4e4b3f62c16c"/>
<hc:chart xmlns:hc="http://jaspersoft.com/highcharts" xsi:schemaLocation="http://jaspersoft.com/highcharts http://jaspersoft.com/schema/highcharts.xsd" type="Pie">
<hc:chartSetting name="default">
<hc:chartProperty name="title.text" value=""/>
<hc:chartProperty name="credits.enabled" value="false"/>
<hc:chartProperty name="credits.href" value=""/>
<hc:chartProperty name="credits.text" value=""/>
<hc:chartProperty name="yAxis.title.text" value=""/>
<hc:chartProperty name="chart.zoomType" value="xy"/>
<hc:chartProperty name="plotOptions.pie.showInLegend" value="true"/>
</hc:chartSetting>
<multiAxisData>
<multiAxisDataset/>
<dataAxis axis="Rows">
<axisLevel name="Level1">
<labelExpression><![CDATA["Level Label expression"]]></labelExpression>
<axisLevelBucket class="java.lang.Comparable">
<bucketExpression><![CDATA[$F{occupation}]]></bucketExpression>
<labelExpression><![CDATA[]]></labelExpression>
<bucketProperty name="paramOccupation"><![CDATA[$F{occupation}]]></bucketProperty>
</axisLevelBucket>
</axisLevel>
</dataAxis>
<dataAxis axis="Columns"/>
<multiAxisMeasure name="Measure1" class="java.lang.Number" calculation="Nothing">
<labelExpression><![CDATA["Cars"]]></labelExpression>
<valueExpression><![CDATA[$F{cars}]]></valueExpression>
</multiAxisMeasure>
</multiAxisData>
<hc:series name="Measure1">
<hc:contributor name="SeriesItemHyperlink">
<hc:contributorProperty name="hyperlinkTarget" valueType="Constant" value="Self"/>
<hc:contributorProperty name="hyperlinkType" valueType="Constant" value="ReportExecution"/>
<hc:contributorProperty name="_report" valueType="Expression">
<hc:valueExpression><![CDATA["/Praveen/Drill_with_in_reports"]]></hc:valueExpression>
</hc:contributorProperty>
<hc:contributorProperty name="paramOccupation" valueType="Bucket" value="Level1.paramOccupation"/>
</hc:contributor>
</hc:series>
</hc:chart>
</componentElement>
<componentElement>
<reportElement x="420" y="60" width="540" height="60" uuid="100a6fe4-7159-4de7-a8af-ec3abb357d30">
<property name="com.jaspersoft.studio.layout" value="com.jaspersoft.studio.editor.layout.VerticalRowLayout"/>
<property name="com.jaspersoft.studio.table.style.table_header" value="Table_TH"/>
<property name="com.jaspersoft.studio.table.style.column_header" value="Table_CH"/>
<property name="com.jaspersoft.studio.table.style.detail" value="Table_TD"/>
</reportElement>
<jr:table xmlns:jr="http://jasperreports.sourceforge.net/jasperreports/components" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports/components http://jasperreports.sourceforge.net/xsd/components.xsd">
<datasetRun subDataset="Dataset1-table" uuid="10d6d999-3da9-4530-b062-fe2fc3cd4330">
<datasetParameter name="paramOccupation">
<datasetParameterExpression><![CDATA[$P{paramOccupation}]]></datasetParameterExpression>
</datasetParameter>
<connectionExpression><![CDATA[$P{REPORT_CONNECTION}]]></connectionExpression>
</datasetRun>
<jr:column width="110" uuid="6eabdd56-6307-4a16-b24d-0bd7f9d8af20">
<jr:columnHeader style="Table_CH" height="30">
<staticText>
<reportElement x="0" y="0" width="110" height="30" uuid="8a77e308-071d-4305-b50d-0a4c2469db0c"/>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font isBold="true"/>
</textElement>
<text><![CDATA[account_num]]></text>
</staticText>
</jr:columnHeader>
<jr:detailCell style="Table_TD" height="30">
<textField>
<reportElement x="0" y="0" width="110" height="30" uuid="894b8b9c-47e8-4943-9ce9-1d5d9da3895d"/>
<textElement textAlignment="Center" verticalAlignment="Middle"/>
<textFieldExpression><![CDATA[$F{account_num}]]></textFieldExpression>
</textField>
</jr:detailCell>
</jr:column>
<jr:column width="130" uuid="bd701c03-37dd-4ac7-9d88-bbd6ad9e6ef3">
<jr:columnHeader style="Table_CH" height="30">
<staticText>
<reportElement x="0" y="0" width="130" height="30" uuid="e0a9941b-2b4e-473c-98bf-c1dc4039b841"/>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font isBold="true"/>
</textElement>
<text><![CDATA[occupation]]></text>
</staticText>
</jr:columnHeader>
<jr:detailCell style="Table_TD" height="30">
<textField>
<reportElement x="0" y="0" width="130" height="30" uuid="8d464964-5455-4479-9ff3-30badb9dbc13"/>
<textElement textAlignment="Center" verticalAlignment="Middle"/>
<textFieldExpression><![CDATA[$F{occupation}]]></textFieldExpression>
</textField>
</jr:detailCell>
</jr:column>
<jr:column width="140" uuid="ec42ddc4-b560-400f-ae5c-2661a02e2607">
<jr:columnHeader style="Table_CH" height="30">
<staticText>
<reportElement x="0" y="0" width="140" height="30" uuid="81af8ec1-0046-4c1e-87dd-fdc7693678b9"/>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font isBold="true"/>
</textElement>
<text><![CDATA[country]]></text>
</staticText>
</jr:columnHeader>
<jr:detailCell style="Table_TD" height="30">
<textField>
<reportElement x="0" y="0" width="140" height="30" uuid="bb5ab017-42ca-49cd-847a-94c55853cc52"/>
<textElement textAlignment="Center" verticalAlignment="Middle"/>
<textFieldExpression><![CDATA[$F{country}]]></textFieldExpression>
</textField>
</jr:detailCell>
</jr:column>
<jr:column width="160" uuid="313a65a4-3caa-494e-a6fb-502eb5030755">
<jr:columnHeader style="Table_CH" height="30">
<staticText>
<reportElement x="0" y="0" width="160" height="30" uuid="ceb0dd75-ca3f-4351-a343-93e4d33515f0"/>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font isBold="true"/>
</textElement>
<text><![CDATA[total_children]]></text>
</staticText>
</jr:columnHeader>
<jr:detailCell style="Table_TD" height="30">
<textField>
<reportElement x="0" y="0" width="160" height="30" uuid="ef9155f3-1e33-405f-9b7f-861d02b5fd95"/>
<textElement textAlignment="Center" verticalAlignment="Middle"/>
<textFieldExpression><![CDATA[$F{total_children}]]></textFieldExpression>
</textField>
</jr:detailCell>
</jr:column>
</jr:table>
</componentElement>
<textField>
<reportElement x="30" y="20" width="130" height="30" uuid="859c4814-f726-45ab-b928-07af80779061"/>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font size="10" isBold="true"/>
</textElement>
<textFieldExpression><![CDATA[$P{paramOccupation}]]></textFieldExpression>
</textField>
</band>
</summary>
</jasperReport>