IMDTouchKnowledge BaseShop main store

Selection guide

Why WinCC Flexible Builds SQL Batch Tables Without a Grid

HMI and touchscreens Published 7 min read By IMDTouch engineering team

Short answer

WinCC Flexible 2008 SP3 has no native DataGrid control, so it cannot scroll a variable-length SQL result set. For a single-user batch plant, build a short fixed-row table from scripts and I/O fields, launch a separate reporting application on a Windows PC runtime, or move the reporting scope to WinCC Explorer or WinCC Professional.

On this page
  1. What is the customer actually asking for?
  2. Why can't WinCC Flexible show the records in a table like a DataGrid?
  3. Which of the three architectures fits your report?
  4. How do you decide between them on your own project?
  5. How do you implement the external reporting application path?
  6. What does the migration path cost you?
  7. The decision, in one line per case
  8. Questions asked

WinCC Flexible 2008 SP3 cannot scroll a database result set: it has no native DataGrid-style control. For a single-user asphalt batch plant whose PLC logic already runs in SIMATIC Manager 5.5, the decision comes down to the report itself. If the operator needs only a short, bounded summary of recent batches, build a fixed-row table from scripts, internal tags, and I/O fields inside the existing project. If the report is an open-ended, filterable archive by date or batch name, keep WinCC Flexible for process visualization and launch a separate reporting application on a Windows PC runtime, or move the reporting scope to WinCC through the WinCC Explorer or WinCC Professional path. Pick by row count and interactivity, not by familiarity with the tool.

What is the customer actually asking for? #

The requirement has two separate parts: capture a durable batch record in Microsoft SQL Server, and let operators query and display historical records filtered by date or batch name. Splitting them keeps the decision honest, because the first part WinCC Flexible already does well and the second part is where it falls short.

A single-user project describes the number of operator stations, not the shape of the reporting problem. Even one operator querying history gets variable row counts, sorting, empty values, timestamps, aborted batches, and SQL errors to handle. Write down who owns each function before choosing a tool: the PLC owns sequence execution and live state, one logging component owns converting completed process data into the transactional batch record, and the reporting interface only reads those records. The existing, validated PLC logic in SIMATIC Manager 5.5 does not change in any of the three architectures below, so treat this as an application-layer decision and keep it that way.

Why can't WinCC Flexible show the records in a table like a DataGrid? #

WinCC Flexible visualization objects are built around configured tags and fixed screen elements, and the product provides no DataGrid-style control that maps a variable-length SQL result set onto rows. There is no documented equivalent to the C# DataGridView you would reach for in a desktop application.

You can approximate a table with the base functions: a script runs or receives the query, copies each value into predefined internal tags, and a bank of I/O fields displays those tags in a fixed grid. That technique is defensible for a small, fixed list — say the last ten batches on one screen. It becomes fragile for an open-ended archive because every visible cell consumes configuration, the display cannot expand with the result, and each added column multiplies the scripting and testing burden for row mapping, paging, refresh, selection, and error recovery. It is a simulation of a grid, not a relational one.

Which of the three architectures fits your report? #

Architecture Strength Main constraint Use it when
WinCC Flexible with fixed I/O fields Minimum change to existing screens Custom scripts and a fixed number of visible rows The operator needs only a short, bounded summary
WinCC Flexible plus an external reporting application Keeps the finished visualization while giving SQL results a proper grid Needs a Windows PC runtime that can launch and host the external program The HMI is substantially complete and reporting can stay a separate program
WinCC via WinCC Explorer or WinCC Professional Visualization, archiving, and reporting live in one SCADA environment Migration, screen rework, licensing review, regression testing Reporting is part of a larger plant data, alarm, audit, or expansion strategy

The external-application route is the lowest-disruption path midway through a project, but only when the runtime is a Windows PC that permits starting an external process — a dedicated operator panel does not offer that operating environment, and if your target cannot host the reporting runtime, this path is eliminated. Before committing, confirm the launch behavior on your actual target; the same launch-an-external-program question comes up for document viewers, as in opening PDF files from WinCC Flexible 2008 runtime. The WinCC Explorer or Professional route is the right call when the archive must be tied into operator navigation, alarms, or plant growth — the differences between the WinCC environments are laid out in WinCC Explorer vs Advanced, Professional, Flexible and Unified. Do not migrate solely because the project touches SQL Server; migrate when the integrated functions justify rebuilding and retesting the HMI.

How do you decide between them on your own project? #

Run this diagnostic in order, and stop at the first answer that eliminates a path:

  1. Identify the runtime target. Record whether WinCC Flexible 2008 SP3 runs on a Windows PC or a dedicated panel. If it is a panel and the report needs variable rows, only the migration path survives.
  2. Define the batch boundary. Name the PLC event that means a batch is complete, and decide how aborted, restarted, or manually corrected batches are recorded.
  3. Define the record key. Use a unique batch identity independent of the human-readable name, since names repeat.
  4. List the report columns and filters. Fix the date interpretation, batch-name matching, sort order, result limit, and whether operators need export or printing.
  5. Assign database writes. One writer per batch record — never both the HMI and the external application inserting the same completion event.
  6. Test SQL Server failure behavior. Decide how records are queued or flagged while the server is down and how duplicate insertion is prevented after recovery.
  7. Estimate migration effort. Inventory screens, tags, scripts, alarms, recipes, user actions, and navigation that a move to another WinCC environment would rebuild.

