Help with creating a table "on the fly"

This is a discussion on Help with creating a table "on the fly" within the lotus-notes-programmer forums in Other Technologies category; I have a database (Notes 6.5.4) that needs to have a table created when either first opened or at the press of a button, that will insert an editable table of 3 columns and 4 rows. I need to be able to have the column headers already formatted and the user needs to be able to append new rows as needed. I looked at the help file for Designer 6.5 but it didn't really make sense. Any ideas? Mark Anderle...

Go Back   Database Forum > Other Technologies > lotus-notes-programmer

Database Forums

Register FAQ Calendar Search Today's Posts Mark Forums Read
  #1  
Old 08-05-2005, 05:55 PM
Default Help with creating a table "on the fly"

I have a database (Notes 6.5.4) that needs to have a table created when
either first opened or at the press of a button, that will insert an
editable table of 3 columns and 4 rows. I need to be able to have the column
headers already formatted and the user needs to be able to append new rows
as needed.
I looked at the help file for Designer 6.5 but it didn't really make sense.

Any ideas?

Mark Anderle


Reply With Quote
  #2  
Old 08-06-2005, 05:54 PM
Default Re: Help with creating a table "on the fly"

You can't just make a new form that has the table pre-defined in it?
Reply With Quote
  #3  
Old 08-07-2005, 11:30 PM
Default Re: Help with creating a table "on the fly"

One way of doing this (not necessarily the best) is to:

Store the table in a field of another form or the profile document
Create a script to copy the field from the other form to the required field
in the document.

The script could be attached to an action button or the postopen action.

HTH
Ultan
"Mark P. Anderle" wrote in message
news:QmQIe.93128$3j2.3243043-at-twister.southeast.rr. com...
> I have a database (Notes 6.5.4) that needs to have a table created when
> either first opened or at the press of a button, that will insert an
> editable table of 3 columns and 4 rows. I need to be able to have the

column
> headers already formatted and the user needs to be able to append new rows
> as needed.
> I looked at the help file for Designer 6.5 but it didn't really make

sense.
>
> Any ideas?
>
> Mark Anderle
>
>



Reply With Quote
  #4  
Old 08-09-2005, 09:07 PM
Default Re: Help with creating a table "on the fly"

"Mark P. Anderle" wrote in message
news:QmQIe.93128$3j2.3243043-at-twister.southeast.rr. com...
>I have a database (Notes 6.5.4) that needs to have a table created when
> either first opened or at the press of a button, that will insert an
> editable table of 3 columns and 4 rows. I need to be able to have the
> column
> headers already formatted and the user needs to be able to append new rows
> as needed.
> I looked at the help file for Designer 6.5 but it didn't really make
> sense.
>
> Any ideas?


There was a session about this at Lotusphere 2004.
The solution I am using (based on that session) may or may not help you. but
it involves building each row as a separate document in memory using the
backend classes and a template form with the layout of one row (including
header, fields, formatting, etc). You then use RenderToRTItem() to add the
document you just created to a rich text field in the target document.
Repeat once for each row.
By using a counter in your code, a hidden field on the template form,
hide-when on the template form to only display the header when the counter
is 1, and a few othe rtricks, you can build a very nice table, basically
looking any way you like. There are some limitations to this method, of
course.
You may be able to locate the session information online, perhaps you can
still order the tapes of the session.
You may also look through your copies of The View or Lotus Advisor (or
whatever they are called at the moment), the method may be described there
as well.
I think it may have been BP114 - Extreme Lotusscript by Rocky Oliver, but I
may be wrong.

/Karl



Reply With Quote
  #5  
Old 08-15-2005, 04:05 PM
Default Re: Help with creating a table "on the fly"

Appreciate the answer. Any idea how? I've not had to try and do this
before.

Mark

Ultan Rooney wrote:
> One way of doing this (not necessarily the best) is to:
>
> Store the table in a field of another form or the profile document
> Create a script to copy the field from the other form to the required field
> in the document.
>
> The script could be attached to an action button or the postopen action.
>
> HTH
> Ultan
> "Mark P. Anderle" wrote in message
> news:QmQIe.93128$3j2.3243043-at-twister.southeast.rr. com...
> > I have a database (Notes 6.5.4) that needs to have a table created when
> > either first opened or at the press of a button, that will insert an
> > editable table of 3 columns and 4 rows. I need to be able to have the

> column
> > headers already formatted and the user needs to be able to append new rows
> > as needed.
> > I looked at the help file for Designer 6.5 but it didn't really make

> sense.
> >
> > Any ideas?
> >
> > Mark Anderle
> >
> >


Reply With Quote
  #6  
Old 08-17-2005, 12:41 AM
Default Re: Help with creating a table "on the fly"

You could add the following script to an action button in a view to create a
new document. This script probably could have been written better but it
seems to work.

YMMV
Ultan

Sub Click(Source As Button)
Dim session As New NotesSession
Dim workspace As New NotesUIWorkspace
Dim Database As NotesDatabase
Dim uidoc As NotesUIDocument
Dim RosterDoc As NotesDocument, TemplateDoc As NotesDocument
Dim itemTemplate, itemRoster As Variant
Dim view As NotesView

' Create the new Roster Doc
Set Database = session.CurrentDatabase
Set RosterDoc = New NotesDocument(Database)

' Create a new Body RT item
Set itemRoster = New NotesRichTextItem(RosterDoc,"Body")

' Get the Template document
Set view = Database.GetView("Templates")
Set TemplateDoc = view.GetFirstDocument

' Get the Body item from the template doc
Set itemTemplate = TemplateDoc.GetFirstItem("Body")

' Copy the body item from the Template document to the Roster document
Call itemTemplate.CopyItemToDocument(RosterDoc, "Body")

' Set the form type
RosterDoc.Form = "Roster"

' Edit the document
Call workspace.EditDocument(True,RosterDoc)

End Sub
wrote in message
news:1124132733.571859.211000-at-f14g2000cwb.googlegr oups.com...
> Appreciate the answer. Any idea how? I've not had to try and do this
> before.
>
> Mark
>
> Ultan Rooney wrote:
> > One way of doing this (not necessarily the best) is to:
> >
> > Store the table in a field of another form or the profile document
> > Create a script to copy the field from the other form to the required

field
> > in the document.
> >
> > The script could be attached to an action button or the postopen action.
> >
> > HTH
> > Ultan
> > "Mark P. Anderle" wrote in message
> > news:QmQIe.93128$3j2.3243043-at-twister.southeast.rr. com...
> > > I have a database (Notes 6.5.4) that needs to have a table created

when
> > > either first opened or at the press of a button, that will insert an
> > > editable table of 3 columns and 4 rows. I need to be able to have the

> > column
> > > headers already formatted and the user needs to be able to append new

rows
> > > as needed.
> > > I looked at the help file for Designer 6.5 but it didn't really make

> > sense.
> > >
> > > Any ideas?
> > >
> > > Mark Anderle
> > >
> > >

>



Reply With Quote
Reply


Thread Tools
Display Modes



All times are GMT -4. The time now is 10:03 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Integrated by bbpixel2009 :: jvbPlugin R1013.368.1

Search Engine Friendly URLs by vBSEO 3.1.0
vB Ad Management by =RedTyger=
In an effort to better serve ads to our visitors, cookies are used on Mydatabasesupport.com. For more information, check out our Privacy Policy.