Creating Reports in WinCC Professional V14: Step-by-Step Guide

David Krause15 min read
SiemensTutorial / How-toWinCC
Licensed PE Working through this on a live machine? A Maine-licensed engineer can take it from here — included with IMD hardware, by the hour for everything else. Book an engineer

Creating Reports in WinCC Professional V14: Step-by-Step Guide

WinCC Professional V14 (part of the TIA Portal V14 engineering suite) ships with a fully integrated Report Designer that allows engineers to compose, schedule, and print operator reports, batch logs, shift summaries, and alarm summaries directly from a WinCC Professional Runtime station. Although the same Report Designer is also available in the Comfort Panel and RT Advanced product lines, the RT Professional variant exposes the broadest set of data providers (tags, archives, alarms, audit, CSV, and user-defined ODBC sources) and supports both physical printers and PDF/file output. This reference walks through the full lifecycle of a report: from enabling the designer, through layout composition, CSV ingestion, trend rendering, dynamic file naming with VBScript, and finally runtime verification.

Note: The V14 Report Designer operates in the same way as the V15, V16, V17, and V20 designers. Where this document describes a feature, the V14 minimum behavior is always given first, and any change introduced in later TIA Portal versions is flagged explicitly. The TIA Portal V20 reference manual is the canonical authority for cross-version behavior: Working with Reports (Panels Comfort Panels, RT Advanced, RT Professional).

Prerequisites and Engineering Environment

Before a single report object can be dropped onto a layout, the engineering workstation and the target runtime must be prepared.

Item Requirement Notes
TIA Portal V14 SP1 or later (V14.0.0.0 baseline, V14.0.1.x with HSP) HSPs add new Report Designer objects, e.g. R&D HSP for V14 expands the trend control palette.
WinCC Professional ES license (6AV2105-0AA05-0AA0) and matching RT license (6AV2105-0HA05-0AA0 for 2048 PowerTags baseline) Report Designer is part of the Professional option set; RT Advanced cannot host CSV-provider or audit reports.
Runtime OS Windows 7 SP1 / Windows Server 2008 R2 SP1 or later x64 V14 was the last TIA Portal release to formally support Windows 7 on the engineering station.
Printer / PDF Any Windows-installed printer, or the "Microsoft Print to PDF" virtual device RT Professional prints to a Windows print queue, so any driver recognized by the OS will work.
Tag volume Up to the licensed PowerTag count (e.g. 2048 / 4096 / 8192 / 65k) Each report tag used in a layout must exist in the tag management; archive tags must be enabled in the data log.

Verify that the WinCC Professional Runtime is installed on the target PC and that the ES can compile and download the project. The official starter sample "Print a report by button" for V13 SP1 (entry ID 135070) remains valid for V14 with only the project migration step added: WinCC Professional V13 SP1 – Simple Sample: Print a report by button.

Report Architecture in WinCC Professional V14

A report is composed of three coupled objects that must all be present in the project tree under the WinCC Professional station:

  1. Report layout (*.rpl) – the page composition (objects, positions, fonts, data bindings). Created with the graphical Report Designer and stored under Reports > Report Layouts.
  2. Print job – the runtime trigger that knows which layout to render, when (manually, on schedule, or on event), and where to send the output (printer, file, or both). Stored under Reports > Print Jobs.
  3. Data source provider – the connection from a layout object back to live tags, archived tags, alarms, audit, or CSV/ODBC. The provider is configured inside the layout object itself, not as a separate project node.

Layouts can be reused by multiple print jobs. A single print job can output to a printer and to a file simultaneously. According to the official TIA Portal report reference, layouts are arranged with the rule that WinCC ignores white space at the start of a layout, so design the left margin with a real object, not with padding. See: Principles for preparation of reports (RT Professional).

