Cyclone 3DR Script
from Technodigit, part of Hexagon. Copyright 1997-2023.
Loading...
Searching...
No Matches
SReport Class Reference

Allow the creation of reports. More...

Inheritance diagram for SReport:
SComp

Public Types

enum  SPageSize {
  A4 = 7 , B5 = 19 , Letter = 0 , Legal = 1 ,
  Executive = 2 , A0 = 3 , A1 = 4 , A2 = 5 ,
  A3 = 6 , A5 = 8 , A6 = 9 , A7 = 10 ,
  A8 = 11 , A9 = 12 , B0 = 14 , B1 = 15 ,
  B10 = 24 , B2 = 16 , B3 = 17 , B4 = 18 ,
  B6 = 20 , B7 = 21 , B8 = 22 , B9 = 23 ,
  C5E = 25 , Comm10E = 26 , DLE = 27 , Folio = 28 ,
  Ledger = 29 , Tabloid = 30 , Custom = 31 , A10 = 13 ,
  A3Extra = 32 , A4Extra = 33 , A4Plus = 34 , A4Small = 35 ,
  A5Extra = 36 , B5Extra = 37 , JisB0 = 38 , JisB1 = 39 ,
  JisB2 = 40 , JisB3 = 41 , JisB4 = 42 , JisB5 = 43 ,
  JisB6 = 44 , JisB7 = 45 , JisB8 = 46 , JisB9 = 47 ,
  JisB10 = 48 , AnsiC = 49 , AnsiD = 50 , AnsiE = 51 ,
  LegalExtra = 52 , LetterExtra = 53 , LetterPlus = 54 , LetterSmall = 55 ,
  TabloidExtra = 56 , ArchA = 57 , ArchB = 58 , ArchC = 59 ,
  ArchD = 60 , ArchE = 61 , Imperial7x9 = 62 , Imperial8x10 = 63 ,
  Imperial9x11 = 64 , Imperial9x12 = 65 , Imperial10x11 = 66 , Imperial10x13 = 67 ,
  Imperial10x14 = 68 , Imperial12x11 = 69 , Imperial15x11 = 70 , ExecutiveStandard = 71 ,
  Note = 72 , Quarto = 73 , Statement = 74 , SuperA = 75 ,
  SuperB = 76 , Postcard = 77 , DoublePostcard = 78 , Prc16K = 79 ,
  Prc32K = 80 , Prc32KBig = 81 , FanFoldUS = 82 , FanFoldGerman = 83 ,
  FanFoldGermanLegal = 84 , EnvelopeB4 = 85 , EnvelopeB5 = 86 , EnvelopeB6 = 87 ,
  EnvelopeC0 = 88 , EnvelopeC1 = 89 , EnvelopeC2 = 90 , EnvelopeC3 = 91 ,
  EnvelopeC4 = 92 , EnvelopeC6 = 93 , EnvelopeC65 = 94 , EnvelopeC7 = 95 ,
  Envelope9 = 96 , Envelope11 = 97 , Envelope12 = 98 , Envelope14 = 99 ,
  EnvelopeMonarch = 100 , EnvelopePersonal = 101 , EnvelopeChou3 = 102 , EnvelopeChou4 = 103 ,
  EnvelopeInvite = 104 , EnvelopeItalian = 105 , EnvelopeKaku2 = 106 , EnvelopeKaku3 = 107 ,
  EnvelopePrc1 = 108 , EnvelopePrc2 = 109 , EnvelopePrc3 = 110 , EnvelopePrc4 = 111 ,
  EnvelopePrc5 = 112 , EnvelopePrc6 = 113 , EnvelopePrc7 = 114 , EnvelopePrc8 = 115 ,
  EnvelopePrc9 = 116 , EnvelopePrc10 = 117 , EnvelopeYou4 = 118 , LastPageSize = 118 ,
  AnsiA = 0 , AnsiB = 29 , EnvelopeC5 = 25 , EnvelopeDL = 27 ,
  Envelope10 = 26
}
 The page format of the SReport. More...
 
- Public Types inherited from SComp
enum  VisibilityEnum { HIDDEN_ONLY = 0 , VISIBLE_ONLY = 1 , ANY_VISIBILITY = 2 }
 Visible criteria. More...
 

Public Member Functions

Object AddChapter (SReportData reportData, string templateToUse="")
 Add a SReportData as a chapter in the SReport. The chapter uses the given template, or the default template defined in the Template Library if templateToUse is not set. More...
 
Object ExportReportPDF (string completePath)
 Export a SReport as a PDF file. More...
 
Object SetFooter (string templateToUse)
 Add a footer corresponding to the given template. More...
 
Object SetHeader (string templateToUse)
 Add a header corresponding to the given template. More...
 
 SetReportOptions (Object options)
 Set the desired SReport options. More...
 
 SReport ()
 Create an empty SReport. More...
 
string ValuesToString ()
 Get a debug string representation of the SReport. More...
 
- Public Member Functions inherited from SComp
 AddToDoc ()
 Add the object to the document. More...
 
 ApplyTransformation (SMatrix matrix)
 Apply a geometric transformation to the current object by making a product with the given matrix. More...
 
Object GetBoundingBox ()
 Calculate the bounding box of the object. More...
 
Object GetColors ()
 Get the colors of the object. More...
 
string GetFolderName ()
 Get the name of the folder containing the object. More...
 
string GetName ()
 Return the object's name. More...
 
string GetPath ()
 Return the full path of a SComp in the tree. More...
 
 Invert ()
 Invert the normal of the object. More...
 
boolean IsInDoc ()
 Return if the object is in the document or not. More...
 
boolean IsVisible ()
 Get the visibility of the object. More...
 
 MoveToGroup (string groupPath, boolean moveInsideTopParent=true)
 Move the object to the document group represent by the given path. If some groups, in the path, don't exist, they will be created. More...
 
 RemoveFromDoc ()
 Remove the object from the document. More...
 
 SetClippable (boolean clipping)
 Set clippable or not. More...
 
 SetColors (number red, number green, number blue)
 Set the colors of the object. More...
 
 SetName (string objectName)
 Set the object's name. More...
 
 SetTransparency (number alpha)
 Set the transparency of the object. More...
 
 SetVisibility (boolean visible)
 Set the object to be visible, or not visible. More...
 
string toString ()
 Get the type of the variable. More...
 
 Translate (SVector vector)
 Make a translation of the current object with an SVector. More...
 

Static Public Member Functions

static SReport New ()
 Create an empty SReport. More...
 
- Static Public Member Functions inherited from SComp
static Array< SCompAll (VisibilityEnum visCrit=SComp.ANY_VISIBILITY)
 Get all the SComp in the document. More...
 
static Object FromClick ()
 Launch an interaction to select a SComp in the scene. More...
 
static Array< SCompFromName (string name)
 Search all the SComp with the given name. More...
 
static Array< SCompFromSel ()
 Get all the selected SComp. More...
 

Detailed Description

Allow the creation of reports.

A report is a collection of chapters that can be exported as a .pdf file.

Member Enumeration Documentation

◆ SPageSize

The page format of the SReport.

Enumerator
A4 

A4.

B5 

B5.

Letter 

Letter.

Legal 

Legal.

Executive 

Executive.

A0 

A0.

A1 

A1.

A2 

A2.

A3 

A3.

A5 

A5.

A6 

A6.

A7 

A7.

A8 

A8.

A9 

A9.

B0 

B0.

B1 

B1.

B10 

B10.

B2 

B2.

B3 

B3.

B4 

B4.

B6 

B6.

B7 

B7.

B8 

B8.

B9 

B9.

C5E 

C5E.

Comm10E 

Comm10E.

DLE 

DLE.

Folio 

Folio.

Ledger 

Ledger.

Tabloid 

Tabloid.

Custom 

Custom.

A10 

A10.

A3Extra 

A3Extra.

A4Extra 

A4Extra.

A4Plus 

A4Plus.

A4Small 

A4Small.

A5Extra 

A5Extra.

B5Extra 

B5Extra.

JisB0 

JisB0.

