domingo, 16 de agosto de 2020

DICAS 3032 - WINDEV TUTORIAL 55 - RELATORIO LISTA CLIENTE - PARTE A



https://youtu.be/PK13K593g4M


Bom Dia/Boa Tarde/Boa Noite


Esse Ao Vivo vai estrear as 18:00 do dia 27/08/2020 

DICAS 3032 - WINDEV TUTORIAL 55 - RELATORIO LISTA CLIENTE - PARTE A
Tutoriel WINDEV : Leçon 4.7.a. Imprimer une liste de clients - Requête

ASSUNTOS

VAMOS FAZER UM RELATORIO DE CLIENTES POR PAIS E ESTADO
GERANDO RELATORIO A PARTIR ARQUIVO CLIENTE
ADICIONANDO OS BREAK DE PAIS E ESTADO
MOSTRAR O RELATORIO



Video original da Franca

https://youtu.be/oOtiDiMJYqw


Playlist Windev TUTORIAL












Lesson 4.7. Printing a list of customers
This lesson will teach you the following concepts
  • Creating a report with breaks.
  • Starting the report print.
Lesson duration

Estimated time: 20 mn
Previous LessonTable of contentsNext Lesson
Overview
This lesson is used to print a list of customers, grouped by country and by state or province.
To do so, we are going to use a table report in order to clearly represent a list of data.

Answer

If you did not create the windows in the previous lessons, you can follow this lesson by opening a corrected project: in WINDEV's home page (Ctrl + <), click "Tutorial" and select "Full application (With windows)".
A full corrected application project is also available: in WINDEV's home page (Ctrl + <), click "Tutorial" and select "Full application (Answer)".
Creating the report
  • To create a report:
    1. Click Creating an element among the quick access buttons.
    2. The element creation window appears: click "Report" then "Report". The report creation wizard starts. The report creation wizard proposes several types of reports:
      Report creation wizard - Type of report
    3. Select "Table". Go to the next step.
    4. Select the data source of report. The report will be based on the Customer data file. Select "From a data file or from an existing query".
      Report creation wizard - Data source
      Go to the next step.
    5. In the list of data files and queries, select the "Customer" data file. Go to the next step.
    6. Define the data file search key. In our case, the Customer data file will be browsed using the customer's full name. Select the "FullName" search key.
      Report creation wizard - Browsing the data file
      Go to the next step.
    7. We are now going to define the sort option of data in the report. By default, the wizard proposes the item used as search key in the data file. Since we want to create a report to list customers by country and by state, we will add a sort on these two items.
    8. To add a sort on the country:
      • Click on "+" to add a sort item.
      • In the window that is displayed, select the Customer.Country item.
        Report creation wizard - Adding a sort
      • Validate.
    9. To add a sort on the state:
      • Click on "+" to add a sort item.
      • In the window that is displayed, select the Customer.StateProvinceRegion item.
      • Validate.
    10. Modify the order of sort items. The customers must be sorted by country, by state, then in alphabetical order.
      • The "Customer.Country" item appears in second sort item. Select this item and move it in first sort item via the arrow buttons.
      • The "Customer.StateProvinceRegion" item appears in third sort item. Select this item and move it in second sort item via the arrow buttons.
        Report creation wizard - Data printing order
        Go to the next step.
    11. The wizard asks you to specify whether a break is required.

      Remark

      What is a break?
      Break is an operation used to group the records (or rows) according to one or more criteria. Caution, the records (or rows) will be printed.
      A break is NECESSARILY linked to a sort.
      You will notice the presence of a break header and footer.
      The information common to the different rows is found in the break header.
      The totals, counters, ... are found in the break footer.
      This break is used to group a set of records according to the same criterion. In our example, the break is set on the country and it is used to group all the customers living in the same country.
      Report creation wizard - Break
    12. Answer "Yes". Go to the next step.
    13. Specify the sort item on which the break must be set. In our case, we will be using several breaks:
      • the first break is set on the country.
      • the second break is set on the state.
      Uncheck the "Customer.FullName" item.
      Report creation wizard - Break
    14. Go to the next step.
    15. You are going to specify the order in which the items will be printed and how they will be distributed in the different blocks. In our example:
      • only the country will be in the "Start of break 1" block. The "Country" item is automatically associated with the "Start of break 1".
      • only the state will be in the "Start of break 2" block. The "StateProvinceRegion" item is automatically associated with the "Start of break 2".
      • only the FullName, Address, ZipCode, City, StateProvinceRegion and Country items will be displayed in the report.
      Uncheck the CustomerID, Complement, Phone, Cell and Email items.
      Report creation wizard - Items to display
      Go to the next step.
    16. This step is used to define the report layout.
      Report creation wizard - Paper format
      We will keep the default values with the "Portrait" orientation.

      Remark

      Print margins
      When choosing the print margins, don't forget to take into account the physical margins of printers. The physical margins of printers are margins where no print is allowed. Furthermore, the physical margins differ according to the type of printer.
    17. Go to the next step.
    18. This step allows you to select the skin template used for the report. We recommend that you use the same skin template as the one used for the windows. In our case, select the "Phoenix" skin template for example and go to the next step.
    19. All we have to do now is give a name and caption to the report and save it.
      • Type the title: "List of customers".
      • Keep the name proposed by default: "RPT_List_of_customers".
    20. Validate.
    21. Validate in order to switch to landscape mode.
    22. Accept to reduce the report by validating.
      Report in edit
    23. The report is displayed in the report editor. Save the report.