Creating a Report Layout from Scratch

  1. Open the TIA Portal project containing the WinCC Professional station.
  2. In the project tree, expand the WinCC Professional station and double-click Reports.
  3. Right-click Report Layouts and choose Add new layout. A new node Layout_1.rpl appears.
  4. Double-click the new layout to open the Report Designer. The designer opens with a single A4 page by default (portrait, 210 mm × 297 mm). To change page size, right-click the page background and choose Properties > Page format.
  5. From the Toolbox on the right, drag the following objects onto the page:
    • Static text – for headers, titles, and labels. Configure the text in the Properties window under Text.
    • Date/time field – binds to the runtime clock. Set Source to System time or to a tag of type Date and time.
    • Tag field – displays a single value. Set Tag to the desired HMI tag (e.g. Motor1_Speed) and Mode to Online for live value or Archive for historical.
    • Table view – tabular output of archive values or alarm events. Configure the data source in the Properties pane.
    • Trend view – f(t) or f(x) plot. Used for graphs (see dedicated section below).
  6. Align objects using the Arrange ribbon. The grid spacing is configurable under Options > Settings > Visual > Report Designer.
  7. Save the layout with Ctrl+S. The file is stored inside the project database; to extract it for backup, use Reports > Report Layouts > Export to file (right-click).
Tip: A common mistake is to drop a Tag field that references a tag whose data type is String while the field is set to Numeric format. The result is a runtime error 0x80040E21 (data type mismatch). Match the format to the tag type.

Adding Live Tag Values and Archive Values

To display a live process value (snapshot at print time), bind a Tag field to a tag with Mode = Online. To display a value at a specific point in time (e.g. the value of TankLevel at the start of the shift), bind the same field but switch Mode to Archive and configure a TimeStamp tag or a fixed column reference.

Field type Mode Data source Use case
Tag field Online Live tag Current temperature, current operator, current recipe name
Tag field Archive Logging tag (data log) Value at shift start, value at batch end, last-good value before a fault
Tag table Archive Multiple logging tags, time range Hourly logger, daily summary, batch trend table
Alarm table Online/Archive Alarm log Shift alarm log, top-10 alarms of the day

Archive fields require that the tag be enabled in the Data logs node and that the logging tag is configured with a Logging cycle that fits the report resolution. A 1-second cycle on 65,000 PowerTags will saturate the SQL Express or file-based archive; reduce cycle or tag count if the archive backpressure is high.

Integrating CSV Data Sources

CSV integration in WinCC Professional V14 is performed through a User-defined data provider (UDDP) that you build as a VBScript function. The function reads the CSV file, parses the rows, and returns an ADODB.Recordset that the layout object binds to.

  1. Drop a Table view object onto the layout.
  2. In the Properties pane, set Data source to User-defined.
  3. Click the Provider ellipsis. A dialog opens that asks for a VBScript function name and the parameter list.
  4. Enter a function name such as ReadCsvBatchData and pass the parameters FilePath and Delimiter:
Function ReadCsvBatchData(ByVal FilePath As String, ByVal Delimiter As String) As Object
    Dim fso, ts, line, fields()
    Dim rs As Object
    Set fso = CreateObject("Scripting.FileSystemObject")
    Set ts  = fso.OpenTextFile(FilePath, 1, False, -1) ' 1=ForReading, -1=Unicode

    ' Build the Recordset
    Set rs = CreateObject("ADODB.Recordset")
    rs.Fields.Append "TimeStamp",     adDate
    rs.Fields.Append "Temperature",   adDouble
    rs.Fields.Append "Pressure",      adDouble
    rs.Open

    ' Read header to map columns
    If Not ts.AtEndOfStream Then
        line = ts.ReadLine
        ' parse header if column order is not fixed
    End If

    ' Read data rows
    Do While Not ts.AtEndOfStream
        line = ts.ReadLine
        fields = Split(line, Delimiter)
        rs.AddNew
        rs.Fields("TimeStamp").Value   = CDate(fields(0))
        rs.Fields("Temperature").Value = CDbl(fields(1))
        rs.Fields("Pressure").Value    = CDbl(fields(2))
        rs.Update
    Loop

    ts.Close
    Set ReadCsvBatchData = rs
End Function

Place the function in the layout's Scripts editor (right-click the layout node, choose Scripts > Add new script). Reference the parameters from the print job, or hard-code them in the function. The full procedure for adding user-defined data providers to a report is documented in the Siemens entry ID 59604194: WinCC Professional – User-defined data provider for reports.

Security note: The CSV file must be accessible from the runtime service account. If the runtime is started as a service, local system account cannot read files in C:\Users\<name>\. Use a fixed path such as D:\Reports\Data\ and grant the service account Read permission.

Rendering Graphs from CSV Data

