AsBuiltReport.Fortinet.FortiGate icon indicating copy to clipboard operation
AsBuiltReport.Fortinet.FortiGate copied to clipboard

[REQUEST] Add ability to set some pages to be in landscape format

Open msoukhomlinov opened this issue 1 year ago • 8 comments

Description

Some sets of data are best to be displayed as a landscape (due to a high number of columns); however, most of the report is better suited to be in portrait.

It would be awesome if someone could figure out how to set some sections as landscape. After spending hours on this, I suspect it's not possible, but I'm logging it just in case someone knows how to do this.

Additional Context

No response

Before submitting

  • [X] I have read the documentation, and referred to the known issues before submitting this change request.
  • [X] I have checked for previously opened & closed issues before submitting this change request.

msoukhomlinov avatar Oct 17 '24 12:10 msoukhomlinov

Yes, i think landscape format should be great too but not sure if it is possible...

Need to look PScribo module (it is used for display)

After a quick look, it will be possible (there is an issue about this )

and there is an example

Patch Welcome for modified this ^^

alagoutte avatar Oct 17 '24 14:10 alagoutte

Switching between Portrait and Landscape is only supported at Section level 1. Due to the structure and layout of the report, switching page orientation will likely not work as desired.

tpcarman avatar Oct 17 '24 20:10 tpcarman

Switching between Portrait and Landscape is only supported at Section level 1. Due to the structure and layout of the report, switching page orientation will likely not work as desired.

Thanks @tpcarman for feedback...

alagoutte avatar Oct 17 '24 20:10 alagoutte

I have tested changing the script to shift all levels one up (ie removed the top level heading1 and made all sections headings1. When attempting to set one of those sections into the landscape, it didn't work for me either. It seems the 'heading1' is not the level 1 section. :(

msoukhomlinov avatar Oct 18 '24 00:10 msoukhomlinov

I have tested changing the script to shift all levels one up (ie removed the top level heading1 and made all sections headings1. When attempting to set one of those sections into the landscape, it didn't work for me either. It seems the 'heading1' is not the level 1 section. :(

Orientation cannot be set in a subsection, only from a root section. Example:

Each section here is a Heading root so the orientation in this code works.

Import-Module PScribo -Force

function Get-SecondSection {
    Section -Name "Second Section should be landscape" -Style 'Heading2' -Orientation Landscape {
        Get-Service | Select-Object -First 10 | Table -Columns Name,DisplayName,Status -Headers Name,'Display Name',State
    }
}

$MyDocument = Document -Name 'PScribo Test Example 2022' {
    Section -Name "First Section in Portrait mode" -Style 'Heading1' -Orientation Portrait {
        Get-Service | Select-Object -First 10 | Table -Columns Name,DisplayName,Status -Headers Name,'Display Name',State
    }
    
    Get-SecondSection

    Section -Name "First Section in landscape mode" -Style 'Heading3' -Orientation Landscape {
        Get-Service | Select-Object -First 10 | Table -Columns Name,DisplayName,Status -Headers Name,'Display Name',State
    }
}

$MyDocument | Export-Document -Path . -Format word

Second Example:

The headings are inside a subsection like in Cascading mode. That is why the Orientation does not work

Import-Module PScribo -Force

function Get-SecondSection {
    Section -Name "Second Section should be landscape" -Style 'Heading2' -Orientation Landscape {
        Get-Service | Select-Object -First 10 | Table -Columns Name,DisplayName,Status -Headers Name,'Display Name',State
    }
}

$MyDocument = Document -Name 'PScribo Test Example 2022' {
    Section -Name "First Section in Portrait mode" -Style 'Heading1' -Orientation Portrait {
        Get-Service | Select-Object -First 10 | Table -Columns Name,DisplayName,Status -Headers Name,'Display Name',State
        
        Get-SecondSection

        Section -Name "First Section in landscape mode" -Style 'Heading3' -Orientation Landscape {
            Get-Service | Select-Object -First 10 | Table -Columns Name,DisplayName,Status -Headers Name,'Display Name',State
        }
    }
}

$MyDocument | Export-Document -Path . -Format word

Here is one of my report using the landscape orientation for the diagram section:

Report

Code

rebelinux avatar Oct 18 '24 01:10 rebelinux

@rebelinux , thank you. @alagoutte and @tpcarman , would you be OK if we change the report structure from having all headings being under heading 1 (report for firewall serial xyz), and to remove that top heading and make each section at heading 1 level?

msoukhomlinov avatar Oct 18 '24 09:10 msoukhomlinov

@rebelinux , thank you. @alagoutte and @tpcarman , would you be OK if we change the report structure from having all headings being under heading 1 (report for firewall serial xyz), and to remove that top heading and make each section at heading 1 level?

For me, it is ok...

I have never try to generate report with multiple Fortigate ^^

alagoutte avatar Oct 18 '24 14:10 alagoutte

The report structure should be maintained to allow for reporting of multiple systems. This is the current structure for all as built report modules.

tpcarman avatar Oct 18 '24 14:10 tpcarman