JisB1 

JisB1.

JisB2 

JisB2.

JisB3 

JisB3.

JisB4 

JisB4.

JisB5 

JisB5.

JisB6 

JisB6.

JisB7 

JisB7.

JisB8 

JisB8.

JisB9 

JisB9.

JisB10 

JisB10.

AnsiC 

AnsiC.

AnsiD 

AnsiD.

AnsiE 

AnsiE.

LegalExtra 

LegalExtra.

LetterExtra 

LetterExtra.

LetterPlus 

LetterPlus.

LetterSmall 

LetterSmall.

TabloidExtra 

TabloidExtra.

ArchA 

ArchA.

ArchB 

ArchB.

ArchC 

ArchC.

ArchD 

ArchD.

ArchE 

ArchE.

Imperial7x9 

Imperial7x9.

Imperial8x10 

Imperial8x10.

Imperial9x11 

Imperial9x11.

Imperial9x12 

Imperial9x12.

Imperial10x11 

Imperial10x11.

Imperial10x13 

Imperial10x13.

Imperial10x14 

Imperial10x14.

Imperial12x11 

Imperial12x11.

Imperial15x11 

Imperial15x11.

ExecutiveStandard 

ExecutiveStandard.

Note 

Note.

Quarto 

Quarto.

Statement 

Statement.

SuperA 

SuperA.

SuperB 

SuperB.

Postcard 

Postcard.

DoublePostcard 

DoublePostcard.

Prc16K 

Prc16K.

Prc32K 

Prc32K.

Prc32KBig 

Prc32KBig.

FanFoldUS 

FanFoldUS.

FanFoldGerman 

FanFoldGerman.

FanFoldGermanLegal 

FanFoldGermanLegal.

EnvelopeB4 

EnvelopeB4.

EnvelopeB5 

EnvelopeB5.

EnvelopeB6 

EnvelopeB6.

EnvelopeC0 

EnvelopeC0.

EnvelopeC1 

EnvelopeC1.

EnvelopeC2 

EnvelopeC2.

EnvelopeC3 

EnvelopeC3.

EnvelopeC4 

EnvelopeC4.

EnvelopeC6 

EnvelopeC6.

EnvelopeC65 

EnvelopeC65.

EnvelopeC7 

EnvelopeC7.

Envelope9 

Envelope9.

Envelope11 

Envelope11.

Envelope12 

Envelope12.

Envelope14 

Envelope14.

EnvelopeMonarch 

EnvelopeMonarch.

EnvelopePersonal 

EnvelopePersonal.

EnvelopeChou3 

EnvelopeChou3.

EnvelopeChou4 

EnvelopeChou4.

EnvelopeInvite 

EnvelopeInvite.

EnvelopeItalian 

EnvelopeItalian.

EnvelopeKaku2 

EnvelopeKaku2.

EnvelopeKaku3 

EnvelopeKaku3.

EnvelopePrc1 

EnvelopePrc1.

EnvelopePrc2 

EnvelopePrc2.

EnvelopePrc3 

EnvelopePrc3.

EnvelopePrc4 

EnvelopePrc4.

EnvelopePrc5 

EnvelopePrc5.

EnvelopePrc6 

EnvelopePrc6.

EnvelopePrc7 

EnvelopePrc7.

EnvelopePrc8 

EnvelopePrc8.

EnvelopePrc9 

EnvelopePrc9.

EnvelopePrc10 

EnvelopePrc10.

EnvelopeYou4 

EnvelopeYou4.

LastPageSize 

LastPageSize.

AnsiA 

AnsiA.

AnsiB 

AnsiB.

EnvelopeC5 

EnvelopeC5.

EnvelopeDL 

EnvelopeDL.

Envelope10 

Envelope10.

Constructor & Destructor Documentation

◆ SReport()

SReport::SReport ( )

Create an empty SReport.

Member Function Documentation

◆ AddChapter()

Object SReport::AddChapter ( SReportData  reportData,
string  templateToUse = "" 
)

Add a SReportData as a chapter in the SReport. The chapter uses the given template, or the default template defined in the Template Library if templateToUse is not set.

