Form output
Migrated Code Examples:
Simple Form output
protected override void OnLeaveRow()
{
_layout.Print_TableA.WriteTo(_ioPrint_TableA);
}
Form definition - Layout region
#region Layouts
Printing.FormOutputOperationC1 _layout { get { return Cached<Printing.FormOutputOperationC1>(); } }
#endregion
Form Instantiation
protected override void OnLoad()
{
ioPrint_TableA = new ENV.Printing.PrinterWriter() { Name = "Print - TableA", PrinterName = Shared.Printing.Printers.Printer1.PrinterName };
Streams.Add(_ioPrint_TableA);
}
Using Page = Top
protected override void OnLeaveRow()
{
_ioPrint_TableA.NewPage();
_layout.Print_TableA.WriteTo(_ioPrint_TableA);
}
Using Page = Skip
protected override void OnLeaveRow()
{
if (_layout.Print_TableA.Height < _ioPrint_TableA.HeightUntilEndOfPage && !_ioPrint_TableA.NewPageOnNextWrite)
_layout.Print_TableA.WriteTo(_ioPrint_TableA);
else _ioPrint_TableA.EndCurrentPage();
}
See Also
Writing text files in .NET
This code represents the migrated code, when we write new code in .NET we'll rarely write text file access using the structure that was used in magic - instead we would simply read and write strings.
We recommend that you'll checkout the Writing and Reading files section of the documentation for more information.
Help us improve, Edit this page on GitHub
or email us at info@fireflymigration.com