Download the free trial version
Basic4android Video
Features
Tutorials and manuals
Showcase
Screenshots

Go Back   Android Development Forum - Basic4android > Basic4ppc (Windows Mobile) > Questions (Windows Mobile)
Documentation Wiki Register Members List B4P Search Today's Posts Mark Forums Read

Questions (Windows Mobile) Post any question regarding Basic4ppc.

save filter of a table

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 08-10-2007, 10:12 AM
Senior Member
 
Join Date: Apr 2007
Location: Canari Islan
Posts: 103
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, 10:17 AM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 15,734
Awards Showcase
Basic4ppc Founder 
Total Awards: 1
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, 09:45 AM
Junior Member
 
Join Date: Apr 2007
Location: Cornwall UK
Posts: 38
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, 03:28 PM
specci48's Avatar
Basic4ppc Expert
 
Join Date: Apr 2007
Location: Germany
Posts: 1,057
Awards Showcase
Beta Tester Forum Contributer 
Total Awards: 2
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, 03:46 PM
Junior Member
 
Join Date: Apr 2007
Location: Cornwall UK
Posts: 38
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 Off
Pingbacks are Off
Refbacks are On

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


All times are GMT. The time now is 10:58 AM.


Powered by vBulletin® Version 3.6.12
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0