![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
#3
| |||
| |||
|
|
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 |
#4
| |||
| |||
|
|
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 |
#5
| |||
| |||
|
|
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 |
#6
| |||
| |||
|
|
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 |
#7
| |||
| |||
|
|
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 |
#8
| |||
| |||
|
|
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 |
#9
| |||
| |||
|
#10
| |||
| |||
|
|
cnoRpt["ContractNo"] = ""\" + cno + ""\" Oops, I posted the format wrong. It should be: |
![]() |
| Thread Tools | |
| Display Modes | |
| |