dbTalk Databases Forums  

Filter for Report not working?????

comp.databases.paradox comp.databases.paradox


Discuss Filter for Report not working????? in the comp.databases.paradox forum.



Reply
 
Thread Tools Display Modes
  #11  
Old   
Bertil Isberg
 
Posts: n/a

Default Re: Filter for Report not working????? - 09-15-2006 , 04:41 PM






Jeanette
<<
cno2, cField string
contFilter DynArray[] String

cno2 = "May"
cField = "Month"
contFilter[cField] = cno2
CashFlow.setGenFilter(contFilter)

When the above code is run I get this error message -
The Ffilter expression in field Month is not valid.
Quote:
What datatype is Month?

I used exactly your code but applied it to Orders table from the Sample
directory

var
cno2, cField string
contFilter DynArray[] String
endvar
cno2 = "May"
cField = "Month"
contFilter[cField] = cno2
Orders.setGenFilter(contFilter)

And it worked.



Your first example based on ContractNo

var
contFilter dynArray[] String
cno2 string
endvar

Cno2 = "\""+ContractNo.value+"\""
contFilter["ContractNo"] = cno2
Jeanette.setGenfilter(contFilter)

works for me, when ContractNo contains 99-309-014

I surround the value with quotes to make it a string otherwise the filter
engine gets confused by the - sign. Filters can sometimes be very
complicated due to the lack of a real syntax. Whatever you write has to
evaluated by Paradox. Eg in the Month column of Orders table you can set a
filter specified like this May and Terms=FOB
and like this May or Terms=FOB


--
Bertil Isberg - CTECH
Paradox buglist:
online: http://hem.bredband.net/bertilisberg/

"Jeanette" <harrisjr (AT) bwsc (DOT) org> skrev i meddelandet
news:450b15ba$1 (AT) pnews (DOT) thedbcommunity.com...
Quote:
Bertil,

Here's what I had coded:
I have a form with a table frame on it
Here’s the gist of what I was doing…

contFilter dynArray[] String

Cno2 = ContractNo.value
contFilter["ContractNo"] = cno2
the above produced what I described below.

I added a field called Month because my ContractNo field is made up of
numbers
& hyphens and I thought maybe THAT was causing the problem. ContractNo
EXamples
are = 99-309-014, 00-309-006

Using the setGenFilter for UIobject I NOW have coded:
cno2, cField string
contFilter DynArray[] String

cno2 = "May"
cField = "Month"
contFilter[cField] = cno2
CashFlow.setGenFilter(contFilter)

When the above code is run I get this error message -
The Ffilter expression in field Month is not valid.
HELP !

"Bertil Isberg" <ctech (AT) corel (DOT) ca> wrote:
Jeanette

NOW, how about the form?
I am using a filter in OPAL and I am not getting the results I expected.
I expected the form to display records as if the ones requested by the
filter
were the only records in the table. Instead it seems that the filter
moves
to the 1st instance of the requested records, displays the group AND
everything
thereafter AND if you use the scrollbar ALL of the records in the table
will
be displayed.

Is this the way it is supposed to work?


No, it's not the way it should work. You have to show the code you're
using.
You can find example coe in the ObjectPAL reference help files. Search the

index for setGenFilter() and select the uiObject type version of method.

--
Bertil Isberg - CTECH
Paradox buglist:
online: http://hem.bredband.net/bertilisberg/

"Jeanette" <harrisjr (AT) bwsc (DOT) org> skrev i meddelandet
news:450af575$1 (AT) pnews (DOT) thedbcommunity.com...

Bertil,

I decided to go with a table in PRIV for the report.

UNFORTUNATELY, the app that is written in Paradox is more than 10 years

old
and VERY RARELY needs maintenance and less often than VERY RARELY do I
get
a request to add new functionality. When I get a request to add new
functionality
or a request for maintenance I do try to 'do it' by using something that
I have not used before - hence the setGenFilter.

I completely understand my error with using setGenFilter after you
pointed
it out to me AND I had suspected that the setGenFilter was not being
used
when I opened the report to print it. I had checked the variable before
calling the report and all was well. HOWEVER, if I were to use
setGenFilter
as you have described I csn tell you that most of my Users would never

ignore
the first report and then open the form again to print he second
filtered
Report. They would hum along killing trees ļ !
Creating a table in PRIV is the best solution.

NOW, how about the form?
I am using a filter in OPAL and I am not getting the results I expected.
I expected the form to display records as if the ones requested by the

filter
were the only records in the table. Instead it seems that the filter