To plot the CSV values, add a Trend view object to the layout and bind it to the same user-defined data provider:

  1. From the toolbox, drag Trend view onto the layout.
  2. In Properties, set Data source to User-defined and select the same function ReadCsvBatchData.
  3. Under Trends, add two trends: Temperature (axis Y-left, red) and Pressure (axis Y-right, blue).
  4. Set the X axis to TimeStamp, with Mode = Time axis.
  5. Adjust the value range under Y-axis > Scale. To make auto-scaling work, set Auto-range = On.

The trend view will request the recordset from the same VBScript function and render the f(t) curve at print time. If the CSV is large (e.g. one sample per second for 24 hours = 86 400 rows), restrict the time range with the Time range property in the print job to keep print time below 5 seconds.

Trend view property Recommended setting for CSV-bound data
Mode Time axis (X = TimeStamp)
Number of trends ≤ 8 for print legibility
Line color Distinct color per trend, avoid yellow on white
Sampling Set to Every nth point = 10 if the CSV is dense
Legend Visible, top-right, font size 8 pt

Dynamic File Naming via VBScript

WinCC Professional print jobs accept a File name parameter that is evaluated at print time. By passing a script-evaluated string, the file can be named after a tag (e.g. the active batch ID) plus a timestamp.

  1. Open the print job that calls the layout.
  2. Under Output > File, enable Save to file and choose Format = PDF (or Print to file with extension .pdf/.csv).
  3. In the File name field, use placeholder syntax: @BatchID_@yyyy-MM-dd_HH-mm. The placeholders are evaluated against tags or system variables prefixed with @.
  4. To build the name from a VBScript expression instead, place the expression in a global module and call it from a button event:
Sub btnPrintReport_Click(ByVal Item)
    Dim sBatch As String
    Dim sPath  As String
    Dim sFull  As String

    sBatch = SmartTags("Batch_CurrentID")
    sPath  = "D:\Reports\Output\"
    sFull  = sPath & "Batch_" & sBatch & "_" & _
             Format(Now, "yyyy-mm-dd_hh-nn") & ".pdf"

    ' Trigger the print job with the dynamic file name as the 4th argument
    HMIRuntime.Print "BatchReport_PrintJob", , , sFull
End Sub

The HMIRuntime.Print method signature is:

Sub Print(PrintJobName As String, [From As Long], [To As Long], [FileName As String])

If FileName is omitted, the print job uses the value configured statically. When both a static file name and a runtime argument are present, the runtime argument wins. Ensure that the directory exists – the print job will not create it. Add a startup script that calls fso.CreateFolder if the directory may be missing.

Configuring Print Jobs

Print jobs tie layouts to triggers. Three trigger types are available in V14:

Trigger Configuration path Typical use
Manual (button / function) VBScript calls HMIRuntime.Print "JobName" Operator-triggered shift report
Time-controlled Print job > Properties > Time trigger End-of-day summary at 23:59
Event-controlled Print job > Properties > Event trigger (tag change, alarm) Print on every batch end bit

For time-controlled print jobs, set Cycle to Once with a start time, or to Daily/Weekly/Monthly as required. For event-controlled print jobs, the Trigger tag can be any Boolean HMI tag. Rising edge (0→1) is the default trigger condition; configure the Edge property to change to falling edge or both.

Multiple output targets can be combined: a single print job can print to a physical printer and to a PDF file in the same execution. The order is always printer first, then file, regardless of the order in which they are listed in the dialog.

Triggering Reports from an HMI Button

  1. Open the screen that should host the report trigger.
  2. From the toolbox, drag a Button onto the screen.
  3. In the Properties pane, rename the button to btnPrintBatch.
  4. Click the Events tab and add a new Click event.
  5. Set the event action to VBScript and paste the script from the previous section.
  6. Compile and download. Test in RT.
Tip: Avoid placing the trigger inside a faceplate instance unless the print job name and tag references are scoped to the faceplate's namespace. Use a screen-level button for cross-faceplate reports.

For a one-page "click and print" sample project with the exact project tree, layout, and button wiring, follow Siemens entry ID 135070: WinCC Professional V13 SP1 – Simple Sample: Print a report by button. The V14 project can be opened directly in V14 with no migration if the V13 SP1 project was saved in compatibility mode.

Runtime Verification

