Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migration of unmigrated content due to installation of a new plugin
Wiki Markup
{scrollbar}
----
Esta sección describe como agregar un parámetros que manejen fechas.

El ejemplo terminado puede consultarse aquí.

h3. Creando Parámetros sobre Fechas

{note:title=Nota}
Se recomienda haber leido antes [Parametrizacion en Cascada].
{note}
\\
En el siguiente ejemplo se muestra cómo definir un reporte donde ver litros de vinos vendidos por todos los vendedores, parametrizando en los meses.

Primero cree un conjunto de datos (*Data Set) * que contenga la siguiente información:
    * *Name*: Años
    * *Data Source*: O3 MDX View
    * *Data Set Type*: O3 Data Set
    * *Query* La siguiente expresion en *MDX*:
{code:SQL}

...

This section describes how to add parameters to manage dates. 

The finished example can be seen here.

Creating Parameters on Dates 

Note
titleNota

It is advisable to have read Cascading Parameterizing before.

In the following example we show how to define a report where to see litres sold by all salespeople, parameterizing the months. 

First create a Data Set  containing the following information.
    * Name: Years
    * Data Source: O3 MDX View
    * Data Set Type: O3 Data Set
    * Query The following expression in MDX:

Code Block
SQL
SQL
SELECT {[Fecha].[Año].members} ON COLUMNS
FROM [Vinos]
{code}
 Una vez definido el *Data Set* se podrá visulizar el mismo desde la vista *Data Explorer* (Explorador de datos) del O3Reporting:

                            !Data Explorer 1.png!

Para continuar realice los siguientes pasos: 
# Haga click derecho en *Report Parameters* y elija la opción *New Cascading Parameter* y cree una cascada de parametros con nombre *Fechas*.
  !Cascading Parameter 1.png!
# Presione *Add* para agregar un parámetro a la cascada.
# Ingrese los siguientes datos: 
| *Name:* | El nombre del parámetro \\
En nuestro caso *Año* |
| *Data Set:* | Conjunto de datos al cual está asociado el parámetro. \\
En nuestro caso usaremos el conjunto de datos *Años* |
| *Value:* \\ | Valor que tendrá el parámetro. \\
En nuestro caso usaremos *unique_name* |
| *Display Text:* | Texto a mostrar en el repotye \\
En nuestro caso *label* |
  !Add Parameter 1.png!
# Presione *OK * para continuar, aparecerá la siguiente pantalla (Recuerde que *Multiple Data Set* debe estar seleccionado):
  !Cascading Parameter 2.png!
# Presione *OK * para continuar.
# Cree un conjunto de datos (*Data Set) * que contenga la siguiente información:
    * *Name*: Meses
    * *Data Source*: O3 MDX View
    * *Data Set Type*: O3 Data Set
    * *Query* La siguiente expresion en *MDX*
{code:SQL}

 Once defined the Data Set it can be seen from the Data Explorer view of O3Reporting:

                            Image Added

To continue follow these steps: 

  1. Right-click on Report Parameters and choose the New Cascading Parameter option and create a parameter cascade under the name Dates (Fechas)
      Image Added
  2. Press Add to add a parameter to the cascade 
  3. Enter the follwing data :

    Name:

    The name of the parameter
    In our case Year (Año) 

    Data Set:

    Data set to which the parameter is associated 
    In our case we will use the Data Set Years (Años)

    Value:

    Value the parameter will have
    In our case we will use  unique_name

    Display Text:

    Text to be shown in the report 
    In our case: label

      Image Added
  4. Press OK  to continue. The following screen will pop up (Remember Multiple Data Set must be selected ):
      Image Added
  5. Press OK  to continue:
  6. Create a Data Set  containing the following information :
        * Name: Months
        * Data Source: O3 MDX View
        * Data Set Type: O3 Data Set
        * Query: The following expression in MDX
    Code Block
    SQL
    SQL
    
    SELECT Descendants([Fecha].?, [Fecha].[Mes]) ON COLUMNS
    FROM [Vinos]
    

...

  1. Add the parameter Year (Año) to the Data set created as indicated in Simple Parameterizing 
      Once the Data Set has been performed the Data Explorer view of your eclipse should look as shown below: 
      Image Added
  2. Right click on Cascading Parameter Group - Fechas (dates) and select the Edit option. The following screen will appear.
      Image Added
  3. Select Add to add a new parameter to the cascade. 
  4. Enter the following data:

    Name:

    The name of the parameter
    In our case Month (Mes) 

    Data Set:

    The data set to which the parameter is associated 
    In our case we will use the data set Months  

    Value:

    Value the parameter will have 
    In our case we will use unique_name

    Display Text:

    Text to be shown in the report
    In our case label

      Image Added                
  5. To continue press OK. The following screen will pop up.
      Image Added
  6. Press OK to continue 
      The Data Explorer view of your eclipse should look like this:
      Image Added
  7. Create a Data Set   containing the following information:
        * Name: Sales by Salesperson and Months
        * Data Source: O3 MDX View
        * Data Set Type: O3 Data Set
        * Query The following expression in MDX:
    Code Block
    SQL
    SQL
    
    SELECT
    	{[Fecha].?} ON COLUMNS,
    	{[Vendedores].[Vendedor].members} ON ROWS
    FROM [Vinos]
    WHERE Measures.[Litros Vendidos]
    

...

  1. Add the parameter Months (Meses) to the Data set created as indicated in Simple Parameterizing 
      Once the Data Set has been performed Set the Data Explorer view of your eclipse should look as shown below:
      Image Added
  2. Create a table with the information Sales by Salesperson and Months as explained in Designing Report Layout
  3. Select Preview. The following screen will pop up. 
      Image Added
  4. Select the Year  for which you wish to see the litres sold by the salespeople. The values for Months will be automatically updated.  
  5. Select the Month for which you want to see the report  
  6. Click OK 

For instance, if you choose "2002" as Year, and "mar/2002" as Month the report will show:  

Wine (vino)

Litres Sold (litros Vendidos)

G & P Corp.

5850

Link S.R.L.

1800

Mykonos

0

...

...

Susana Garcia

2700

If you wish to change the value of the parameter you will have to click on Show Report Parameters and the previous window will be opened again, where you can choose a new year and month  

...

Wiki Markup
{scrollbar}