Note
Use a complete path or template name (in the library).
For example you can use:
// To use the template "Inspect_4_Views" located in the template library
var error = myReport.AddChapter(myReportData, 'Inspect_4_Views');
// To use the file Inspect_4_Views.mlt located on the disk
var error = myReport.AddChapter(myReportData, 'C:\\Inspect_4_Views.mlt');
// To use the default template for this kind of SReportData (the one associated by default in the template library)
var error = myReport.AddChapter(myReportData);
Parameters
reportData(SReportData) The SReportData to add in the SReport
templateToUse(string) The template path (ending with ".mlt"), or the template name in the library (as shown in the list of templates available in the report editor), or an empty string to use the default template
Return values
ret.ErrorCode(number) The error code
  • 0: No error
  • 1: The template path is invalid
  • 2: The template name is invalid
  • 3: There is no available template
  • 4: An error occurred

◆ ExportReportPDF()

Object SReport::ExportReportPDF ( string  completePath)

Export a SReport as a PDF file.

Parameters
completePath(string) The PDF file path
Return values
ret.ErrorCode(number) The error code
  • 0: No error
  • 1: No directory or wrong directory specified
  • 2: The file already exists and cannot be overwritten (already in used or permission missing)
  • 3: An error occurred

◆ New()

static SReport SReport::New ( )
static

Create an empty SReport.

Returns
(SReport) The new SReport.

◆ SetFooter()

Object SReport::SetFooter ( string  templateToUse)

Add a footer corresponding to the given template.

Parameters
templateToUse(string) The template path (ending with ".mlt"), or the template name in the library (as shown in the list of templates available in the report editor)
Return values
ret.ErrorCode(number) The error code
  • 0: No error
  • 1: The template path is invalid
  • 2: The template name is invalid
  • 3: There is no available template
  • 4: An error occurred

◆ SetHeader()

Object SReport::SetHeader ( string  templateToUse)

Add a header corresponding to the given template.

Parameters
templateToUse(string) The template path (ending with ".mlt"), or the template name in the library (as shown in the list of templates available in the report editor)
Return values
ret.ErrorCode(number) The error code
  • 0: No error
  • 1: The template path is invalid
  • 2: The template name is invalid
  • 3: There is no available template
  • 4: An error occurred

◆ SetReportOptions()

SReport::SetReportOptions ( Object  options)

Set the desired SReport options.

Warning
This command will set the options for a SReport object. It will not set options for a report created through the report editor of the main application
Note
Example to fill the options array:
var report = SReport.New();
var options = {PaperFormat: SReport.A3, MarginTop: 15, Orientation: 0, HeaderPolicy: 0, LengthDecimals: 3};
report.SetReportOptions(options);
Allow the creation of reports.
Definition: Reshaper.h:8207
static SReport New()
Create an empty SReport.
@ A3
A3.
Definition: Reshaper.h:8230
Parameters
options(Object) The data structure containing report options
  • PaperFormat: [SReport.SPageSize] The format of the SReport
  • MarginTop: [Number] The top margin of a page (in mm)
  • MarginBottom: [Number] The bottom margin of a page (in mm)
  • MarginLeft: [Number] The left margin of a page (in mm)
  • MarginRight: [Number] The right margin of a page (in mm)
  • Orientation: [Number] The orientation of a page (0: Portrait, 1: Landscape)
  • HeaderPolicy: [Number] The header policy (0: everywhere, 1: nowhere, 2: everywhere except on the first page)
  • FooterPolicy: [Number] The footer policy (0: everywhere, 1: nowhere, 2: everywhere except on the first page)
  • NumberDecimals: [Number] The number of decimals for numeric values
  • LengthDecimals: [Number] The number of decimals for distance values
  • AreaDecimals: [Number] The number of decimals for area values
  • VolumeDecimals: [Number] The number of decimals for volume values
  • AngleDecimals: [Number] The number of decimals for angle values

◆ ValuesToString()

string SReport::ValuesToString ( )

Get a debug string representation of the SReport.

Returns
(string) A debug string representing the SReport