Page Index Toggle Pages: 1 [2] 3  Send Topic Send Topic Print Print
Very Hot Topic (More than 25 Replies) Using Sesame for a document database (Read 8386 times)
StreifLicht
Member
*
Offline



Posts: 17
Joined: Mar 15th, 2013
Re: Using Sesame for a document database
Reply #15 - Mar 25th, 2013 at 8:18pm
Print Post Print Post  
@Bharat_Naik
I plan to have 1-9 documents within one dataset.
Also i plan to store all documents in a subfolder of my database files and use the "document link feature"
  
Back to top
 
IP Logged
 
Bharat_Naik
Senior Member
Members
*****
Offline


Ever ready to learn and
share

Posts: 1202
Location: Chicago,  Illinois
Joined: Dec 16th, 2003
Re: Using Sesame for a document database
Reply #16 - Mar 25th, 2013 at 8:29pm
Print Post Print Post  
In that case you are better of making a subform for Documents database and you can have as many document paths stored as needed, no limits!! It is a good idea to have Document folder under "C:\Sesame2\". So you will store all your documents in c:\sesame2\documents folder.
  
Back to top
 
IP Logged
 
BOBSCOTT
Senior Member
Members
*****
Offline


That Darn Computer #$X#
{curse words}

Posts: 1195
Joined: Nov 22nd, 2002
Re: Using Sesame for a document database
Reply #17 - Mar 25th, 2013 at 9:20pm
Print Post Print Post  
StreifLicht,

I do not want to confuse and complicate the process you are following, however I thought I would give you something else to think about once you are comfortable with Sesame.

Very soon you will learn that Sesame is not only easy to use but super powerful and will allow you to do most anything you desire.

I have a similar application to what you describe. I store documents on a shared drive and have the sesame application name the document and then place it on that drive. One of the problems my users had was on some records not all the documents were present so they never knew when pressing a button to view if something was there.

Below is a small snippet of code as an example that when entering a client record it looks to see what docs are available, turns a checkbox green or red and makes a command button either visible or not based on if a document is present.

This way the user knows instantly what is available.

I am not sure of the type of documents you are dealing with, however if they are PDf's the people on this board helped me find a method that automatically adds docs to existing types of PDF's so if you add more docs of the same specific type (say additional letters they sent) it just appends the existing pdf.

When and if you need any of these features just ask and we can post up the sbasic snippits.   

Enjoy Sesame its a great product!

