Home > Archive > dBASE Reports > October 2005 > Report SetParams









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Report SetParams
Edward Racht

2005-10-27, 8:02 am

Greetings,

I have a dilema.

I have a RptParm.wfm that is used to select a subject from a combobox. On the form is a Print to Preview.wfm (v2.3) pushbutton. This gives me the option to either view or print one subject reports or an allsubject report.

FUNCTION PBVIEW_onClick
aParams = new AssocArray()
aParams[ "FILTER" ] = this.parent.cmbx1.value
do preview.wfm with "sbj2.rep",true,aParams
RETURN

The sbj2.rep has the following SetParams.

FUNCTION SetParams

this.dSet = form.bookdatamodule1.sbj1.rowset
this.rSet = form.streamsource1.rowset
this.cFilter = this.params[ "FILTER" ]

if this.cFilter # null
this.rSet.filter := [SUBJECT = ' ] + this.cFilter + [ ' ]
else
this.dSet.indexname := "SBT"
endif
RETURN

My dilema is that when the program gets to the following line

this.rSet.filter := [SUBJECT = ' ] + this.cFilter + [ ' ]

I get a Database Engine Error: Operation not applicable.
I choose "ignor" and the allsubject report appears.
I go back the the form and choose a subject, push the button and the one subject report appears.

I do not know what is missing.
I am using dBasePlus v2.6


Michael Nuwer [dBVIPS]

2005-10-27, 8:02 am

Edward Racht wrote:
> My dilema is that when the program gets to the following line
>
> this.rSet.filter := [SUBJECT = ' ] + this.cFilter + [ ' ]
>
> I get a Database Engine Error: Operation not applicable.



Most of the time this error message means that there is something wrong
with your filter string. Have you tried streaming the text to check it?

? [SUBJECT = ' ] + this.cFilter + [ ' ]
Edward Racht

2005-10-27, 8:02 am

Michael Nuwer [dBVIPS] Wrote:
> Most of the time this error message means that there is something wrong
> with your filter string. Have you tried streaming the text to check it?
>
> ? [SUBJECT = ' ] + this.cFilter + [ ' ]


Michael,

I did get to the text check and realized the passing to the report was working it's just that I couldn't figure out how to get the filter to work with the rowset. I was researching the dBulletin, other Newsgroups, etc.

Then I finally saw the recent question in the "programming newsgroup" concerning 'filtering.'

Ken Mayer responded with the solution that I needed.

//It's the issue with delimiters. Try:

// form.filterclause := ltrim(form.filterclause) + "MyFieldName =;
// ["+trim(cFilter)+"]"

I'm using

dMod.filter = dMod.filter + "SUBJECT = ["+trim(cFilter)+"]"

When I remove the 'trim' it doesn't work. Interesting

Thank you for responding.
Ken Mayer [dBVIPS]

2005-10-27, 8:02 am

Edward Racht wrote:
> Michael Nuwer [dBVIPS] Wrote:
>
>
>
> Michael,
>
> I did get to the text check and realized the passing to the report was working it's just that I couldn't figure out how to get the filter to work with the rowset. I was researching the dBulletin, other Newsgroups, etc.
>
> Then I finally saw the recent question in the "programming newsgroup" concerning 'filtering.'
>
> Ken Mayer responded with the solution that I needed.
>
> //It's the issue with delimiters. Try:
>
> // form.filterclause := ltrim(form.filterclause) + "MyFieldName =;
> // ["+trim(cFilter)+"]"
>
> I'm using
>
> dMod.filter = dMod.filter + "SUBJECT = ["+trim(cFilter)+"]"
>
> When I remove the 'trim' it doesn't work. Interesting


Take a look at rowset.filterOptions -- if you use 1 or 3 for this, it
will ignore the length ...

Ken

--
/(Opinions expressed are purely my own, not those of dataBased
Intelligence, Inc.)/

*Ken Mayer* [dBVIPS]
/Golden Stag Productions/
dBASE at goldenstag dot net
http://www.goldenstag.net/GSP
http://www.goldenstag.net/dbase
Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com