Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Submitting comma delimited data
Message
From
11/05/2011 11:42:17
 
 
To
11/05/2011 11:38:14
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 9
Miscellaneous
Thread ID:
01510319
Message ID:
01510331
Views:
37
>>>Quick overview, I have a page that lets a user type in a record number and get the record info exported into an Excel spreadsheet. Right now it only works with one number at a time, but I want to allow them to type multiple record numbers separated with commas.
>>>
>>>The relevant code is below:
>>>
>>>
	OpenTable(goWCServer.oConfig.oTask.cBTSPath+[key\A]+m.bn,[AppExp])
>>>			
>>>
>>>			
>>>			*Select columns from table above, name them for Excel headers
>>>			SELECT 	bn as [BatchNum],;
>>>					pk as [RecNo],;
>>>					"" as [Approved],;
>>>					shdt as [ShipDate],;
>>>					canm as [Carrier],;
>>>					prno as [Pro],;
>>>					blno as [BOL],;
>>>					shnm as [Shipper],;
>>>					ozp as [OZip],;
>>>					conm as [Consignee],;
>>>					dzp as [DZip],;
>>>					wtttl as [Weight],;
>>>					"" as [ReWeigh],;
>>>					"" as [Notes],;
>>>					accd1 as [Acc1],;
>>>					acamt1 as [Amt1],;
>>>					accd2 as [Acc2],;
>>>					acamt2 as [Amt2],;
>>>					accd3 as [Acc3],;
>>>					acamt3 as [Amt3];
>>>			FROM AppExp; 
>>>			into cursor ApprovalA
>>>			
>>>			
>>>			SELECT ApprovalA
>>>*Copy data from cursor to Excel file
>>>COPY TO ("C:\test\"+[bn]+m.bn+[T2.xls])
>>>
>>>The "OpenTable" bit at the beginning is where it grabs the record number from the textbox on the HTML page (m.bn). Would I need a loop or something in order to get multiple record numbers recognized?
>>
>>you'll probably need to show us the code in OpenTable to tell you where you need to put the loop. The rest of the code merely copies the data that has been put into AppExp into a cursor and then issues a COPY TO EXCEL (by the way, selecting into a cursor is not necesssary as you could just as easily have issued the COPY TO on AppExp).
>
>
>All the code in OpenTable does is point to a hardcoded directory... think of it like CSS, there's a .ini file that has paths for all sorts of things, and rather than have to type the direct paths out all the time, I can just use that string to have it look in the correct folder.
>
>More in depth, each of these records is in folder called "key" and they're a DBF file. So when you enter a record number, it is only looking for that one specific DBF in the "KEY" folder and returning that data. Each file name starts with an "A" so that's why it says [key/A]+m.bn, it's looking in the "KEY" folder, appending an "A" at the start of the file name, and using the user input to add the record number at the end.
>
>Thanks for the catch on the cursor by the way, didn't notice that.

so m.bn contains the record number which corresponds with a particular file name?
Frank.

Frank Cazabon
Samaan Systems Ltd.
www.samaansystems.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform