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

Class to create reports. A report is a collection of chapters that can be exported as a PDF file at the end. More...

#include <SReport.h>

Inheritance diagram for SReport:
SComp SObject

Public Types

enum  SPageSize {
  A4 , B5 , Letter , Legal ,
  Executive , A0 , A1 , A2 ,
  A3 , A5 , A6 , A7 ,
  A8 , A9 , B0 , B1 ,
  B10 , B2 , B3 , B4 ,
  B6 , B7 , B8 , B9 ,
  C5E , Comm10E , DLE , Folio ,
  Ledger , Tabloid , Custom , A10 ,
  A3Extra , A4Extra , A4Plus , A4Small ,
  A5Extra , B5Extra , JisB0 , JisB1 ,
  JisB2 , JisB3 , JisB4 , JisB5 ,
  JisB6 , JisB7 , JisB8 , JisB9 ,
  JisB10 , AnsiC , AnsiD , AnsiE ,
  LegalExtra , LetterExtra , LetterPlus , LetterSmall ,
  TabloidExtra , ArchA , ArchB , ArchC ,
  ArchD , ArchE , Imperial7x9 , Imperial8x10 ,
  Imperial9x11 , Imperial9x12 , Imperial10x11 , Imperial10x13 ,
  Imperial10x14 , Imperial12x11 , Imperial15x11 , ExecutiveStandard ,
  Note , Quarto , Statement , SuperA ,
  SuperB , Postcard , DoublePostcard , Prc16K ,
  Prc32K , Prc32KBig , FanFoldUS , FanFoldGerman ,
  FanFoldGermanLegal , EnvelopeB4 , EnvelopeB5 , EnvelopeB6 ,
  EnvelopeC0 , EnvelopeC1 , EnvelopeC2 , EnvelopeC3 ,
  EnvelopeC4 , EnvelopeC6 , EnvelopeC65 , EnvelopeC7 ,
  Envelope9 , Envelope11 , Envelope12 , Envelope14 ,
  EnvelopeMonarch , EnvelopePersonal , EnvelopeChou3 , EnvelopeChou4 ,
  EnvelopeInvite , EnvelopeItalian , EnvelopeKaku2 , EnvelopeKaku3 ,
  EnvelopePrc1 , EnvelopePrc2 , EnvelopePrc3 , EnvelopePrc4 ,
  EnvelopePrc5 , EnvelopePrc6 , EnvelopePrc7 , EnvelopePrc8 ,
  EnvelopePrc9 , EnvelopePrc10 , EnvelopeYou4 , LastPageSize ,
  NPageSize , NPaperSize , AnsiA , AnsiB ,
  EnvelopeC5 , EnvelopeDL , Envelope10
}
 
- Public Types inherited from SComp
enum  RepresentationTypeEnum {
  SMOOTH , FLAT , WIRE , SMOOTH_WIRE ,
  FLAT_WIRE , SMOOTH_ROTWIRE , FLAT_ROTWIRE , TEXTURE ,
  INSPECTION
}
 The different representation types for inherited classes.
Use (inherited class).SMOOTH. Example: for a cloud, use SCloud.SMOOTH. More...
 

Public Slots

Array AddChapter (SReportData ipReportData, String iTemplateToUse="")
 Add a report data as a chapter in the report. The chapter uses the given template or the default template defined in the Template Library if iTemplateToUse is not set. More...
 
Array ExportReportPDF (String iCompletePath)
 Export a report as PDF file. More...
 
static SReport New ()
 Get the current report. More...
 
Array SetFooter (String iTemplateToUse)
 Add a footer corresponding to the given template. More...
 
Array SetHeader (String iTemplateToUse)
 Add a header corresponding to the given template. More...
 
 SetReportOptions (Array iOptions)
 Set all report options. More...
 
static String toString ()
 Get the type of the variable. More...
 
- Public Slots inherited from SComp
 AddToDoc ()
 To add the object to the document. More...
 
