longi wrote:Hi!
I supose you are using ORB (I've read some posts from you).
The simpliest ORB report has three tables, but the normal thing is to use for data the second one ('Main table'). So, I wrote this little macro in order to get the Autoheight property in the first row on the 'Main table'.
If it is not the case, you can adapt it for every row or table you want.
Code: Select all
Sub Report
Dim oreportdoc As Object, ocontroller
Dim i As Integer
Dim oTextTable As Variant, Fila As Object
'------------------------------------------------------------------------
' We'll open the report
ocontroller = Thisdatabasedocument.currentController ' The present data Base
if not ocontroller.isconnected then ocontroller.connect ' We keep the conection
oreportdoc = Thisdatabasedocument.reportdocuments.getbyname("Your report").open ' We open the report
oTexttable = oreportdoc.Texttables(2) ' The main table
oTexttable.getRows().getByIndex(0).IsAutoHeight = True ' Autoheight
End Sub
Bye!
Hi Longi,
Thank you for your response.
We are hoping to solve the issue via SQL, because we would like to avoid macros at all costs. They are 'evil' (according to Villeroy, me, and many others including our Client).
Realized that I have to provide more information.
We use the Report function in many occasions for importing our information into other external databases.
We use the csv-format, because it is widely accepted.
Our DataBase holds information that needs to imported into an other database, of which we have no control.
The other database is external, and run by an independent organization.
What we suspect that it is a database with Microsoft involved one way or an other.
Their datase does allow csv-, xls-, and xslx-format import of information.
However the csv-format import does not work at all at this point.
A statement like: "Either File not selected or selected file does not contain any data, please validate file." indicates that the headings cannot be read.
The organization provided a template for import, based on the xlsx-format, but that does not work for the Reporter used by Base.
The Reporter in Base can only produce a txt- or csv- format report.
Note: We would love to provide the template, but are not allowed (protected information
).
The headings of the template are made up of text in 2 languages and 2 lines; 1st line: English, 2nd line: Spanish.
We are trying to duplicate the headings of the template via a Query.
Example of Header:
Email
Correo electrónico
We do not know if there is a Carriage Return (\r) or a New Line (\n) for the 2nd line.
We do know that the text is wrapped automatically.
We are quite sure that there is something with the template that we cannot reproduce, because if we copy the resultset of the Query in the template by hand
and import the information, the import is successful.
If we copy the headings by hand
into the resultset of the Report (csv-format) and save it as an LO xslx-format, the import works.
We are at a loss right now in creating a Report that can be used.
Kind regards,
Dream.