Normal Topic Viewing a list of documents (Read 1086 times)
NHUser
Full Member
***
Offline



Posts: 320
Location: Amherst, NH
Joined: Aug 2nd, 2010
Viewing a list of documents
Oct 2nd, 2012 at 3:13pm
Print Post Print Post  
I use the following to generate a popup window of a list a STANDARDS that are in a separate form called STANDARD SPECS:

STR1=@XLISTVALUES(@fn,"STANDARD SPECS!STANDARD")

Further programming allows me to select and view the standard.

This works well as is, but it only provides me a list of the names of the STANDARDS.  I now have a need to list both the STANDARD and the REVISION of the standard.

What is the best way to list both elements?

Thanks, in advance, for your help.

NHUser
  
Back to top
 
IP Logged
 
BOBSCOTT
Senior Member
Members
*****
Offline


That Darn Computer #$X#
{curse words}

Posts: 1195
Joined: Nov 22nd, 2002
Re: Viewing a list of documents
Reply #1 - Oct 2nd, 2012 at 3:50pm
Print Post Print Post  
NHUser

Is the data you want to display in the same external record you are retrieving the data from sorta like displaying the state city and zip in the popup?

If so look at @XLookupSourceListAll


MyStr = @XLookupSourceListAll(@FN, “FL”, “State”,
“State;City;Zip”)

There was an excellent article in the June 04 issue of inside Sesame by Alec Mulvey that covers alot of this.
  

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



Posts: 320
Location: Amherst, NH
Joined: Aug 2nd, 2010
Re: Viewing a list of documents
Reply #2 - Oct 2nd, 2012 at 5:21pm
Print Post Print Post  
It seems that the @XLookupSourceListAll is finding all records that match a key; in your example FL.  I don't want to find only certain records, I want to display ALL the records.

So, rather than setting a key of FL, how do I force it to send me the info for ALL the states?

  
Back to top
 
IP Logged
 
NHUser
Full Member
***
Offline



Posts: 320
Location: Amherst, NH
Joined: Aug 2nd, 2010
Re: Viewing a list of documents
Reply #3 - Oct 2nd, 2012 at 5:23pm
Print Post Print Post  
I just thought of something.  Can I set the key as ".." so it will give me all the records?
  
Back to top
 
IP Logged
 
NHUser
Full Member
***
Offline



Posts: 320
Location: Amherst, NH
Joined: Aug 2nd, 2010
Re: Viewing a list of documents
Reply #4 - Oct 2nd, 2012 at 5:58pm
Print Post Print Post  
I found the ".." key works, so now I'm getting the data I need.  However, the sort and list programming is not working properly.  My programming is this:

VAR STR1 AS STRING
VAR STR2 AS STRING
var vTemp as Int



PopupSelectPosition(4, @XPos(ThisElement), @YPos(ThisElement))

// STR1=@XLISTVALUES(@fn,"CUSTOMER SPECS!CSPECS")

STR1=@XLookupSourceListAll(@fn,"..","CUSTOMER SPECS!CSPECS","CSpecs;Revision")


STR1 = @SORTSTRINGARRAY(STR1, 0)


STR2=@PopupChoiceList(STR1,"SELECT A SPECIFICATION")

     If @Len(STR2) > 0
     {
           vTemp = @ASynchShell("F:\Sesame docs\ts doc Customer Specs\"+STR2)
     }

When I run this programming, the sort is messed up and the display window shows only one column of data (should be two).  Then when I scroll down, the bottom half of each line disappears!  See the attached.

Help!
  

Sesame_02-Oct-12.gif ( 25 KB | 29 Downloads )
Sesame_02-Oct-12.gif
Back to top
 
IP Logged
 
BOBSCOTT
Senior Member
Members
*****
Offline


That Darn Computer #$X#
{curse words}

Posts: 1195
Joined: Nov 22nd, 2002
Re: Viewing a list of documents
Reply #5 - Oct 2nd, 2012 at 7:33pm
Print Post Print Post  
I am sure Ray and some of the other talented people around here will give you a definite answer but till then maybe Try replacing the seperator after the @XLookupSourceListAll routine.

theese should do what you want

STR1 = @replace(STR1, “;”, “ ~ “)
STR1 = @replace(STR1, @Chr(10), “;”)

This is my guess at least. Hope it helps.
  

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



Posts: 320
Location: Amherst, NH
Joined: Aug 2nd, 2010
Re: Viewing a list of documents
Reply #6 - Oct 2nd, 2012 at 8:07pm
Print Post Print Post  
Hey, BOBSCOTT

Your suggestion works!!

Thanks for the help!

NHUser
  
Back to top
 
IP Logged
 
NHUser
Full Member
***
Offline



Posts: 320
Location: Amherst, NH
Joined: Aug 2nd, 2010
Re: Viewing a list of documents
Reply #7 - Oct 2nd, 2012 at 8:27pm
Print Post Print Post  
I ran into one last (I hope!) problem.  Now the shows the document names, with a " ~ Rev: X" appended.  This is what i wanted to see.  However, the variable is now something like this:

Document name.pdf ~ Rev: 1

It used to end at the .pdf and my programming would handle it and go get and display the document.  Now the "~ Rev: 1" addition is causing the programming to look for a document name that includes the extension. 

Unfortunately the document names vary in length, so I can't easily use part of the variable name.

Do you have any idea how I can make this work?

The programming I've been using is this:



STR2=@PopupChoiceList(STR1,"SELECT A SPECIFICATION")

     If @Len(STR2) > 0
     {
           vTemp = @ASynchShell("F:\Sesame docs\ts doc Customer Specs\"+STR2)
     }


  
Back to top
 
IP Logged
 
BOBSCOTT
Senior Member
Members
*****
Offline


That Darn Computer #$X#
{curse words}

Posts: 1195
Joined: Nov 22nd, 2002
Re: Viewing a list of documents
Reply #8 - Oct 2nd, 2012 at 8:57pm
Print Post Print Post  
How about before running your  vTemp = @ASynchShell("F:\Sesame docs\ts doc Customer Specs\"+STR2)
hack everything from the tilde on off. you could use something like


     var vPos as Int

     vPos = @Instr(str2, "~")
//writeln(vpos)

Str2 =  @LEFT(vdata, vpos - 1)

vTemp = @ASynchShell("F:\Sesame docs\ts doc Customer Specs\"+STR2)
  

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



Posts: 320
Location: Amherst, NH
Joined: Aug 2nd, 2010
Re: Viewing a list of documents
Reply #9 - Oct 3rd, 2012 at 1:16pm
Print Post Print Post  
Thanks for the hint. I have never used the @Instr command before so I didn't know it existed.  I wasn't sure what the vdata was in your programming, so I used the example in the Programming Guide to create this command just before the @ASynchShell command:

STR2 = @Left(STR2,@Instr(str2, "~")-1)

It's working great.  Thanks for your help!!!

  
Back to top
 
IP Logged