14.01.2020 Views

ABAP_to_the_Future

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

11

ABAP2XLSX

lo_worksheet->zif_excel_sheet_printsettings~set_print_repeat_rows(

iv_rows_from = 1

iv_rows_to = 1 ).

Listing 11.12 Making the Header Row Repeat on Every Printed Sheet

As can be seen in Figure 11.8, setting up the print settings has been automated,

saving users a few seconds, because now they don’t have to make the settings

manually. Each time saving on its own may not seem like much, but if you multiply

this by the number of users and by the number of reports printed, then the

savings quickly add up.

Figure 11.8 Automated Print Settings

11.2.4 Using Conditional Formatting

There are a lot of ways you can use conditional formatting; a basic example and a

more advanced example are discussed next.

Basic

Sometimes, when you look at a spreadsheet, you are looking only for rows that

are unusual in some way (i.e., managing by exception). A way to draw people’s

attention to the guilty rows on a spread sheet is to use conditional formatting to

color in cells with unusual values.

In this example, yo u will color in the Monster Strength column so that if the

monster is strong, then the cell is green; if it’s weak, then the cell is red; otherwise,

the cell is yellow. First, determine which column is the strength column in

your spreadsheet (column E in this example). Set this as a constant to avoid hardcoding

anything; see Listing 11.13.

474

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!