After downloading the project, perform the following checks before signing off the report:

  1. Tag binding: Trigger the print job and verify that all Tag field objects show real values, not placeholders. If a field shows ###, the column is too narrow – widen the field in the layout.
  2. Archive data: Switch Mode of a tag field to Archive and confirm the historic value matches the expected timestamp. A common pitfall is that the archive time stamp is in UTC, while the runtime displays local time – the offset is 1 or 2 hours depending on DST.
  3. CSV provider: Open the output file and verify the trend curve has continuous data. Gaps indicate that the CSV row order or date format is wrong.
  4. Print queue: On the runtime PC, open the Windows print queue and confirm the document finished without an error. Error 0x00000005 (access denied) typically means the service account cannot write to the output path.
  5. File name: Verify that the dynamic file name contains the expected tag value. If it shows the placeholder @BatchID literally, the placeholder syntax is wrong – the leading @ and the tag name must match the tag management exactly, including case.
  6. Runtime log: Check C:\ProgramData\Siemens\Automation\WinCCRT\LogFiles\ for the WinCC_RT_<timestamp>.log file. Filter for "Report" to see print job execution times and any data provider errors.

Troubleshooting Matrix

Symptom Likely cause Fix
Print job does not appear in runtime Print job not compiled into the runtime project Recompile the project and re-download. Check the download log for "Report definition error".
Trend view prints empty CSV file path not resolvable from runtime service account Use an absolute path, grant Read permission to the service account, or use the Diagnostics page to see the underlying VBScript error.
File name shows literal placeholder Tag name does not exist or placeholder is misspelled Open Tag management, copy the exact tag name, paste it after the @ in the print job file name.
0x80040E21 in runtime log Tag data type mismatch with field format Change the field format to Auto or match the tag's data type exactly.
Alarm table shows no rows Alarm log not configured or no alarms in the selected time range Enable Alarm logging in the alarm class, set the time range in the print job, verify with the alarm control in runtime first.
Print is slow (> 30 s) Too many archive points or too many rows in CSV provider Reduce trend view sampling, limit the archive time range, switch the CSV provider to ODBC if available.
PDF file is empty (0 bytes) Microsoft Print to PDF dialog asked for a file name and was cancelled Set Output > File with PDF printer and use the static file name field; do not use a dialog-based PDF printer in unattended runtime.
"Access is denied" on file output Runtime service has no write permission on the output folder Grant Modify permission on the output folder to the runtime service account.
Best practice: For any regulated report (pharma, food, water), enable the WinCC Professional Audit option and bind the report trigger to an audit event so that every print is logged with operator ID, timestamp, and the resulting file hash. The audit trail is stored in the same SQL or file archive as the data logs and must be sized accordingly.

Frequently Asked Questions

Where do I find the Report Designer in TIA Portal V14?

Open the WinCC Professional station in the project tree, expand Reports, then double-click Report Layouts. The Report Designer is integrated into TIA Portal and does not require a separate installation. See the official TIA Portal V20 reference for the same workflow: Working with Reports.

Can I add a CSV file to a WinCC Professional V14 report?

Yes. Use a User-defined data provider written in VBScript that opens the CSV with Scripting.FileSystemObject, parses each row with Split(line, Delimiter), and returns an ADODB.Recordset. Bind that recordset to a Table view or Trend view object in the layout. Reference project: Siemens entry 59604194.

How do I draw a graph from the CSV data inside the report?

Add a Trend view object to the layout, set its Data source to the same user-defined function used by the table, map the TimeStamp column to the X axis, and map the numeric columns (Temperature, Pressure) to separate trends on the Y axis. Save the layout and trigger the print job.

Can the report file name change every time it is printed?

Yes. Either use the @TagName_@yyyy-MM-dd placeholder syntax in the print job's File name field, or call HMIRuntime.Print "JobName", , , "D:\Reports\Batch_" & SmartTags("BatchID") & ".pdf" from a VBScript button event. The runtime argument overrides the static file name.

Why does my print job run in the ES but not in runtime?

The most common causes are (1) the print job is not part of the downloaded runtime image – recompile and re-download; (2) the runtime service account has no write permission on the output folder – grant Modify to the service account; (3) a referenced tag is missing from the tag management of the runtime project. Always check C:\ProgramData\Siemens\Automation\WinCCRT\LogFiles\ for the runtime log entry that names the failing print job.

Back to blog