API Reference

Detailed and full API reference helps you master Tekla development

This is the most recent version of Tekla Open API.
For older versions, please visit Tekla Warehouse.

OperationCreateReportFromAll Method

Creates a report from all the objects using the given template name and filename.

If a path is not given in the filename, the file is created to the folder defined with the advanced option XS_REPORT_OUTPUT_DIRECTORY.

If the given folder does not exist, the report creation fails.

Internally, this method is asynchronous, and because of that the output file cannot be immediately available.

See Tekla Structures Help for more information about reports.

Namespace:  Tekla.Structures.Model.Operations
Assembly:  Tekla.Structures.Model (in Tekla.Structures.Model.dll) Version: 2020.0.0.0 (2020.0.55582.0)
public static bool CreateReportFromAll(
	string TemplateName,
	string FileName,
	string Title1,
	string Title2,
	string Title3


Type: SystemString
The name of the report template to be used in report creation. The name must contain more than three characters.
Type: SystemString
The name of the created report. The name must contain more than three characters.
Type: SystemString
The first title for the created report.
Type: SystemString
The second title for the created report.
Type: SystemString
The third title for the created report.

Return Value

Type: Boolean
True if the report is created.
Exception Condition
ArgumentNullException Thrown when the TemplateName or FileName is null.
ArgumentException Thrown when the TemplateName or FileName is too short.
The following example creates a report and then displays it. It is taken into account that the created file might not be immediately available.
using System.IO;
using System.Threading;
using Tekla.Structures.Model.Operations;

public class Example
       public bool IfLockedWait(string FileName)
           // try 10 times
           int RetryNumber = 10;
           while (true)
                   using(FileStream FileStream = new FileStream(
                   FileName, FileMode.Open,
                   FileAccess.ReadWrite, FileShare.ReadWrite))
                       byte[] ReadText = new byte[FileStream.Length];
                       FileStream.Seek(0, SeekOrigin.Begin);
                       FileStream.Read(ReadText, 0, (int)FileStream.Length);
                   return true;
               catch (IOException)
                   // wait one second
                   if(RetryNumber == 0)
                       return false;

       public void Example1()
           Operation.CreateReportFromAll("Assembly_list", "Assembly_list.xsr", "MyTitle", "", "");

               // wait until Tekla Structures has unlocked the file, or timeout
                   // display the report
See Also