PC SOFT

WINDEVWEBDEV AND WINDEV MOBILE
ONLINE HELP

Home | Sign in | English UK
New WINDEV Mobile 24 feature!
  • Overview
  • Printing the body
  • Printing a break
  • Skipping pages when necessary
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Others
Stored procedures
Customizing a print script
Overview
Here are some tips and examples of how to use the different procedures generated in a print script.
Printing the body
The internal procedure "iPrint_BODY" must be called in the browse loop of the data source.
It is also necessary to modify this internal procedure to print the data from the data source.
FOR EACH Customer
// Print the body
iPosY(iPosY() + 12.912000)
iPrint_BODY()
END
Printing a break
To print a break it is necessary to manage the break condition in the browse loop of the data source.
FOR EACH Customer
// Management of the break
IF Customer.Company <> sPreviousCompany THEN
// Print the break footer (if necessary)
iPrint_BREAK_FOOTER()

// Print the break header
iPrint_BREAK_HEADER1()

END

// Print the body
iPosY(iPosY() + 12.912000)
iPrint_BODY()

END
Skipping pages when necessary
There are several solutions to manage reports with multiple pages:
  • The size of blocks (page footer, body, break header and footer if necessary) is fixed (no auto-sizeable controls).
  • The size of the blocks can vary (auto-sizeable controls are present).
If the size is fixed, simply make sure that the sum of the heights of the blocks to print is less than the remaining size in the page.
You can calculate the remaining size with 3046052 taking out the current position (3046075).
If the size is variable, you can use 3046070 to calculate the height of a control.
Caution: Don't forget to take into account the desired margins in your calculations.
FOR EACH Customer
// Management of the break
IF Customer.Company <> sPreviousCompany THEN
// Print the break footer (if necessary)
iPrint_BREAK_FOOTER()

// Print the break header
iPrint_BREAK_HEADER1()

END

// Print the body
iPosY(iPosY() + 12.912000)
iPrint_BODY()

// Make sure that the remaining height is greater than
// 20 (height of the body block) + 15 (height of the page footer)  + 20 (bottom margin)
IF iPageHeight() - iPosY()  < 20 + 15 + 20 THEN
iPrint_PAGEFOOTER()

iSkipPage()

iPrint_PAGEHEADER()

END


END
Minimum version required
  • Version 24
This page is also available for…
Comments
Click [Add] to post a comment