estylos datawindow

10
N-Up Presentación Estilo El estilo de presentación muestra los datos de N-Up en un formato similar a la de las columnas de los periódicos, que le permite utilizar el espacio de manera eficiente mediante la visualización de más de un registro a través de las páginas. Otro ejemplo podría ser un directorio telefónico, donde se encuentran varias columnas. Vamos a crear un DataWindow con campos product_no y product_description y con dos registros por fila. 1. Seleccione Archivo> Nueva opción de menú y haga clic en la pestaña DataWindow. 2. Seleccione el estilo de presentación N-Up. 3. Seleccione la fuente de datos SQL SELECT. 4. Seleccionar tabla product_master y haga clic en el botón Abrir. 5. Seleccione product_no, columnas product_description de la tabla product_master haciendo clic en esas columnas. 6. Seleccione "Archivo> Vuelta a DataWindow Pintor 'opción de menú. 7. PowerBuilder le pide el número de registros por fila. Escriba 2. PowerBuilder muestra los datos de izquierda a derecha y luego de arriba a abajo como se ve en el ejemplo anterior. PowerBuilder no permite que usted altere esta organización, ya que no hay ninguna opción para mostrar los datos de arriba a abajo y luego de izquierda a derecha.

description

Estilos datawindonw del curso de computacion 3

Transcript of estylos datawindow

N-Up Presentacin EstiloEl estilo de presentacin muestra los datos de N-Up en un formato similar a la de las columnas de los peridicos, que le permite utilizar el espacio de manera eficiente mediante la visualizacin de ms de un registro a travs de las pginas. Otro ejemplo podra ser un directorio telefnico, donde se encuentran varias columnas. Vamos a crear un DataWindow con campos product_no y product_description y con dos registros por fila.1. Seleccione Archivo> Nueva opcin de men y haga clic en la pestaa DataWindow.2. Seleccione el estilo de presentacin N-Up.3. Seleccione la fuente de datos SQL SELECT.4. Seleccionar tabla product_master y haga clic en el botn Abrir.5. Seleccione product_no, columnas product_description de la tabla product_master haciendo clic en esas columnas.6. Seleccione "Archivo> Vuelta a DataWindow Pintor 'opcin de men.7. PowerBuilder le pide el nmero de registros por fila. Escriba 2.

PowerBuilder muestra los datos de izquierda a derecha y luego de arriba a abajo como se ve en el ejemplo anterior. PowerBuilder no permite que usted altere esta organizacin, ya que no hay ninguna opcin para mostrar los datos de arriba a abajo y luego de izquierda a derecha.

Una vez que se especifica el nmero de registros para la fila de detalles e ir a la vista de diseo, no se puede cambiar el nmero de registros. Si quieres, tienes que hacerlo desde cero de nuevo

LABEL Presentacin EstiloEl estilo de presentacin de etiquetas le permite crear etiquetas de los datos existentes. El uso tpico de este estilo como ustedes sabrn es para la impresin de direcciones. Vamos a generar etiquetas con product_no y producto-descripcin para pegarlos en el envase del producto.Usted puede elegir entre una amplia seleccin de tamaos de etiquetas pre-definidas o crear un tamao de etiqueta personalizada. Tambin puede alterar el espacio, nmero de etiquetas por pgina y especificar arriba a abajo o de izquierda a derecha de la pantalla. A diferencia del estilo de presentacin N-Up, puede cambiar las especificaciones de la etiqueta en la hoja de propiedades, incluso cuando usted est en la vista de diseo (despus de salir del asistente).CROOSTAB Presentacin EstiloSin este estilo de presentacin, se termina de escribir cientos de lneas de cdigo en la aplicacin PowerBuilder, o el DBA tiene que escribir enormes procedimientos almacenados. Digamos que la tabla trans tiene los siguientes datos.

ay por ejemplo que desea imprimir un informe que muestra todos los productos y la cantidad emitida cada da. Eso significa, que una lista de todos los productos uno por cada fila, y una lista de las fechas horizontalmente. Recuerde, cada mes tiene diferente nmero de das, 28, 29, 20, 31. (20 no es un error, si el informe se genera en 20 de un mes, a continuacin, el informe debera incluir fechas slo hasta el 20). Eso significa que usted necesita para pintar cuatro informes y utilizar el apropiado dependiendo del mes. Para imprimir slo aquellas fechas en el rubro para el cual existen datos es realmente un trabajo duro. Deje que el informe que desea parecerse a:

Si se utiliza el estilo de presentacin de referencias cruzadas, entonces no hay necesidad de cuatro informes. En su lugar, pintar uno y PowerBuilder se har cargo del resto. PowerBuilder tambin imprime el resumen al final de cada registro (derecho ms cara) y al final del informe. Bueno, tambin puede imprimir el pie de pgina para cada pgina. Vamos a ver cmo pintar este tipo de DataWindow.