The report is completed. Let's now run the report test to see the result.
  • Run this report by clicking Run the element test among the quick access buttons. The print destination can be:
    Choose print mode
  • Choose "Report viewer" and validate. The report is run and displayed in the report viewer.
    Displaying the report
You have the ability to print the current page or the entire document by clicking the printer ("Print" pane).


DICAS 2978 - WINDEV TUTORIAL 1 - 1.1B - WINDEV TEMA ESCURO E IDIOMA DO AMBIENTE
DICAS 2979 - WINDEV TUTORIAL 2 - 1.2- CRIAR JANELA E INSERIR TEXTO E EXIBIR
DICAS 2980 - WINDEV TUTORIAL 3 - 2.1- VARIAVEIS PARTE 1
DICAS 2981 - WINDEV TUTORIAL 4 - 2.2- VARIAVEIS ESCOPO - PARTE 2
DICAS 2982 - WINDEV TUTORIAL 5 - 2.1- VARIAVEIS OPERADORES PARTE 3
DICAS 2983 - WINDEV TUTORIAL 6 - 2.1.D - VARIAVEIS STRINGS PARTE 4
DICAS 2984 - WINDEV TUTORIAL 7 - 2.1.E - VARIAVEIS ARRAYS PARTE 5
DICAS 2985 - WINDEV TUTORIAL 8 - 2.2.A - CONDICOES IF-SWITCH PARTE 1
DICAS 2986 - WINDEV TUTORIAL 9 - 2.2.B - CONDICOES PARTE 2
DICAS 2987 - WINDEV TUTORIAL 10 - 2.3.A - LOOP PARTE 1
DICAS 2988 - WINDEV TUTORIAL 11 - 2.3.B - LOOP EXEMPLOS PARTE 2
DICAS 2989 - WINDEV TUTORIAL 12 - Lesson 2.4. The procedures - PARTE 1
DICAS 2990 - WINDEV TUTORIAL 13 - Leçon 2.4.b. Procedures Parametros - PARTE 2
DICAS 2991 - WINDEV TUTORIAL 14 - PROCEDURES REFERENCIA - PARTE 3
DICAS 2992 - WINDEV TUTORIAL 15 - PROCEDURES OPCIONAIS OU OBRIGATORIAS - PARTE 4
DICAS 2993 - WINDEV TUTORIAL 16 - PROCEDURES EXEMPLOS - PARTE 5
DICAS 2994 - WINDEV TUTORIAL 17 - PERGUNTAS E RESPOSTA - PARTE 1
DICAS 2995 - WINDEV TUTORIAL 18 - PERGUNTAS E RESPOSTA - PARTE 2
DICAS 2996 - WINDEV TUTORIAL 19 - WINDEV E OS BANCOS DE DADOS
DICAS 2997 - WINDEV TUTORIAL 20 - PROJETO E ANALISE - CRIACAO
DICAS 2998 - WINDEV TUTORIAL 21 - PROJETO E ANALISE - ARQUIVOS DADOS CLIENTE - PARTE 2
DICAS 2999 - WINDEV TUTORIAL 22 - PROJETO E ANALISE - ARQUIVOS DADOS CRIACAO ARQUIVO PEDIDO - PARTE 3
DICAS 3000 - WINDEV TUTORIAL 23 - PROJETO E ANALISE - IMPORTANDO CVS-ARQUIVO TEXTO - PARTE 4
DICAS 3001 - WINDEV TUTORIAL 24 - PROJETO E ANALISE - IMPORTANDO ARQUIVO PRODUTO - PARTE 5
DICAS 3002 - WINDEV TUTORIAL 25 - PROJETO E ANALISE - LINK - PARTE 6
DICAS 3003 - WINDEV TUTORIAL 26 - RAD COMPLETO
DICAS 3004 - WINDEV TUTORIAL 27 - VISAO GERAL
DICAS 3005 - WINDEV TUTORIAL 28 - Adicionar e Modificar Janelas PRODUTOS - PARTE A
DICAS 3006 - WINDEV TUTORIAL 29 - Adicionar e Modificar Janelas PRODUTOS Formulario - PARTE B
DICAS 3007 - WINDEV TUTORIAL 30 - Adicionar e Modificar Janelas PRODUTOS ALINHAR CAMPOS - PARTE C



