The module, ReportML, in the attached demo is a native code workaround for printing variable height columns in a report. It takes a RowSet and some Report information, and returns a RowSet that looks like an expandable text report when printed the usual way.
The project’s Window1 has a demo in the Print button.
Call like:
MyRowSet = ReportML.RowSetForReport(MyRowSet,MyReport,ArrayOfReportField, “optional string to visually separate records”)
and then print MyRowSet in the report.
Notes:
Report Fields to be expanded must have multiline, or word wrap, or both set to ON.
It assumes an SQL query will return the rows in the order of their creation.
ArrayOfReportField() is like: = Array(MyReport.Field1, MyReport.Field2, MyReport.Field3, MyReport.Field4)
The “optional string…” will add a row with the string appearing below each field.
The global property MyScaleFactor can be changed to adjust the character width calculations. The smaller the value the wider the column text.
Accuracy and speed depend mostly on the methods TextToArray and CharWidth.
A report’s look depends on the report’s settings and how tight the report body is for the text size. The text fields all both occupy the same body height, so it will look better if all expandable fields have the same font size.
I’ve used it on the Mac with good results on my under 1000 row DB’s. If you use it, please let me know about the flaws that pop up. If I missed a “Just click here to print variable frame” checkbox somewhere, let me know that too.
ReportML.zip (11.4 KB)