Seleccione Archivo> Nueva opcin de men y haga clic en la pestaa DataWindow.Seleccione el estilo de presentacin de referencias cruzadas.Seleccione la fuente de datos SQL SELECT.Seleccione product_master y mesas trans y haga clic en el botn Abrir.Seleccione product_description, tran_date, columnas tran_qty y pintar la fuente de datos como se muestra en la siguiente imagen. Asegrese de que usted define tres argumentos como se muestra en la tabla que aparece debajo de la imagen.

Esta consulta trae todas las transacciones de tipo dado para el mes dado en un ao determinado a partir de tablas trans y product_master. Una vez definida la fuente de datos, seleccione 'Archivo> Vuelta a DataWindow Pintor' opcin de men. PowerBuilder le pide la definicin de referencias cruzadas.

ExamplesThis section shows how to specify the data for several different graphs of the data in thePrintertable in the EAS Demo DB. The table records quarterly unit sales of three printers by three sales representatives.Table 26-7: The Printer table in the EAS Demo DB

RepQuarterProductUnits

SimpsonQ1Stellar12

JonesQ1Stellar18

PerezQ1Stellar15

SimpsonQ1Cosmic33

JonesQ1Cosmic5

PerezQ1Cosmic26

SimpsonQ1Galactic6

JonesQ1Galactic2

PerezQ1Galactic1

SimpsonQ4Stellar30

JonesQ4Stellar24

PerezQ4Stellar36

SimpsonQ4Cosmic60

JonesQ4Cosmic52

PerezQ4Cosmic48

SimpsonQ4Galactic3

JonesQ4Galactic3

PerezQ4Galactic6

Graphing total salesTo graph total sales of printers in each quarter, retrieve all the columns into a DataWindow object and create a graph with the following settings on the Data page in the Properties view: Set Rows toAll Set Category toquarter Set Value tosum(units for graph)Leave the Series check box and text box empty.TheQuartercolumn serves as the category. Because theQuartercolumn has four values (Q1, Q2, Q3, and Q4), there will be four categories along the Category axis. You want only one series (total sales in each quarter), so you can leave the Series box empty, or type a string literal to identify the series in a legend. Setting Value tosum(units for graph)graphs total sales in each quarter.Here is the resulting column graph. PowerBuilder automatically generates the category text based on the data in the table:

In the preceding graph, there is one set of data points (one series) across four quarters (the category values).The following is a pie graph, which has exactly the same properties as the preceding column graph except for the type, which is Pie:

In pie graphs, categories are shown in the legend.Graphing unit sales of each printerTo graph total quarterly sales of each printer, retrieve all the columns into a DataWindow object and create a graph with the following settings on the Data page in the Properties view: Set Rows toAll Set Category toquarter Set Value tosum(units for graph) Select the Series check box Set Series toproductYou want a different series for each printer, so the columnProductserves as the series. Because theProductcolumn has three values (Cosmic, Galactic, and Stellar), there will be three series in the graph. As in the first example, you want a value for each quarter, so theQuartercolumn serves as the category, and you want to graph total sales in each quarter, so the Value box is specified assum(units for graph).Here is the resulting graph. PowerBuilder automatically generates the category and series labels based on the data in the table. The series labels display in the graphs legend:

Graphing unit sales by representativeTo graph quarterly sales made by each representative, create a graph with the following settings on the Data page in the Properties view: Set Rows toAll Set Category toquarter Set Value tosum(units for graph) Select the Series check box Set Series torepHere is the resulting graph:

Graphing unit sales by representative and total salesTo graph quarterly sales made by each representative, plus total sales for each printer, create a graph with the following settings on the Data page in the Properties view: Set Rows toAll Set Category toquarter, "Total" Set Value tosum(units for graph), sum(units for graph) Select the Series check box Set Series torep, rep

Here you have two types of categories: the first is Quarter, which shows quarterly sales, as in the previous graph. You also want a category for total sales. There is no corresponding column in the DataWindow object, so you can simply type the literal Total to identify the category. You separate multiple entries with a comma.For each of these category types, you want to graph the sum of units sold for each representative, so the Value and Series values are repeated.Here is the resulting graph:

Notice that PowerBuilder uses the literal Total supplied in the Category box in the Graph Data window as a value in the Category axis.Graphing actual and projected salesTo graph total quarterly sales of all printers and projected sales for next year, create a graph with the following settings on the Data page in the Properties view (you assume that sales will increase by 10% next year): Set Rows toAll Set Category toquarter Set Value tosum(units for graph), sum(units*1.1 for graph) Select the Series check box Set Series to'Actual','Projected'You are using labels to identify two series, Actual and Projected. Note the single quotation marks around the literals. For Values, you enter the expressions that correspond to Actual and Projected sales. For Actual, you use the same expression as in the examples above,sum(units for graph). For Projected sales, you multiply each unit sale by 1.1 to get the 10 percent increase. Therefore, the second expression issum(units*1.1 for graph).Here is the resulting graph. PowerBuilder uses the literals you typed for the series as the series labels in the legend: