Printing multi-line text fields

Discuss the word processor
Post Reply
mhoerr
Posts: 2
Joined: Thu Feb 07, 2008 5:55 pm

Printing multi-line text fields

Post by mhoerr »

I have OpenOffice 2.3.

I have a form connected to an excel file registered as a database in Base. The form is an Writer document.

It has a multi-line text field with vertical scrollbars turned on.

When I print the form, only the data from this field which is visible without scrolling appears.

How do I print the entire contents of this field?

Thanks,
Mary
User avatar
foxcole
Volunteer
Posts: 1507
Joined: Mon Oct 08, 2007 1:31 am
Location: Minneapolis, Minnesota

Re: printing multi-line text fields

Post by foxcole »

mhoerr wrote:I have OpenOffice 2.3.
Is that 2.3.0 or 2.3.1? Now that the x.x.1 versions are dedicated to bug fixes, the distinction can be important. Not in this particular question, I think... but you may want to be aware of that for future posts.
mhoerr wrote:I have a form connected to an excel file registered as a database in Base. The form is an Writer document.

It has a multi-line text field with vertical scrollbars turned on.

When I print the form, only the data from this field which is visible without scrolling appears.

How do I print the entire contents of this field?
Do you mean you're filling the form from the spreadsheet for printing, or are you using the form to update the spreadsheet? The reason I'm asking is to understand at what point the data is committed to the database... because I think I'd probably convert the spreadsheet to dBase and run a report query on the dBase file, either on all the form data or just on the text field, to be printed separately. Or you could define a data area for that cell in the spreadsheet and print that out by itself; depending, of course, on where the up-to-date data is.

Otherwise, you could to expand the text field to display all possible text content... but I'm guessing that's not an option for you because it usually isn't with forms, and there's a good reason for having a scrolling field instead of a finite textbox. But such a field is typically an accommodation for the user because such forms are designed to collect input data.

So I guess a definite answer isn't possible until we know more about what exactly you're working with and what your requirements are.
Cheers!
---Fox

OOo 3.2.0 Portable, Windows 7 Home Premium 64-bit
mhoerr
Posts: 2
Joined: Thu Feb 07, 2008 5:55 pm

Re: printing multi-line text fields

Post by mhoerr »

I'm using OO 2.3.1
Thanks for the info about the relationship between version and bug fixes.

My end user is running a survey both online and in paper format. The online program exports the survey data as an Excel file.

She wants to be able to print each online survey as if it had been filled in by hand. At first, she was going to use a Word merge file for that, but she was having trouble displaying the results as checkboxes and/or radio buttons for the survey questions that used those answer types.

I used Base to set up a spreadsheet database connection to the Excel file. Then I changed the form input fields from her Word document to form controls connected to the Excel file. It worked great -- I was even able to set the control properties for the radio buttons to turn off and on based on the value in the Excel file.

However, there are a few fields that were scrollable open-ended fields in the on-line survey. I created a multi-line text box to link to the field in the excel file, and it scrolls and shows the data on screen just fine, but only prints the data actually visible in the control.

I have some flexibility in the form design. But what I need to be able to do is feed data from an excel spreadsheet (or possibly csv file) to a form that looks very similar to what people are filling out online and then print it. Including the fields for comments that can have a variable number of lines of data.

What do you suggest?
JohnV
Volunteer
Posts: 1585
Joined: Mon Oct 08, 2007 1:32 am
Location: Kentucky, USA

Re: printing multi-line text fields

Post by JohnV »

Well you can click inside the text boxes, do Ctrl+A, then copy and paste into a new document. However, I would let a macro do the work.

Code: Select all

Sub PrintTextBoxes
Dim oForms,oDoc,oVC,c,thisTB
oForms = ThisComponent.getDrawPage.Forms.getByIndex(0)
oDoc = StarDesktop.loadComponentFromURL("private:factory/swriter","_blank",0,Array())
oVC = oDoc.CurrentController.getViewCursor
For c = 0 to oForms.Count-1
thisTB = oForms.getByIndex(c)
oVC.String = c+1 & "." & Chr(13) & Chr(13) & thisTB.String & Chr(13)
oVC.collapseToEnd
Next
End Sub
Post Reply