moves
to the 1st instance of the requested records, displays the group AND
everything
thereafter AND if you use the scrollbar ALL of the records in the table

will
be displayed.

Is this the way it is supposed to work?


"Bertil Isberg" <ctech (AT) corel (DOT) ca> wrote:
Jeanette

You have already got some advices on how to apply a filter to a report
by

using a different table, but the code you showed is worth some comments.


cno = ContractNo.value
cnoRpt["ContractNo"] = cno
cash.attach("CASHFLOW")
cash.setGenFilter(cnoRpt)

if rept1.open("CASHFLOW1") then
rept1.print()
rept1.close()
else
msgInfo("Problem.", "Couldn't open the report for the FIRST 6 months")
endif

The report ignores the filter.


You don't tell us what cash is. It looks like you apply a filter to a

table

variable. But then you're opening a report. When you open a report, it
ignores completely waht you have done with variables in your form. There
are
ways of applying a filter, setGenfilter(), to a report. From ObjectPAL
help
files:
Quote
¡P If you use setGenFilter on a UIObject in a running report, the filter
does
not take effect until you run the report again. For example, the
following

code runs a report and sets a filter; however, the filter has no effect

until the report switches to design mode and then back into run mode.

method pushButton(var eventInfo Event)
var
reOrders Report
daCriteria DynArray[] AnyType
endVar

reOrders.open("orders")

daCriteria["OrderNo"] = "> 1234"

; Assume the report contains a table frame bound to the Orders table.
; This statement has no effect because the report is in run mode.
reOrders.ORDERS.setGenFilter(daCriteria)

reOrders.design()
reOrders.run() ; Now the filter takes effect.
endMethod
/Quote


--
Bertil Isberg - CTECH
Paradox buglist:
online: http://hem.bredband.net/bertilisberg/

"Jeanette" <harrisjr (AT) bwsc (DOT) org> skrev i meddelandet
news:450879a2 (AT) pnews (DOT) thedbcommunity.com...

I have a Table that has a ContractNo field.
Data looks like: 99-309-014 or 00-303-001 etc

I want the User to be able to request a report via ContractNo
I have tried:
cno = ContractNo.value
cnoRpt["ContractNo"] = cno
cash.attach("CASHFLOW")
cash.setGenFilter(cnoRpt)

