Basic4ppc - Windows Mobile Development  

Go Back   Basic4ppc - Windows Mobile Development > Main Category > Questions & Help Needed
Home Register FAQ Members List Search Today's Posts Mark Forums Read

Questions & Help Needed Post any question regarding Basic4ppc.


save filter of a table


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 08-10-2007, 11:12 AM
Knows the basics
 
Join Date: Apr 2007
Location: Canari Islan
Posts: 70
Awards Showcase
Beta Tester 
Total Awards: 1
Default save filter of a table

can you help me?


I am trying to make a filter in a file .csv and save the result in a new file csv , but on having save this table he save the table completes not the filtered results.


A Greeting.

Thank you.
Reply With Quote
  #2 (permalink)  
Old 08-10-2007, 11:17 AM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 3,132
Default

You should create a new table, and copy all the filtered rows in the old table to the new table (row by row).
Reply With Quote
  #3 (permalink)  
Old 08-22-2007, 10:45 AM
Junior Member
 
Join Date: Apr 2007
Location: Cornwall UK
Posts: 22
Send a message via Skype™ to davelew1s
Default copy table

Hi!
I am trying to do something similar but cannot work out how to copy the old table to the new table row by row, any help?
Dave.
Reply With Quote
  #4 (permalink)  
Old 08-22-2007, 04:28 PM
specci48's Avatar
Basic4ppc Expert
 
Join Date: Apr 2007
Location: Germany
Posts: 636
Default

Hi davelew1s,

since you can't copy a complete row directly, you have to copy cell by cell:

Code:
Sub Globals
End Sub

Sub App_Start
	
	' defining both tables with the same columns
	Table1.AddCol(cString,"Col1",50,False)
	Table1.AddCol(cString,"Col2",50,False)
	Table2.AddCol(cString,"Col1",50,False)
	Table2.AddCol(cString,"Col2",50,False)
	
	' adding six rows to table1
	Table1.AddRow("row1","value1")
	Table1.AddRow("row2","value2")
	Table1.AddRow("row3","value1")
	Table1.AddRow("row4","value2")
	Table1.AddRow("row5","value1")
	Table1.AddRow("row6","value2")
	
	' setting a filter => three rows left
	Table1.Filter("Col2 = 'value2'")
	
	' copy filtered rows from table1 to table2 (cell by cell)
	Table2.Clear
	For i = 0 To Table1.RowCount - 1
		Table2.AddRow()
		For j = 0 To Table1.ColCount - 1
			Table2.Cell(Table2.ColName(j),i) = Table1.Cell(Table1.ColName(j),i)
		Next
	Next
	
	Form1.Show
End Sub
specci48
Reply With Quote
  #5 (permalink)  
Old 08-23-2007, 04:46 PM
Junior Member
 
Join Date: Apr 2007
Location: Cornwall UK
Posts: 22
Send a message via Skype™ to davelew1s
Default

Hi specci48!
Thanks that works great now.

Dave.
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Retrieve table filter from the filtered table? LineCutter Questions & Help Needed 1 09-08-2008 07:20 AM
Table doesn´t save data JOTHA Questions & Help Needed 8 08-30-2008 01:53 PM
Table filter (AND & OR) LineCutter Questions & Help Needed 1 08-24-2007 02:29 PM
table filter matter francisco cobos Questions & Help Needed 5 06-04-2007 08:01 AM
Table.Filter Phil Budge Questions & Help Needed 2 05-16-2007 10:35 PM


All times are GMT. The time now is 01:34 PM.


Powered by vBulletin® Version 3.6.12
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.1.0