Displaying data on an unbound field

classic Classic list List threaded Threaded
5 messages Options
Egbert Eissing Egbert Eissing
Reply | Threaded
Open this post in threaded view
|

Displaying data on an unbound field

I have a form which holds several fields which are not bound to a database table, but are showing data for information purposes only.

Consider the following code snippet.

        oResultSet = oStatement.executeQuery()
        if not isnull(oResultSet)then
                oResultSet.next
                sDiscountFact = oResultSet.getString(1)
                oDiscountFact = oForm.getByName("discountFact")
              oDiscountFact.TEXT = format(sDiscountFact, sFormatString2)
        end if

If the form has just been opened, the last line returns an error:
"Property or method not found: .TEXT."
If I now change the formatted field to a text box and back again to a formatted field, the problem is solved - until the form is closed and opened again.Is this a bug to be fixed soon, or is this a more permanent "feature"?

Now I changed the last line with the following:
        oDiscountFact.setString(sDiscountFact)
That produces the same error message:
"Property or method not found: setString."

I have also tried:
    oDiscountFact.BoundField.updateString(sDiscountFact)
As expected, this does not work, because the field is not bound to a database.

Is there any other alternative to display text on an unbound field, one that works correctly all the time? The solution to this problem is really important for me.

Thanks for any suggestions.
Egbert

--
To unsubscribe e-mail to: [hidden email]
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted
Noel Noel
Reply | Threaded
Open this post in threaded view
|

Re: Displaying data on an unbound field

Hi Egbert,

I suspect that the property name may be case sensitive.

I have similar code that works with "Text". Try using -
    oDiscountFact.Text = format(sDiscountFact, sFormatString2)
and see if that fixes it.

Noel
--
Marion & Noel Lodge
[hidden email]

On 12 January 2016 at 12:12, Egbert Eissing <[hidden email]> wrote:

> I have a form which holds several fields which are not bound to a database
> table, but are showing data for information purposes only.
>
> Consider the following code snippet.
>
>         oResultSet = oStatement.executeQuery()
>         if not isnull(oResultSet)then
>                 oResultSet.next
>                 sDiscountFact = oResultSet.getString(1)
>                 oDiscountFact = oForm.getByName("discountFact")
>               oDiscountFact.TEXT = format(sDiscountFact, sFormatString2)
>         end if
>
> If the form has just been opened, the last line returns an error:
> "Property or method not found: .TEXT."
> If I now change the formatted field to a text box and back again to a
> formatted field, the problem is solved - until the form is closed and
> opened again.Is this a bug to be fixed soon, or is this a more permanent
> "feature"?
>
> Now I changed the last line with the following:
>         oDiscountFact.setString(sDiscountFact)
> That produces the same error message:
> "Property or method not found: setString."
>
> I have also tried:
>     oDiscountFact.BoundField.updateString(sDiscountFact)
> As expected, this does not work, because the field is not bound to a
> database.
>
> Is there any other alternative to display text on an unbound field, one
> that works correctly all the time? The solution to this problem is really
> important for me.
>
> Thanks for any suggestions.
> Egbert
>
> --
> To unsubscribe e-mail to: [hidden email]
> Problems?
> http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
> Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
> List archive: http://listarchives.libreoffice.org/global/users/
> All messages sent to this list will be publicly archived and cannot be
> deleted
>

--
To unsubscribe e-mail to: [hidden email]
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted
Alex Thurgood Alex Thurgood
Reply | Threaded
Open this post in threaded view
|

Re: Displaying data on an unbound field

In reply to this post by Egbert Eissing
Le 12/01/2016 02:12, Egbert Eissing a écrit :

Hi Egbert,

Sounds very similar to the behaviour in bug 84069 (LibreOffice
Bugzilla), except that your's is triggered by macro.

The move to a next insertable record in the ResultSet could be the
trigger for clearing the unbound text control (see comment 5 by Robert
in the bug report above).

The workaround seems to be to put the unbound text control on a separate
form which is not a subform of the main form and which is not bound to
any data. Whether you can get this to work correctly with your macro
setup is another matter.

Alex


--
To unsubscribe e-mail to: [hidden email]
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted
Andreas Säger Andreas Säger
Reply | Threaded
Open this post in threaded view
|

Re: Displaying data on an unbound field

In reply to this post by Egbert Eissing
Always the same answer:

> https://forum.openoffice.org/en/forum/viewtopic.php?f=20&t=81276&p=375294#p375294

Using the GUI, I can set the default value for an unbound text box
belonging to any form or subforme, and nothing changes this text. Then I
can inspect this text box using MRI and find out the property I need to set.


--
To unsubscribe e-mail to: [hidden email]
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted
Egbert Eissing Egbert Eissing
Reply | Threaded
Open this post in threaded view
|

Re: Displaying data on an unbound field

Thanks very much for your replies and your help.I couldn't quite make things work, which prompted me to take another approach. The unbounded text boxes were only to show Information
and this can also be done with labels. So I used labels. The last line of my code example would than be:
oDiscountFact.Label = format(sDiscountFact, sFormatString2)
After having made the conversion to label a thought occurred to me: The text boxes and the associated labels were both given the same name, and therefor the confusion. I am not sure, but it sounds plausible. I have been working with database front ends for about 20 years, using Rekall, and there this problem never arose.Thanks againEgbert


    On Wednesday, 13 January 2016, 3:42, Andreas Säger <[hidden email]> wrote:
 

 Always the same answer:

> https://forum.openoffice.org/en/forum/viewtopic.php?f=20&t=81276&p=375294#p375294

Using the GUI, I can set the default value for an unbound text box
belonging to any form or subforme, and nothing changes this text. Then I
can inspect this text box using MRI and find out the property I need to set.


--
To unsubscribe e-mail to: [hidden email]
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted


 
--
To unsubscribe e-mail to: [hidden email]
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted