Hi,
We have a report where we are printing out items. For each item there might be some additional RTF-text. We want to have the item-line and the text on the same page, and we need to find out if there is enough space to print both. If there is not enough space, we put in a page break.
In Magic we printed the RTF-text to NULL and got the length of the text. We could then decide to print the item-line and text if there’s enough space, or if we needed to put in a page break first.
This is still working, but the print is slow when there are many lines.
Is there another solution to this?
Profiler when checking the length of the text:
Profiler without checking the length of the text:
And here’s how we are defining the PrintWriter:
public ENV.Printing.PrinterWriter CreateNewPriterWriter(string name, bool randomFile, Bool landscape = null, string filepath = null, Shared.Theme.Printing.ReportSection header = null, Shared.Theme.Printing.ReportSection footer = null)
{
var p = new ENV.Printing.PrinterWriter()
{
Name = u.MlsTrans(name),
PrinterName = randomFile
? null
: ProM.Shared.Printing.Printers.Printer1.PrinterName
Landscape = landscape == null ? false : (bool)landscape,
Copies = hAntallEksemplarer,
PrintDialog = !randomFile && !hEgendefValgt && hSkriveutEpostLagre == "S" && hVisUtskriftsdialog && !hForhaandsvisning && u.Counter(1) == 1,
PrintPreview = hForhaandsvisning && hSkriveutEpostLagre == "S" && !randomFile,
TotalPagesPlaceholderToken = "!TotalPages",
Pdf = u.IniGet("[Pro-M]UseStandardPDF").Left(1) != "N" && (hSkriveutEpostLagre != "S" || randomFile),
FileName = Filename(),
PageHeader = header,
PageFooter = footer,
};
}
Regards
Jørn Berget