static Array All (Number VisCrit)
 To get all the SComp in the document. More...
 
 ApplyTransformation (SMatrix iMatrix)
 To apply a geometric transformation to the current object by making a product with the given matrix. More...
 
 Clear ()
 To deallocate object memory. More...
 
static Array FromClick ()
 Launches a click interaction to select a SComp in the scene. More...
 
static Array FromName (String Name)
 Search all the component with the given name. More...
 
static Array FromSel ()
 To get all the selected SComp. More...
 
Array GetBoundingBox ()
 Calculates the bounding box of the component. More...
 
Array GetColors ()
 To get the colors of the component. More...
 
String GetFolderName ()
 The component containing folder's name. More...
 
String GetName ()
 The component's name. More...
 
String GetPath ()
 To get the full path of a comp in the tree. More...
 
 Invert ()
 Normal of the component is inverted. More...
 
Boolean IsInDoc ()
 Return if the component is in the document or not. More...
 
Boolean IsVisible ()
 
 MoveToGroup (String GroupPath, Boolean MoveInsideTopParent)
 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 ()
 To remove the object from the document. More...
 
 SetClippable (Boolean clipping)
 Set clippable or not. More...
 
 SetColors (Number Red, Number Green, Number Blue)
 Sets the colors of the component. More...
 
 SetName (String ComponentName)
 To set the component's name. More...
 
 SetRepresentationType (RepresentationTypeEnum Representation)
 The shading type of the component is modified. More...
 
 SetTransparency (Number Alpha)
 Sets the transparency of the component. More...
 
 SetVisibility (Boolean Visible)
 Sets the component to be visible, or not visible. More...
 
String toString ()
 Get the type of the variable. More...
 
String toString ()
 Get the type of the variable. More...
 
 Translate (SVector Vector)
 To make a translation of the current object with an SVector. More...
 
- Public Slots inherited from SObject
 Clear ()
 To deallocate memory of the object. More...
 
String toString ()
 Get the type of the variable. More...
 

Detailed Description

Class to create reports. A report is a collection of chapters that can be exported as a PDF file at the end.

Member Enumeration Documentation

◆ SPageSize

Enumerator
A4 
B5 
Letter 
Legal 
Executive 
A0 
A1 
A2 
A3 
A5 
A6 
A7 
A8 
A9 
B0 
B1 
B10 
B2 
B3 
B4 
B6 
B7 
B8 
B9 
C5E 
Comm10E 
DLE 
Folio 
Ledger 
Tabloid 
Custom 
A10 
A3Extra 
A4Extra 
A4Plus 
A4Small 
A5Extra 
B5Extra 
JisB0 
JisB1 
JisB2 
JisB3 
JisB4 
JisB5 
JisB6 
JisB7 
JisB8 
JisB9 
JisB10 
AnsiC 
AnsiD 
AnsiE 
LegalExtra 
LetterExtra 
LetterPlus 
LetterSmall 
TabloidExtra 
ArchA 
ArchB 
ArchC 
ArchD 
ArchE 
Imperial7x9 
Imperial8x10 
Imperial9x11 
Imperial9x12 
Imperial10x11 
Imperial10x13 
Imperial10x14 
Imperial12x11 
Imperial15x11 
ExecutiveStandard 
Note 
Quarto 
Statement 
SuperA 
SuperB 
Postcard 
DoublePostcard 
Prc16K 
Prc32K 
Prc32KBig 
FanFoldUS 
FanFoldGerman 
FanFoldGermanLegal 
EnvelopeB4 
EnvelopeB5 
EnvelopeB6 
EnvelopeC0 
EnvelopeC1 
EnvelopeC2 
EnvelopeC3 
EnvelopeC4 
EnvelopeC6 
EnvelopeC65 
EnvelopeC7 
Envelope9 
Envelope11 
Envelope12 
Envelope14 
EnvelopeMonarch 
EnvelopePersonal 
EnvelopeChou3 
EnvelopeChou4 
EnvelopeInvite 
EnvelopeItalian 
EnvelopeKaku2 
EnvelopeKaku3 
EnvelopePrc1 
EnvelopePrc2 
EnvelopePrc3 
EnvelopePrc4 
EnvelopePrc5 
EnvelopePrc6 
EnvelopePrc7 
EnvelopePrc8 
EnvelopePrc9 
EnvelopePrc10 
EnvelopeYou4 
LastPageSize 
NPageSize 
NPaperSize 
AnsiA 
AnsiB 
EnvelopeC5 
EnvelopeDL 
Envelope10 