If step 1 lands on a PC runtime and step 4 produces a short fixed list, the I/O-field workaround is adequate. If step 4 produces variable, interactive, growing result sets, use a real reporting interface rather than a simulated grid. If you migrate, review what the SCADA runtime license covers beyond running the project before you commit, because the licensing scope is part of the migration cost.

How do you implement the external reporting application path? #

Keep live plant control, status, and operator commands in the existing WinCC Flexible project untouched. The reporting application owns the SQL query, the date and batch-name filters, the result grid, pagination, and any report output. Add a WinCC Flexible button that launches or activates it, but only after proving on your runtime target that external process execution works and that switching between the two programs is acceptable to operations. Configure explicit navigation back to the HMI, prevent multiple instances of the reporting program, and show a clear message when the reporting application or SQL Server is unavailable.

On the database side, keep SQL credentials out of visible screen scripts and grant the reporting connection only the permissions it needs — read on the batch tables and nothing more. Insert each completed batch as one logical transaction so a power loss mid-record cannot leave a half-written batch in the archive.

What does the migration path cost you? #

Freeze the working WinCC Flexible application as the behavioral reference, then rebuild communications, tags, screens, alarms, scripts, navigation, and reporting in the new WinCC project. Connect the reporting layer to the SQL batch archive using the archiving and reporting facilities of the selected product instead of custom scripts. Validate every process command and indication against the original application before commissioning — the frozen project is your acceptance test, not a suggestion.

One safety note that belongs here regardless of architecture: the reporting layer reads records, so prove during commissioning that no reporting function, filter, or archive query can write to a tag the PLC uses for sequence execution or operator commands.

The decision, in one line per case #

Short fixed list, panel or PC: stay in WinCC Flexible with the scripted I/O-field table. Variable filterable archive on a Windows PC runtime you control: keep WinCC Flexible and launch a separate reporting application. Archive integrated with alarms, audits, or plant growth: move the reporting scope to WinCC Explorer or WinCC Professional and budget the migration and regression test. In every case, one writer per batch record and a unique batch key.

Questions asked

Does WinCC flexible 2008 SP3 have any control that behaves like a data grid?

No. Its visualization objects are built around configured tags and fixed screen elements, and there is no native DataGrid-style control for a variable-length database result set. A third-party custom control is not a documented option either. The only native technique is a script that fills internal tags shown in fixed I/O fields arranged to look like a table.

Can a button in WinCC flexible open another program during runtime?

On a Windows PC runtime, a configured button can start or activate an external executable, which is how a separate reporting application is opened next to the visualization. This depends on the target: a dedicated operator panel does not give you a Windows desktop to launch programs on, so the external-application path only exists when the runtime target is a PC.

Should I migrate away from WinCC flexible just because the project stores records in SQL Server?

No. Storing batch records in SQL Server works fine from WinCC flexible scripts. Migrate only when reporting must be integrated with plant-wide alarms, audit trails, or expansion plans, because migration means rebuilding screens, tags, scripts, alarms, and navigation, then regression-testing every operator command against the frozen original project.

Who should write the batch record into SQL Server, the HMI or the reporting application?

Assign exactly one writer per batch record. If both the HMI script and the reporting application insert the same completion event, you get duplicate rows. Decide how the system queues or flags records when SQL Server is unavailable and how duplicate insertion is prevented after the connection recovers.

What should the batch record use as its key?

Use a unique batch identity generated independently of the human-readable batch name, because operator-entered names can repeat. Also define the PLC event that marks a batch complete, and state in advance how aborted, restarted, or manually corrected batches are recorded so the archive stays consistent.

Keep reading

  • How-to

    Running a WinCC 7.0 project on another PC without a new build

    No. WinCC has no compile-to-EXE option: the destination PC needs WinCC Runtime of version 7.0 or higher, installed and licensed, and you transfer the project files to it. A newer WinCC opens and converts the project; an older release will not open it.

    HMI and touchscreens

  • Comparison

    WinCC vs WinCC Flexible for small PC SCADA applications

    WinCC Flexible can build a small SCADA application that runs on a PC, but only the Advanced edition does it — Standard stops at operator panels. Treat two decisions separately: the Advanced engineering license buys the PC runtime capability, and each PC that runs the finished application still needs its own runtime license. Beyond single-station scope, the WinCC family is the SCADA tool.

    HMI and touchscreens

  • Selection guide

    Runtime tag license tiers for an HMI panel PC

    Buy the engineering license for your own PC; the panel PC needs a WinCC flexible runtime license sized to controller-connected tags in tiers of 128, 512, 1024, 2048 and 4096, plus a separate recipe license for native recipes. An array counts as one tag and an indexed variable as several, but array elements cannot carry the per-element limits recipe setpoints need.

    HMI and touchscreens

Show SQL Data on a FactoryTalk View Screen by Date Range