Text box angle in base report

I’d like to print some seed envelopes from the LANdpLAN database. The origami for the envelope necessitates the text be on a 45 degree angle. Is there a way to make a text box that way so that the name of the plant will be in line with edge of the envelope?
This discussion from over a year ago says that the only possibilities are 90 and 270. I need 45.
https://ask.libreoffice.org/t/multi-page-entries-in-report-with-angled-fields-and-fileds-on-top-of-image/111309?u=goedible

Seed package form.odg (138.9 KB)
Seed package form.pdf (349.7 KB)

You could try to use mail-merge instead. I remember to have a template including rotated text. Currently constant text, so I have to try to put a field in that part…

I can not insert a field into a text box. I can not rotate a frame 45 degrees. Is there another way?

Only by macro:
If only shapes could rotate text the way you need it you have to fill the text content into the shapes.

SUB FillShapesString
	oDoc = ThisComponent
	oDrawPage = oDoc.DrawPage
	FOR i = 0 TO oDrawPage.Count - 1	
		oShape = oDrawPage.getByIndex(i)
		IF oShape.Name = "Form_Rotated_1" THEN oShape.String = "LibreOffice"
	NEXT
END SUB

This will fill the shape you named “Form_Rotated_1” with string “LibreOffice”.
You could name the shapes the same the fields of your data source has been named. Then the result of the query will be filled in as string.
Have had a little bit time to create a DB and a template for showing printing rotated 45°:
Print_Rotated.zip (30.8 KB)
Unzip the package. Both files should be at the same location. Macros should be enabled. Works with internal Firebird database.

I am able to open it and copy the macro to LANdpLAN. I moved the odt into the LANdpLAN folder with the .odb. It is split HSQL database.
Screenshot from 2026-03-11 11-06-33
I made a print button and copied the macro over…


I press the print button and the result is “Forename” and Surname", not related to LANdpLAN database table.

I’m trying to understand how to edit the macro so that it works for me.

SUB FillShapesString
	oDoc = ThisComponent
	oDrawPage = oDoc.DrawPage
	FOR i = 0 TO oDrawPage.Count - 1	
		oShape = oDrawPage.getByIndex(i)
		IF oShape.Name = "Form_Rotated_1" THEN oShape.String = "LibreOffice"
	NEXT
END SUB

Above is the macro example from @RobertGs original reply.
Below is the macro from the database example

SUB FillShapesString(oEvent AS OBJECT)
	DIM oDB AS OBJECT
	oDB = ThisDatabaseDocument
	stDir = Left(oDB.Location,Len(oDB.Location)-Len(ConvertToURL(oDB.Title))+8)
	stDir = stDir & "Print_Rotated.ott"	
	DIM args(0) AS NEW com.sun.star.beans.PropertyValue
	args(0).Name = "AsTemplate"
	args(0).Value = True
	oNewDoc = StarDesktop.loadComponentFromURL(stDir,"_blank",0,args)
	oDrawPage = oNewDoc.DrawPage
	oForm = oEvent.Source.Model.Parent
	oColumns = oForm.Columns
	FOR i = 0 TO oDrawPage.Count - 1	
		oShape = oDrawPage.getByIndex(i)
		stColumnname = oShape.Name
		IF oColumns.hasByName(stColumnname) THEN oShape.String = oForm.getString(oForm.findColumn(stColumnname))
	NEXT
END SUB

LANdpLAN databse is here https://www.dropbox.com/scl/fo/jn3vw6944r3yjehotwqrx/AJcsRG0D58ZXx8P35H_GV-w?rlkey=mi4zuwym4bh153bquk64ieusa&st=hpbgphgx&dl=0

oColumns = oForm.Columns
FOR i = 0 TO oDrawPage.Count - 1	
    oShape = oDrawPage.getByIndex(i)
    stColumnname = oShape.Name
    IF oColumns.hasByName(stColumnname) THEN oShape.String = oForm.getString(oForm.findColumn(stColumnname))

So:

  • stColumnname = name of the form’s control.
  • oColumns contains the names of the form’s data source (table, view or query) columns; say:
    latin_name | “Common name” or common_name

Right?

name of the form’s controls are: ID, Forename, Surname
the forms data source is tbl_person

So names of
oForm.Columns = tbl_person columns names.
 
Form controls (shapes) names
=
table columns names,
right?

Insert print/MsgBoxes
to check what returns from

oForm.getString(oForm.findColumn(stColumnname))

I entered this conversation thread to chat gpt and with it’s help I had success!

The fix (very simple)

You must rename the shapes to match the database column names.

Example:

If your query returns:

latin_name
common_name
family

Then the shapes must be named:

latin_name
common_name
family

How to rename the shapes

In the template document:

  1. Click the rotated text shape.
  2. Open Format → Name…

(or press F4 to open the properties sidebar)

  1. Change Name to the column name.

Example:

Name: latin_name

How the macro works:

  • Create a template with shapes as you need (name of template had been “Print_Rotated.ott”). Template should be saved in the same path as the *.odb-file has been saved.
  • Set name for every shape in navigator of the sidebar the same way as the name of the columns in data source.
  • Put a button in your form (with the data source) and connect the macro to this button.

Template will be started, macro looks for shapes with the same name as the columns in the form (columns of the table - not name of the form controls) and fill the content from the columns to the string of the shapes.

Note: Columns of the form are all columns of the data source. Here, in a database for invoices, only the button will be shown in the form and a view will contain many columns. Content of this columns will be filled in the invoice.