Member Function Documentation

◆ AddChapter

Array SReport::AddChapter ( SReportData  ipReportData,
String  iTemplateToUse = "" 
)
slot

Add a report data as a chapter in the report. The chapter uses the given template or the default template defined in the Template Library if iTemplateToUse is not set.

Note
Use a complete path or template name (in the library)
For example you can use:
var error = myReport.AddChapter(myReportData, 'Inspect_4_Views') ; // Will use the template "Inspect_4_Views" located in the template library
var error = myReport.AddChapter(myReportData, 'C:\\Inspect_4_Views.mlt') ; // Will use the file Inspect_4_Views.mlt located on the disk
var error = myReport.AddChapter(myReportData) ; // Will use the default template for this kind of ReportData (the one associated by default in the template library)
Return values
Array.ErrorCodethe error code
  • 0, Ok no error
  • 1, Invalid template path
  • 2, Invalid template name
  • 3, No available template
Parameters
[in]ipReportDataThe SReportData to add in the SReport
[in]iTemplateToUseThe template path 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 default template

◆ ExportReportPDF

Array SReport::ExportReportPDF ( String  iCompletePath)
slot

Export a report as PDF file.

Return values
Array.ErrorCodethe error code
  • 0 Ok, 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 General exception while generating the PDF file
Parameters
[in]iCompletePathThe PDF file path

◆ New

static SReport SReport::New ( )
staticslot

Get the current report.

◆ SetFooter

Array SReport::SetFooter ( String  iTemplateToUse)
slot

Add a footer corresponding to the given template.

Return values
Array.ErrorCodeThe error code
  • 0, Ok no error
  • 1, Invalid template path
  • 2, Invalid template name
  • 3, No available template
Parameters
[in]iTemplateToUseThe template path or the template name in the library (as shown in the list of templates available in the report editor)

◆ SetHeader

Array SReport::SetHeader ( String  iTemplateToUse)
slot

Add a header corresponding to the given template.

Return values
Array.ErrorCodeThe error code
  • 0, Ok no error
  • 1, Invalid template path
  • 2, Invalid template name
  • 3, No available template
Parameters
[in]iTemplateToUseThe template path or the template name in the library (as shown in the list of templates available in the report editor)

◆ SetReportOptions

SReport::SetReportOptions ( Array  iOptions)
slot

Set all report options.

Note
The following code is an example of data structure that you can use to specify iOptions
var options = { paperFormat : SReport.A3, marginTop : 15, orientation : 0, headerPolicy : 0, lengthDecimals : 3 };
Class to create reports. A report is a collection of chapters that can be exported as a PDF file at t...
Definition: SReport.h:20
@ A3
Definition: SReport.h:35
The option list is:
paperFormat: the format of the report (cf enum SPageSize)
marginTop: the top margin of a page (in mm)
marginBottom: the bottom margin of a page (in mm)
marginLeft: the left margin of a page (in mm)
marginRight: the right margin of a page (in mm)
orientation: the orientation of a page (0 means Portrait, 1 means Landscape)
headerPolicy: the header policy (0 means everywhere, 1 means nowhere, 2 means everywhere except on first page)
footerPolicy: the footer policy (0 means everywhere, 1 means nowhere, 2 means everywhere except on first page)
numberDecimals: number of decimals for numeric values
lengthDecimals: number of decimals for distance values
areaDecimals: number of decimals for area values
volumeDecimals: number of decimals for volume values
angleDecimals: number of decimals for angle values
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.
Parameters
[in]iOptionsThe data structure containing report options

◆ toString

static String SReport::toString ( )
staticslot

Get the type of the variable.