<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"><channel><category>pcsoft.us.windev</category><copyright>Copyright 2026, PC SOFT</copyright><lastBuildDate>4 Jan 2018 23:03:00 Z</lastBuildDate><pubDate>4 Jan 2018 23:03:00 Z</pubDate><description>In December a client requested a number of pivot table reports. Previously, these had been produced in our own FoxPro report writer, using Excel automation code (to extract locally held data and create all the pivot tables). The client required a proof-of-concept before upgrading to our new Windev report writer.&#13;
&#13;
I reviewed the available Windev options:&#13;
- Crosstab report - User edition of Reports &amp; Queries&#13;
- Pivot table control&#13;
And compared them to Excel 2016 plus Power query &amp; Pivot.&#13;
&#13;
Crosstab reports are an option, but Reports &amp; Queries is a complex report medium; Pivot Table controls are only an option for Windev programmers, and my role (and capability…) is to develop reports for users via reports &amp; queries, or any suitable means.&#13;
&#13;
Excel 2016 and its pivot table reports are without doubt the best option from a data content and presentation viewpoint. In conjunction with Power Query, I was able to create user-friendly reports from our local HFSQL database, which only require opening an Excel workbook, entering in report dates, and refreshing the pivot tables.&#13;
&#13;
I haven't found any information on Windev forums covering this process, so a brief summary is as follows:&#13;
&#13;
1. Open an ODBC connection to HFSQL (C/Server)&#13;
&#13;
See Windev Help - HFSQL connections for details&#13;
In Excel, go to Data &gt; Get Data &gt; From Other sources &gt; ODBC; select Advanced options, then provide the connection string:&#13;
DRIVER={HFSQL};Server Name=127.0.0.1;Server Port=4900;Database=dbName;&#13;
Notes:&#13;
Replace dbName with your database name&#13;
Localhost works in place of 127.0.0.1&#13;
UID and Password should be omitted here, but are supplied in the next step.&#13;
An OLEDB connection could be used instead.&#13;
&#13;
2. Provide credentials when requested&#13;
&#13;
3. Select one or more database tables&#13;
You will then be returned to the Query screen, with selected tables listed on the left (as queries).&#13;
&#13;
4. Create joins on selected tables&#13;
In Power query this is called merging tables. In this process, two tables and their linked fields are selected, and the join type (left/right/inner) can be specified.&#13;
The joined table appears as a single column in the primary table; this column can be expanded to select only the fields required.&#13;
&#13;
5. Transform the field content as required&#13;
This may involve adding new fields, or filtering on selected field values. Formulae can be created using Microsoft’s M-Language.&#13;
&#13;
6. Save the query&#13;
Choose to save as connection only, or add this data to the data model (possibly suitable for larger data tables). Connection-only queries will take longer to refresh later.&#13;
Note: Testing of the data model is ongoing, as it could greatly reduce refresh time for the pivot tables.&#13;
&#13;
7. Parameters&#13;
Multiple parameters such as dates may be stored in a worksheet table, and by using special queries (found after extensive internet searching), made available to the Power Query. The entire query can be viewed as code and edited for this purpose.&#13;
&#13;
8. Pivot tables&#13;
A pivot table can be inserted to any worksheet, specifying an existing connection as the source, which will be a named power query.&#13;
&#13;
&#13;
Excel Power Query plus Pivot tables represents a flexible user-friendly reporting option. Our data sources usually amount to tables of less than 100K records, so performance is adequate.</description><ttl>30</ttl><generator>WEBDEV</generator><language>en_US</language><link>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/63851-excel-2016-power-query-amp-pivot-tables/read.awp</link><title>Excel 2016 - Power Query &amp;amp; Pivot tables</title><managingEditor>moderateur@pcsoft.fr (El moderador)</managingEditor><webMaster>webmaster@pcsoft.fr (El webmaster)</webMaster></channel></rss>