if rept1.open("CASHFLOW1") then
rept1.print()
rept1.close()
else
msgInfo("Problem.", "Couldn't open the report for the FIRST 6
months")
endif

The report ignores the filter.

What am I doing wrong?

TIA
Jeanette










Reply With Quote
  #12  
Old   
Jeanette
 
Posts: n/a

Default Re: Filter for Report not working????? - 09-18-2006 , 11:13 AM







Bertil,

DataType for Month is A3
and if I surround the Jan or May etc. with quotes as you did for ContractNo
the setGenFilter statement with the TableFrame tag works - THANK YOU!

I use a view for the User to enter the Contract # in the ARRIVE event AND
then when the form opens the proper records are NOW displayed for data entry.
After data entry is completed further work is done via a pushbutton

When I tried to remove the field Month via Restructure I got this message:
TableFrame(specific name) is already in use.
I had to exit Paradox and startup again & before running the form I was able
to delete the field named Month.

Do I need to release the filter or close the TableFame ?




"Bertil Isberg" <ctech (AT) corel (DOT) ca> wrote:
Quote:
Jeanette

cno2, cField string
contFilter DynArray[] String

cno2 = "May"
cField = "Month"
contFilter[cField] = cno2
CashFlow.setGenFilter(contFilter)

When the above code is run I get this error message -
The Ffilter expression in field Month is not valid.


What datatype is Month?

I used exactly your code but applied it to Orders table from the Sample

directory

var
cno2, cField string
contFilter DynArray[] String
endvar
cno2 = "May"
cField = "Month"
contFilter[cField] = cno2
Orders.setGenFilter(contFilter)

And it worked.



Your first example based on ContractNo

var
contFilter dynArray[] String
cno2 string
endvar

Cno2 = "\""+ContractNo.value+"\""
contFilter["ContractNo"] = cno2
Jeanette.setGenfilter(contFilter)

works for me, when ContractNo contains 99-309-014

I surround the value with quotes to make it a string otherwise the filter

engine gets confused by the - sign. Filters can sometimes be very
complicated due to the lack of a real syntax. Whatever you write has to

evaluated by Paradox. Eg in the Month column of Orders table you can set
a
filter specified like this May and Terms=FOB
and like this May or Terms=FOB


--
Bertil Isberg - CTECH
Paradox buglist:
online: http://hem.bredband.net/bertilisberg/

"Jeanette" <harrisjr (AT) bwsc (DOT) org> skrev i meddelandet
news:450b15ba$1 (AT) pnews (DOT) thedbcommunity.com...

Bertil,

Here's what I had coded:
I have a form with a table frame on it
Here’s the gist of what I was doing…

contFilter dynArray[] String

Cno2 = ContractNo.value
contFilter["ContractNo"] = cno2
the above produced what I described below.

I added a field called Month because my ContractNo field is made up of

numbers
& hyphens and I thought maybe THAT was causing the problem. ContractNo

EXamples
are = 99-309-014, 00-309-006

Using the setGenFilter for UIobject I NOW have coded:
cno2, cField string
contFilter DynArray[] String

cno2 = "May"
cField = "Month"
contFilter[cField] = cno2
CashFlow.setGenFilter(contFilter)

When the above code is run I get this error message -
The Ffilter expression in field Month is not valid.
HELP !

"Bertil Isberg" <ctech (AT) corel (DOT) ca> wrote:
Jeanette

NOW, how about the form?
I am using a filter in OPAL and I am not getting the results I expected.
I expected the form to display records as if the ones requested by the
filter
were the only records in the table. Instead it seems that the filter

moves
to the 1st instance of the requested records, displays the group AND
everything
thereafter AND if you use the scrollbar ALL of the records in the table
will
be displayed.

Is this the way it is supposed to work?


No, it's not the way it should work. You have to show the code you're

using.
You can find example coe in the ObjectPAL reference help files. Search
the

index for setGenFilter() and select the uiObject type version of method.

--
Bertil Isberg - CTECH
Paradox buglist:
online: http://hem.bredband.net/bertilisberg/

"Jeanette" <harrisjr (AT) bwsc (DOT) org> skrev i meddelandet
news:450af575$1 (AT) pnews (DOT) thedbcommunity.com...

Bertil,

I decided to go with a table in PRIV for the report.

UNFORTUNATELY, the app that is written in Paradox is more than 10 years

old
and VERY RARELY needs maintenance and less often than VERY RARELY do
I
get
a request to add new functionality. When I get a request to add new
functionality
or a request for maintenance I do try to 'do it' by using something
that
I have not used before - hence the setGenFilter.

I completely understand my error with using setGenFilter after you
pointed
it out to me AND I had suspected that the setGenFilter was not being

used
when I opened the report to print it. I had checked the variable before
calling the report and all was well. HOWEVER, if I were to use
setGenFilter
as you have described I csn tell you that most of my Users would never

ignore
the first report and then open the form again to print he second
filtered
Report. They would hum along killing trees ļ !
Creating a table in PRIV is the best solution.

NOW, how about the form?
I am using a filter in OPAL and I am not getting the results I expected.
I expected the form to display records as if the ones requested by the

filter
were the only records in the table. Instead it seems that the filter

moves
to the 1st instance of the requested records, displays the group AND
everything
thereafter AND if you use the scrollbar ALL of the records in the table

will
be displayed.

Is this the way it is supposed to work?


"Bertil Isberg" <ctech (AT) corel (DOT) ca> wrote:
Jeanette

You have already got some advices on how to apply a filter to a report
by

using a different table, but the code you showed is worth some comments.


cno = ContractNo.value
cnoRpt["ContractNo"] = cno
cash.attach("CASHFLOW")
cash.setGenFilter(cnoRpt)

if rept1.open("CASHFLOW1") then
rept1.print()
rept1.close()
else
msgInfo("Problem.", "Couldn't open the report for the FIRST 6 months")
endif

The report ignores the filter.


You don't tell us what cash is. It looks like you apply a filter to
a

table

variable. But then you're opening a report. When you open a report,
it
ignores completely waht you have done with variables in your form. There
are
ways of applying a filter, setGenfilter(), to a report. From ObjectPAL
help
files:
Quote
¡P If you use setGenFilter on a UIObject in a running report, the filter
does
not take effect until you run the report again. For example, the
following

code runs a report and sets a filter; however, the filter has no effect

until the report switches to design mode and then back into run mode.

method pushButton(var eventInfo Event)
var
reOrders Report
daCriteria DynArray[] AnyType
endVar

reOrders.open("orders")

daCriteria["OrderNo"] = "> 1234"

; Assume the report contains a table frame bound to the Orders table.
; This statement has no effect because the report is in run mode.
reOrders.ORDERS.setGenFilter(daCriteria)

reOrders.design()
reOrders.run() ; Now the filter takes effect.
endMethod
/Quote


--
Bertil Isberg - CTECH
Paradox buglist:
online: http://hem.bredband.net/bertilisberg/

"Jeanette" <harrisjr (AT) bwsc (DOT) org> skrev i meddelandet
news:450879a2 (AT) pnews (DOT) thedbcommunity.com...

I have a Table that has a ContractNo field.
Data looks like: 99-309-014 or 00-303-001 etc

I want the User to be able to request a report via ContractNo
I have tried:
cno = ContractNo.value
cnoRpt["ContractNo"] = cno
cash.attach("CASHFLOW")
cash.setGenFilter(cnoRpt)

if rept1.open("CASHFLOW1") then
rept1.print()
rept1.close()
else
msgInfo("Problem.", "Couldn't open the report for the FIRST 6
months")
endif

The report ignores the filter.

What am I doing wrong?

TIA
Jeanette











Reply With Quote
  #13  
Old   
Bertil Isberg
 
Posts: n/a

Default Re: Filter for Report not working????? - 09-18-2006 , 12:15 PM



Jeanette

You cannot restructure a table when a form using it is open.

--
Bertil Isberg - CTECH
Paradox buglist:
online: http://hem.bredband.net/bertilisberg/

"Jeanette" <harrisjr (AT) bwsc (DOT) org> skrev i meddelandet
news:450ec5ad$1 (AT) pnews (DOT) thedbcommunity.com...
Quote:
Bertil,

DataType for Month is A3
and if I surround the Jan or May etc. with quotes as you did for
ContractNo
the setGenFilter statement with the TableFrame tag works - THANK YOU!

I use a view for the User to enter the Contract # in the ARRIVE event AND
then when the form opens the proper records are NOW displayed for data
entry.
After data entry is completed further work is done via a pushbutton

When I tried to remove the field Month via Restructure I got this message:
TableFrame(specific name) is already in use.
I had to exit Paradox and startup again & before running the form I was
able
to delete the field named Month.

Do I need to release the filter or close the TableFame ?




"Bertil Isberg" <ctech (AT) corel (DOT) ca> wrote:
Jeanette

cno2, cField string
contFilter DynArray[] String

cno2 = "May"
cField = "Month"
contFilter[cField] = cno2
CashFlow.setGenFilter(contFilter)

When the above code is run I get this error message -
The Ffilter expression in field Month is not valid.


What datatype is Month?

I used exactly your code but applied it to Orders table from the Sample

directory

var
cno2, cField string
contFilter DynArray[] String
endvar
cno2 = "May"
cField = "Month"
contFilter[cField] = cno2
Orders.setGenFilter(contFilter)

And it worked.



Your first example based on ContractNo

var
contFilter dynArray[] String
cno2 string
endvar

Cno2 = "\""+ContractNo.value+"\""
contFilter["ContractNo"] = cno2
Jeanette.setGenfilter(contFilter)

works for me, when ContractNo contains 99-309-014

I surround the value with quotes to make it a string otherwise the filter

engine gets confused by the - sign. Filters can sometimes be very
complicated due to the lack of a real syntax. Whatever you write has to

evaluated by Paradox. Eg in the Month column of Orders table you can set
a
filter specified like this May and Terms=FOB
and like this May or Terms=FOB


--
Bertil Isberg - CTECH
Paradox buglist:
online: http://hem.bredband.net/bertilisberg/

"Jeanette" <harrisjr (AT) bwsc (DOT) org> skrev i meddelandet
news:450b15ba$1 (AT) pnews (DOT) thedbcommunity.com...

Bertil,

Here's what I had coded:
I have a form with a table frame on it
Here’s the gist of what I was doing…

contFilter dynArray[] String

Cno2 = ContractNo.value
contFilter["ContractNo"] = cno2
the above produced what I described below.

I added a field called Month because my ContractNo field is made up of

numbers
& hyphens and I thought maybe THAT was causing the problem. ContractNo

EXamples
are = 99-309-014, 00-309-006

Using the setGenFilter for UIobject I NOW have coded:
cno2, cField string
contFilter DynArray[] String

cno2 = "May"
cField = "Month"
contFilter[cField] = cno2
CashFlow.setGenFilter(contFilter)

When the above code is run I get this error message -
The Ffilter expression in field Month is not valid.
HELP !

"Bertil Isberg" <ctech (AT) corel (DOT) ca> wrote:
Jeanette

NOW, how about the form?
I am using a filter in OPAL and I am not getting the results I expected.
I expected the form to display records as if the ones requested by the
filter
were the only records in the table. Instead it seems that the filter

moves
to the 1st instance of the requested records, displays the group AND
everything
thereafter AND if you use the scrollbar ALL of the records in the table
will
be displayed.

Is this the way it is supposed to work?


No, it's not the way it should work. You have to show the code you're

using.
You can find example coe in the ObjectPAL reference help files. Search
the

index for setGenFilter() and select the uiObject type version of method.

--
Bertil Isberg - CTECH
Paradox buglist:
online: http://hem.bredband.net/bertilisberg/

"Jeanette" <harrisjr (AT) bwsc (DOT) org> skrev i meddelandet
news:450af575$1 (AT) pnews (DOT) thedbcommunity.com...

Bertil,

I decided to go with a table in PRIV for the report.

UNFORTUNATELY, the app that is written in Paradox is more than 10
years

old
and VERY RARELY needs maintenance and less often than VERY RARELY do
I
get
a request to add new functionality. When I get a request to add new
functionality
or a request for maintenance I do try to 'do it' by using something
that
I have not used before - hence the setGenFilter.

I completely understand my error with using setGenFilter after you
pointed
it out to me AND I had suspected that the setGenFilter was not being

used
when I opened the report to print it. I had checked the variable
before
calling the report and all was well. HOWEVER, if I were to use
setGenFilter
as you have described I csn tell you that most of my Users would never

ignore
the first report and then open the form again to print he second
filtered
Report. They would hum along killing trees ļ !
Creating a table in PRIV is the best solution.

NOW, how about the form?
I am using a filter in OPAL and I am not getting the results I
expected.
I expected the form to display records as if the ones requested by the

filter
were the only records in the table. Instead it seems that the filter

moves
to the 1st instance of the requested records, displays the group AND
everything
thereafter AND if you use the scrollbar ALL of the records in the
table

will
be displayed.

Is this the way it is supposed to work?


"Bertil Isberg" <ctech (AT) corel (DOT) ca> wrote:
Jeanette

You have already got some advices on how to apply a filter to a report
by

using a different table, but the code you showed is worth some
comments.


cno = ContractNo.value
cnoRpt["ContractNo"] = cno
cash.attach("CASHFLOW")
cash.setGenFilter(cnoRpt)

if rept1.open("CASHFLOW1") then
rept1.print()
rept1.close()
else
msgInfo("Problem.", "Couldn't open the report for the FIRST 6
months")
endif

The report ignores the filter.


You don't tell us what cash is. It looks like you apply a filter to
a

table

variable. But then you're opening a report. When you open a report,
it
ignores completely waht you have done with variables in your form.
There
are
ways of applying a filter, setGenfilter(), to a report. From
ObjectPAL
help
files:
Quote
¡P If you use setGenFilter on a UIObject in a running report, the
filter
does
not take effect until you run the report again. For example, the
following

code runs a report and sets a filter; however, the filter has no
effect

until the report switches to design mode and then back into run mode.

method pushButton(var eventInfo Event)
var
reOrders Report
daCriteria DynArray[] AnyType
endVar

reOrders.open("orders")

daCriteria["OrderNo"] = "> 1234"

; Assume the report contains a table frame bound to the Orders table.
; This statement has no effect because the report is in run mode.
reOrders.ORDERS.setGenFilter(daCriteria)

reOrders.design()
reOrders.run() ; Now the filter takes effect.
endMethod
/Quote


--
Bertil Isberg - CTECH
Paradox buglist:
online: http://hem.bredband.net/bertilisberg/

"Jeanette" <harrisjr (AT) bwsc (DOT) org> skrev i meddelandet
news:450879a2 (AT) pnews (DOT) thedbcommunity.com...

I have a Table that has a ContractNo field.
Data looks like: 99-309-014 or 00-303-001 etc

I want the User to be able to request a report via ContractNo
I have tried:
cno = ContractNo.value
cnoRpt["ContractNo"] = cno
cash.attach("CASHFLOW")
cash.setGenFilter(cnoRpt)

if rept1.open("CASHFLOW1") then
rept1.print()
rept1.close()
else
msgInfo("Problem.", "Couldn't open the report for the FIRST 6
months")
endif

The report ignores the filter.

What am I doing wrong?

TIA
Jeanette













Reply With Quote
Reply




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



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.