DICAS 3031 - WINDEV TUTORIAL 54 - IMPRIMIR PEDIDO - MENU RELATORIO - PARTE D



https://youtu.be/P4rtr-NCiCs


Bom Dia/Boa Tarde/Boa Noite

Esse Ao Vivo vai estrear as 16:00 do dia 27/08/2020 

DICAS 3031 - WINDEV TUTORIAL 54 - IMPRIMIR PEDIDO - MENU RELATORIO - PARTE D
Tutoriel WINDEV : Leçon 4.6.d. Imprimer une commande - Affichage de l'état imprimé depuis le menu

ASSUNTOS

explicando como sera o menu para chamar o relatorio
criando o menu popup
criando o codigo para chamar o relatorio 
   iDestination
   iInitReportQuery
   iPrintReport
ir tabela e adicionar o menu popup 
Mostrando o Relatorio funcionando 
     

Video original da Franca

https://youtu.be/elnVD8h7-RY


Playlist Windev TUTORIAL

=============================================

// menu popup
// Print in the report viewer
// Imprime nos relatórios do visualizador

iDestination(iViewer) 

// Initializes the report query
// Inicializa a consulta do status

iInitReportQuery(RPT_PEDIDO_FORMULARIO,TABLE_QRY_pedido_consulta) 

// Starts printing the report
// Inicializa a consulta do status

iPrintReport(RPT_PEDIDO_FORMULARIO) // Inicializa a consulta do status











Displaying the printed report from a menu option
In our application, the "RPT_Order_form" report will be printed from an option found in the popup menu of the Table control used to list the requested orders.
As already seen, the Table control proposes an automatic menu. We want to keep the options of this automatic menu and add an option that will be used to print the selected order form.
The principle is as follows:
  1. We are going to create a new popup menu. This menu will contain the WLanguage code used to print the report.
  2. We are going to link this popup menu to the Table control and specify that the default popup menu will be displayed just after the popup menu defined for the Table control.

Creating the popup menu

  • To create a popup menu in the "WIN_Menu" window:
    1. Open the "WIN_Menu" window in the editor if necessary (double-click its name in the "Project explorer" pane for example).
    2. On the "Window" pane, in the "Bars and menus" group, expand "Popup menus" and select "New popup menu".
    3. A new popup menu appears in the editor. This menu option includes a single option named "Menu option".
      Popup menu in edit mode
    4. Open the popup menu description:
      • Select "Menu option".
      • Open the popup menu (right click).
      • Select "Description of popup menu".
    5. Give a name to the popup menu ("MENU_Order") and validate.

Remark

Popup menus and windows
A popup menu is associated with a window. If a window includes several popup menus (popup menu of window, popup menus of controls, ...), all these menus are saved with the window.
  • We are now going to define the option caption and write its WLanguage code.
    1. Select "Menu option".
    2. Press the Space key on the keyboard: the caption becomes editable. Type the new caption ("Print the order form") and validate.
    3. Display the WLanguage events associated with the option:
      • Select the option.
      • Open the popup menu (right click) and select "Code".
    4. Write the following WLanguage code:
      // Print in the report viewer
      iDestination(iViewer)
      // Initializes the report query
      iInitReportQuery(RPT_Order_form, ...
      TABLE_QRY_FindOrders.COL_OrdersID)
      // Starts printing the report
      iPrintReport(RPT_Order_form)
      In this code:
      • iDestination is used to specify that the report will be printed in the report viewer.
      • iInitReportQuery is used to specify the parameters expected by the query associated with the report. In our case, the query expects the order number in parameter. This order number is found in the COL_OrdersID column of the TABLE_QRY_FindOrders Table control for the current row.
      • iPrintReport is used to print the specified report (the RPT_Order_form report in our case).
    5. Close the code window and the window containing the popup menu.
    6. Save the "WIN_Menu" window.

Associating the popup menu with the Table control

  • Last step: we are going to link the popup menu to the Table control.
    1. In the "WIN_Menu" window, display the "Finding orders" tab.
    2. Select the Table control and open its description ("Table description" from the popup menu of control).
    3. In the "UI" tab, expand the "Popup menu" combo box.
    4. Check "Add a popup menu", select the "MENU_Order" menu and select "At the beginning" to specify that the menu is placed before the system menu.
      Popup menu
    5. Click inside the window to validate the popup menu.
    6. Validate.

Print test

  • Now, all we have to do is run a real test:
    1. Run the test of "WIN_Menu" window.
    2. Select the "Finding orders" tab pane.
    3. Specify the criteria and start a search.
    4. Select one of the orders displayed in the Table control.
    5. Print the order via the popup menu.
      Report test
    6. Close the report viewer and the test window.

DICAS 2978 - WINDEV TUTORIAL 1 - 1.1B - WINDEV TEMA ESCURO E IDIOMA DO AMBIENTE
DICAS 2979 - WINDEV TUTORIAL 2 - 1.2- CRIAR JANELA E INSERIR TEXTO E EXIBIR
DICAS 2980 - WINDEV TUTORIAL 3 - 2.1- VARIAVEIS PARTE 1
DICAS 2981 - WINDEV TUTORIAL 4 - 2.2- VARIAVEIS ESCOPO - PARTE 2
DICAS 2982 - WINDEV TUTORIAL 5 - 2.1- VARIAVEIS OPERADORES PARTE 3
DICAS 2983 - WINDEV TUTORIAL 6 - 2.1.D - VARIAVEIS STRINGS PARTE 4
DICAS 2984 - WINDEV TUTORIAL 7 - 2.1.E - VARIAVEIS ARRAYS PARTE 5
DICAS 2985 - WINDEV TUTORIAL 8 - 2.2.A - CONDICOES IF-SWITCH PARTE 1
DICAS 2986 - WINDEV TUTORIAL 9 - 2.2.B - CONDICOES PARTE 2
DICAS 2987 - WINDEV TUTORIAL 10 - 2.3.A - LOOP PARTE 1
DICAS 2988 - WINDEV TUTORIAL 11 - 2.3.B - LOOP EXEMPLOS PARTE 2
DICAS 2989 - WINDEV TUTORIAL 12 - Lesson 2.4. The procedures - PARTE 1
DICAS 2990 - WINDEV TUTORIAL 13 - Leçon 2.4.b. Procedures Parametros - PARTE 2
DICAS 2991 - WINDEV TUTORIAL 14 - PROCEDURES REFERENCIA - PARTE 3
DICAS 2992 - WINDEV TUTORIAL 15 - PROCEDURES OPCIONAIS OU OBRIGATORIAS - PARTE 4
DICAS 2993 - WINDEV TUTORIAL 16 - PROCEDURES EXEMPLOS - PARTE 5
DICAS 2994 - WINDEV TUTORIAL 17 - PERGUNTAS E RESPOSTA - PARTE 1
DICAS 2995 - WINDEV TUTORIAL 18 - PERGUNTAS E RESPOSTA - PARTE 2
DICAS 2996 - WINDEV TUTORIAL 19 - WINDEV E OS BANCOS DE DADOS
DICAS 2997 - WINDEV TUTORIAL 20 - PROJETO E ANALISE - CRIACAO
DICAS 2998 - WINDEV TUTORIAL 21 - PROJETO E ANALISE - ARQUIVOS DADOS CLIENTE - PARTE 2
DICAS 2999 - WINDEV TUTORIAL 22 - PROJETO E ANALISE - ARQUIVOS DADOS CRIACAO ARQUIVO PEDIDO - PARTE 3
DICAS 3000 - WINDEV TUTORIAL 23 - PROJETO E ANALISE - IMPORTANDO CVS-ARQUIVO TEXTO - PARTE 4
DICAS 3001 - WINDEV TUTORIAL 24 - PROJETO E ANALISE - IMPORTANDO ARQUIVO PRODUTO - PARTE 5
DICAS 3002 - WINDEV TUTORIAL 25 - PROJETO E ANALISE - LINK - PARTE 6
DICAS 3003 - WINDEV TUTORIAL 26 - RAD COMPLETO
DICAS 3004 - WINDEV TUTORIAL 27 - VISAO GERAL
DICAS 3005 - WINDEV TUTORIAL 28 - Adicionar e Modificar Janelas PRODUTOS - PARTE A
DICAS 3006 - WINDEV TUTORIAL 29 - Adicionar e Modificar Janelas PRODUTOS Formulario - PARTE B
DICAS 3007 - WINDEV TUTORIAL 30 - Adicionar e Modificar Janelas PRODUTOS ALINHAR CAMPOS - PARTE C








Teste

Teste
teste