Subroutine TA_docYN() // checks and updates presence of docs
// This checks to see if the completed employee docs form is in the directory and puts a check mark in field element YNEP      
iF      FileExists("s:\EP\" +TA_id+"EP.pdf") // needs to be changed based on working directory
     
     {
                 YNEP = 1
           RGBColor(YNEP,-1,-1,-1,0,255,0)
           Visibility(ButtonVEP, 1)      
           Forceredraw()
           //writeln("Green")      
           
     

     }
     else
     {
     

           YNEP = 0
           RGBColor(YNEP,-1,-1,-1,255,0,0)
           Visibility(ButtonVEP, 0)
           Forceredraw()
           //writeln("Red")            
     }



// This checks to see if the correspondence docs form is in the directory and puts a check mark in field element YNCOR      
iF      FileExists("s:\COR\" +TA_id+"COR.pdf") // needs to be changed based on working directory
     
     {
     
     
           YNCOR = 1
           RGBColor(YNCOR,-1,-1,-1,0,255,0)
           Visibility(ButtonVCOR, 1)      
           Forceredraw()
           //writeln("Green")      
           
     

     }
     else
     {
     

           YNCOR = 0
           RGBColor(YNCOR,-1,-1,-1,255,0,0)
           Visibility(ButtonVCOR, 0)
           Forceredraw()
           //writeln("Red")            
     }


End Subroutine
  

Team – Together Everyone Achieves More
Back to top
 
IP Logged
 
StreifLicht
Member
*
Offline



Posts: 17
Joined: Mar 15th, 2013
Re: Using Sesame for a document database
Reply #18 - Mar 28th, 2013 at 11:10pm
Print Post Print Post  
Have done the tutorial now.
I would like to try using a document database and displaying it in a subform of my main database which contain "buying parts".
Therefore, my first step should be the document database.
I have attached a screenshot to show what i want to do.
I would like to add a shortname, a description and then add a file to the dataset. There should be a button "select file" then a file dialog should open. Preset to my document folder c:\sesame2\documents. Then i select the file and the file name is displayed in the field.
Much better would be the possibility to select an other directory - selecting the file, and then the file is being copied to the c:\sesame2\documents directory and then is displayed in the field.

  

Ducument1.png ( 11 KB | 82 Downloads )
Ducument1.png
Back to top
 
IP Logged
 
BOBSCOTT
Senior Member
Members
*****
Offline


That Darn Computer #$X#
{curse words}

Posts: 1195
Joined: Nov 22nd, 2002
Re: Using Sesame for a document database
Reply #19 - Mar 29th, 2013 at 12:27am
Print Post Print Post  
If I understand correctly you want to press a button and make a document part of the record.

What I do is to pop up a selection box for a user to select the type of document they are wanting to attach to the record.

I then have Sesame present a dialog box to select the file. (mine opens in c:\attach)

I then have sbasic rename the file so it is associated to the record and then place the file in the proper directory for access by any user who is allowed.

The code I presented earlier in this thread is then used to notify the user in the future if the record they enter has available documents and the view button is then used to instantly access the document.

I know my code is not the best written and there are so many different ways to accomplish the same goals with sesame, however the code below can be used as an example of how to do this and get you thinking and going in the correct direction.

I added comments to try and help you understand what is going on in the code.

// Declaring my variables
var Vresult as string
Var m as int
Var n as int
Var s as int
Var D as int
var Vrname as string
var Vshow as string


var vResult1 as string
var vChoices as string
var vDocType as string

var vDir as string
var vDirNfile as string
var vview as string


     vDocType = ""
// These are the choices the users will see in the pop up to select type of doccument
     vChoices = "Script;" +
     "Medical Documentation;" +
     "Insurance Docs;" +
     "Hst Recieved Doc;" +
     "HST Sent Back Doc;" +
     "HST Questionnaire;" +
     "HST Study;" +
     "HST Study 2;" +
     "HST Study 3;" +
     "Interp 1;" +
     "Interp 2;" +
     "Interp 3;" +
     "Signed Super Bill 1;" +
     "Signed Super Bill 2;" +
     "Signed Super Bill 3"

//  this is setting where to display the pop up on my screen In this example I want it to pop up near my element called status
     PopupSelectPosition(4, @XPos(status), @YPos(status))

// This is running the pop up for the document type
     vResult1 = @PopupChoiceList(vChoices, "Select A Document Type to upload")

     if vResult1 = ""

     {
           @Msgbox("","No Document type Selected","")


     }
     
else

     {


           vDocType = vResult1
           //Writeln(vResult1)
     
                 if vDocType = "Script"

                       {
                             vDocType = "script"
                             vDir = "sesame\script\done\"
                       }

     else
                       
                 if vDocType = "Signed Super Bill 1"

                       {
                             vDocType = "sb1"
                             vDir = "sb1\"
                       }

     else

                       

                 if vDocType = "Signed Super Bill 2"      

                       {
                             vDocType = "sb2"
                             vDir = "SB2\"
                       }

     else
     
                 if vDocType = "Signed Super Bill 3"
     
                       {
                             vDocType = "sb3"
                             vDir = "SB3\"
                       }

     else
     
                 if vDocType = "Medical Documentation"

                       {
                             vDocType = "MedDoc"
                             vDir = "MedDoc\"
                       }

     else

     
                 if vDocType = "Insurance Docs"

                       {
                             vDocType = "InsDoc"
                             vDir = "InsDoc\"
                       }

     else
     

                 if vDocType = "HST STudy"
                 
                       {

                             vDocType = "HSTStudy"
                             vDir = "HSTStudy\"
                       }
     else
     

                 if vDocType = "HST STudy 2"
                 
                       {

                             vDocType = "HSTStudy2"
                             vDir = "HSTStudy2\"
                       }


     else
     

                 if vDocType = "HST STudy 3"
                 
                       {

                             vDocType = "HSTStudy3"
                             vDir = "HSTStudy3\"
                       }


     else
     

                 if vDocType = "HST Questionnaire"
                 
                       {

                             vDocType = "HSTDoc"
                             vDir = "HSTDOC\"
                       }

     else
     

                 if vDocType = "Interp 1"
                 
                       {

                             vDocType = "Interp"
                             vDir = "Interp\"
                       }


     else
     

                 if vDocType = "Interp 2"
                 
                       {

                             vDocType = "Interp2"
                             vDir = "Interp2\"
                       }


     else
     

                 if vDocType = "Interp 3"
                 
                       {

                             vDocType = "Interp3"
                             vDir = "Interp3\"
                       }
           

     else
     

                 if vDocType = "Hst Recieved Doc"
                 
                       {

                             vDocType = "HSTRec"
                             vDir = "HSTRec\"
//Writeln(vDocType)
//Writeln(vDir)


                       }
     else
     

                 if vDocType = "HST Sent Back Doc"
                 
                       {

                             vDocType = "HSTSback"
                             vDir = "HSTSback\"



                       }

// This is setting the local directory of where the dialog box is to open to select files
LocalCWD("c:\Attach")
// this runs the pick the file dialog
vresult = @localfiledialog("choose a Document to work with", "*.pdf")
           


     if  Vresult = ""

Then

     {
     @Msgbox("","You Have not selected any Document to process","")
     LocalCWD("C:\sesame\") // puts local path back to C sesame
     
     }
else


     {
// Sets the name to use during renaming, moving and displaying pdf
vrname = (ptid + vDocType +".pdf")
//Writeln(vrname)
vDirNfile = (@ClientLocalValue("pathVariable") + vdir + vrname)
//Writeln(vDirnfile)



// check to see if a file already exists so it will append it instead of replacing it (you will need a file utility called merge)

     
iF      FileExists(vDirNfile) // needs to be changed based on working directory
     {
     
m = @shell("c:\sesame\merge.exe -qm " + vresult + " " + vDirNfile  + " -o " + vDirNfile)

D = @Shell("Move C:\Attach\*.pdf c:\store")





     }
     else
     {
           // Renames pdf from original to new name of patient ID plus word script
           n = @Shell( "ren " + @Chr(34) + vresult + @Chr(34) + " " + @Chr(34) + vrname + @Chr(34) )
           // moves from script directory to done
           m = @Shell( "move " + @Chr(34) + "c:\Attach\" + vrname + @Chr(34) + " " + @Chr(34) + @ClientLocalValue("myscriptpath") + vdir + @Chr(34) )

// this runs my subroutine that makes the checkboxes red or green and a view button visible or not based on if the documents are available
           ynUpdate()

     }



     
// puts local directory back to c:\sesame
LocalCWD("C:\sesame\")


}

}

  

Team – Together Everyone Achieves More
Back to top
 
IP Logged
 
Bharat_Naik
Senior Member
Members
*****
Offline


Ever ready to learn and
share

Posts: 1202
Location: Chicago,  Illinois
Joined: Dec 16th, 2003
Re: Using Sesame for a document database
Reply #20 - Mar 29th, 2013 at 5:15am
Print Post Print Post  
As Bob mentioned you can get the end results using Sesame in many different ways.  I also practically use the same approach as Bob using the Diaglog Box While inserting file in the subform. In the planning phase, you will have to decide as to What kind of subform you are going to use? There are different ways you can input such as already existing file or scanner as the input device. Also whether you want to have ability to insert documents from the other forms or database. I had to design and re-design my module several times over the years to accommodate the growing needs, and some of them involved the basic structure change.... ouch.. that hurts! Some of it is indispensable and help learning while others are simply avoidable by proper planning. I am sure most of the members here have some needs and have designed their own system and knowing them, they will share their methods as Bob did. That will start making you think and you will come up with your own unique system with the knowledge of sbasic commands and its implementation.

I use naturally linked subform to store document info such as path and description and there has to be some common field to link them. This is a must in case if you need to re-parent them. It is also needed when you insert a new subform record from another database and forms. I do not see that linking common field in your image of subform.

The most important and the first step is the inserting the subform record with path and description.  The next one is the viewing and displaying the record and opening the document is relatively easy.  Just as Bob, I also use Dialog box and give the name with path. By hitting Process button I pick that in my clip board and paste to Save as the subject file. 

« Last Edit: Mar 29th, 2013 at 6:34am by Bharat_Naik »  
Back to top
 
IP Logged
 
Bharat_Naik
Senior Member
Members
*****
Offline


Ever ready to learn and
share

Posts: 1202
Location: Chicago,  Illinois
Joined: Dec 16th, 2003
Re: Using Sesame for a document database
Reply #21 - Mar 30th, 2013 at 2:53pm
Print Post Print Post  
StreifLicht, how did you put the image in the post of the forum? I want to post a couple of images of my document modules for you to see but I, somehow, cannot upload the image to the forum web-directory. I can use my own site to place the image and display here in the forum post but just wondering, how you did it.
  
Back to top
 
IP Logged
 
The Cow
YaBB Administrator
*****
Offline



Posts: 2530
Joined: Nov 22nd, 2002
Re: Using Sesame for a document database
Reply #22 - Mar 31st, 2013 at 12:40am
Print Post Print Post  
Bharat,

Use the text element shown in the image below to "attach" and image to you post. It will be uploaded and stored on our server.
  

sc.jpg ( 96 KB | 81 Downloads )
sc.jpg

Mark Lasersohn&&Programmer&&Lantica Software, LLC
Back to top
IP Logged
 
Bharat_Naik
Senior Member
Members
*****
Offline


Ever ready to learn and
share

Posts: 1202
Location: Chicago,  Illinois
Joined: Dec 16th, 2003
Re: Using Sesame for a document database
Reply #23 - Mar 31st, 2013 at 1:31am
Print Post Print Post  

I am not seeing:
________________________________________
Attachement:
Attachment1 --------------------------------- Browse
__________________________________________

Part of the window in my post Reply section. What do I do to bring that up?
  
Back to top
 
IP Logged
 
The Cow
YaBB Administrator
*****
Offline



Posts: 2530
Joined: Nov 22nd, 2002
Re: Using Sesame for a document database
Reply #24 - Mar 31st, 2013 at 3:56am
Print Post Print Post  
Do you see "Collapse/Expand additional features"? (see picture above)
  

Mark Lasersohn&&Programmer&&Lantica Software, LLC
Back to top
IP Logged
 
Bharat_Naik
Senior Member
Members
*****
Offline


Ever ready to learn and
share

Posts: 1202
Location: Chicago,  Illinois
Joined: Dec 16th, 2003
Re: Using Sesame for a document database
Reply #25 - Mar 31st, 2013 at 4:19am
Print Post Print Post  
As you can see there is no attachment section in spite of expanding the section.

xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx





  
Back to top
 
IP Logged
 
The Cow
YaBB Administrator
*****
Offline



Posts: 2530
Joined: Nov 22nd, 2002
Re: Using Sesame for a document database
Reply #26 - Mar 31st, 2013 at 4:55am
Print Post Print Post  
hmmmm, odd. I checked the page source and found nothing interesting. I also read through the forum options and found attachments turned on and seemingly happy. I'll have to dig through the forum source code to see if I can find some reason why some can see and others cannot.
  

Mark Lasersohn&&Programmer&&Lantica Software, LLC
Back to top
IP Logged
 
Bharat_Naik
Senior Member
Members
*****
Offline


Ever ready to learn and
share

Posts: 1202
Location: Chicago,  Illinois
Joined: Dec 16th, 2003
Re: Using Sesame for a document database
Reply #27 - Mar 31st, 2013 at 5:37am
Print Post Print Post  
Thanks Mark for looking into this.
  
Back to top
 
IP Logged
 
StreifLicht
Member
*
Offline



Posts: 17
Joined: Mar 15th, 2013
Re: Using Sesame for a document database
Reply #28 - Mar 31st, 2013 at 8:51pm
Print Post Print Post  
Mark,
if you are going to check the "attachment issue" then maybe you can have a look at the email notification function.
It's because i am getting no email reminder even if i check the "Check this if you wish to be notified of replies to this topic." option.

Bharat,
i am very interested in your document modules.
I have read the posted code an looked in the two big manuals (programming and main manual). There are a lot of possibilities, a lot of commands  Wink I think i should got step by step. Currently i try to reach the goal to add a file to a field and get the possibility to call up the windows defined programm for reading.
In other words to add a pdf file to a field and then make it readable via adobe acrobat reader.
Lateron i would like to expand to up to ten addable documents. So currently i have a test database in use.
  
Back to top
 
IP Logged
 
Bharat_Naik
Senior Member
Members
*****
Offline


Ever ready to learn and
share

Posts: 1202
Location: Chicago,  Illinois
Joined: Dec 16th, 2003
Re: Using Sesame for a document database
Reply #29 - Apr 1st, 2013 at 4:07am
Print Post Print Post  
StreifLicht, I am posting here some images just to give an idea of Document Module. 

StandAlone Document Form



DocumentSubform with mainform




FormAsDialog for inserting new records



DocumentSubMenu on pressing the document button on mainform



On choosing view section - it display all documents in the record - one can choose to open it.



  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1 [2] 3 
Send Topic Send Topic Print Print