Change Title page and headers from API

Change Title page and headers from API

lucas_marais
Explorer Explorer
462 Views
3 Replies
Message 1 of 4

Change Title page and headers from API

lucas_marais
Explorer
Explorer

Hello,

 

In the process of making the report of a study through the API, I've had difficulties to find how to modify the title page and headers from the API. Do someone know if it is possible and if possible, how ?

0 Likes
Accepted solutions (2)
463 Views
3 Replies
Replies (3)
Message 2 of 4

Stephane.kapetanovic
Mentor
Mentor
Accepted solution

Ho @lucas_marais 

try RobotPageSetup properties and methods.

 

Stephanekapetanovic_2-1694763913101.png

some additional explanations.

Stephanekapetanovic_0-1694761304816.png

Sub SetPageSetup()
  With New RobotApplication
    If Not (.Visible = -1 And .Project.IsActive = -1) Then Exit Sub
    With .Project.PrintEngine.PageSetup
      .PaperSize = 9 ' << 9 = A4, 8 = A3 
      .PageOrientation = I_PSO_PORTRAIT

      .MarginTop = 30
      .MarginBottom = 25
      .MarginLeft = 16
      .MarginRight = 19
      .Gutter = 2
      
      With .TitlePage: .Active = True: .Frame = I_PSFT_NONE: End With
      With .Header:    .Active = True: .Frame = I_PSFT_FRAME: End With
      With .Footer:    .Active = True: .Frame = I_PSFT_SEPARATION_LINE: End With
      
      With .Variables
        .SetValue "PROJECT_NAME", "MyProject"
        .SetPredefinedValue IRobotVariablePredefinedId.I_VPI_REPORT_PAGE_NUMBER, 1
      End With

      isSaved = .Save
    End With
  End With
End Sub

IRobotVariablePredefinedId overview.Stephanekapetanovic_1-1694759183253.png

Best Regards

Stéphane Kapetanovic

Did you find this post helpful? If it gave you one or more solutions,
don't forget to accept the solution and leave a < like !
EESignature
Message 3 of 4

rsousa_
Advocate
Advocate
Accepted solution

Don't forget to save after doing some changes 😉  Ex changing header:

robApp.Project.PrintEngine.PageSetup.header.LoadFromFile ("C:\lixo\header.rtf")

robApp.Project.PrintEngine.PageSetup.Save

kind regards

Message 4 of 4

lucas_marais
Explorer
Explorer

Thanks a lot, it works fine now !