Home > Archive > dBASE Web Applications > April 2005 > Impossible filter









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 Impossible filter
Dan Anderson

2005-04-09, 8:23 pm

I have no problem with this screen as long as I am willing to look at every
record in the table. I've tried everything I know to set a filter and it
just won't accept any of them. Here is the error:
An error ocurred on the server

File: D:\htdocs\ubiquote\p
ublic\cgi-bin\status.prg
Line No:46
Error: Variable undefined: CSEARCH

Please contact the Webmaster.

And here is the code:

Try

Set proc to WebReports.cc additive //subclass of WebClass.cc
oCGI = new WebReportsCGISession
()
oCGI.Connect()

Local cSearch, seaSEARCH
seaSearch = oCGI["REC"]
cSearch = seaSearch

// oCGI["SEARCH"] = oCGI["REC"]

/*
IF oCGI.isKey('SEARCH')
oCGI.filter =[" REC=]+oCGI['SEARCH']
+["]
ENDIF
*/
oCGI. setWebMasterAddress(
"webmaster@ubinc.com")

aFieldArray = new Array()
aFieldArray = {"QuoteNum","IName","SubmitDate","Status"}

aCaptionArray = new Array()
aCaptionArray = {"Quote Number","Name of Insured","Submitted","Status"}

/* oCGI.Database = "dUBI"
oCGI.Table = "Quotes.dbf"
oCGI.IndexName = "REC"
*/
//oCGI.sqlString = 'Select * From Quotes.dbf Where REC=cSearch'

USE :dUBI:Quotes.dbf order tag REC
SET FILTER TO QUOTES->REC=cSearch
GO TOP

IF oCGI.Lookup()

oCGI.init(aFieldArray)

oCGI.bAlternateShading = false
oCGI.homePage = "http://www.ubiquote.com/monthly/select.htm"

oCGI. ResponsePageTop('Pen
ding Submissions for ' + oCGI['SEARCH'])
oCGI. ResponsePageTable(aC
aptionArray,aFieldAr
ray)
oCGI. ResponsePageBottom()


ELSE

oCGI.SorryPage("No Records found")

ENDIF

USE
catch(exception e)

oCGI.errorPage(e)

endtry

oCGI = null
aCaptionArray = null
aFieldArray = null

Quit

As you can see I've tried everything under the sun. I tried using the sql
statement and that wouldn't accept the an of the variations on the variable.
I finally got so frustrated I went back to x-base. Still no luck. It
ALWAYS interpretes the variable as a literal. How can I ONLY see the
records for a variable (oCGI["REC"])???????



--
Dan Anderson
UBI Processing Dept.
andersond@ubinc.com
800-444-4824 ext 101


David Kerber

2005-04-09, 8:23 pm

In article <Bgk3YbEPFHA.320@news-server>, andersond@ubinc.com says...
> I have no problem with this screen as long as I am willing to look at every
> record in the table. I've tried everything I know to set a filter and it
> just won't accept any of them. Here is the error:
> An error ocurred on the server
>
> File: D:\htdocs\ubiquote\p
ublic\cgi-bin\status.prg
> Line No:46
> Error: Variable undefined: CSEARCH
>
> Please contact the Webmaster.
>
> And here is the code:
>
> Try
>
> Set proc to WebReports.cc additive //subclass of WebClass.cc
> oCGI = new WebReportsCGISession
()
> oCGI.Connect()
>
> Local cSearch, seaSEARCH
> seaSearch = oCGI["REC"]
> cSearch = seaSearch
>
> // oCGI["SEARCH"] = oCGI["REC"]
>
> /*
> IF oCGI.isKey('SEARCH')
> oCGI.filter =[" REC=]+oCGI['SEARCH']
+["]
> ENDIF
> */
> oCGI. setWebMasterAddress(
"webmaster@ubinc.com")
>
> aFieldArray = new Array()
> aFieldArray = {"QuoteNum","IName","SubmitDate","Status"}
>
> aCaptionArray = new Array()
> aCaptionArray = {"Quote Number","Name of Insured","Submitted","Status"}
>
> /* oCGI.Database = "dUBI"
> oCGI.Table = "Quotes.dbf"
> oCGI.IndexName = "REC"
> */
> //oCGI.sqlString = 'Select * From Quotes.dbf Where REC=cSearch'


If I were doing this, I'd use the SQL version, but you need to move the
variable cSearch outside the quotes, because the database engine doesn't
know what it is. That will append the _contents_ of the variable to the
string. Note that if REC is a character field, you're going to need to
get quotes into the string as well, but I'm going to assume it's
numeric:

oCGI.sqlString = 'Select * From Quotes.dbf Where REC=' + cSearch

Something similar would probably be necessary in the SET FILTER
statement, but I don't use that much.

>
> USE :dUBI:Quotes.dbf order tag REC
> SET FILTER TO QUOTES->REC=cSearch
> GO TOP


.....

--
Remove the ns_ from if replying by e-mail (but keep posts in the
newsgroups if possible).
Claus Mygind

2005-04-09, 8:23 pm

Dan,
As long as you are using dBASE tables, I would recommend staying away from
the complex SQL statements. Sooner or later you are going to want to do
more than just a simple filter and you will run in to other problems. That
is what happend to me. I still suggest that you go back to a scoped index
and use obj.setRange(cSearch) followed by a do while loop in your output.
It will actually work very fast.

if in your table "Quotes.dbf" the field "REC" is numeric you need to create
the cSearch variable like this cSearch = val(oCGI["REC"]) because oCGI
elements are always character no matter what the content is. You might also
want to try and declare cSearch as Public instead of local.

You cannot use xBase code in these apps you must use the OOP equivelant so
that code would never work.

I am not too familiar with WebReportsCGISession
s( ) so I can't provide help
with that.

//But to re-write your statement you would have to write it like this
oCGI.sqlString = 'Select * From Quotes.dbf Where REC='+cSearch

I generally just build my own reports to stream out.

Here are a couple of tips that may help get the environment set up

// Make your own instance of CGISessions where you will customize your
report.
set procedure to WebClass.cc additive

//notice the "My" which is reference to the subclass of CGISessions that
comes after the "Quit" command
oCGI = new MyCGISession()

////// Create query variable for response reports to use
Public cSearch, cTable, cIndex

//make sure the search variable is the the right length and type needed
to find your data.
//If numeric convert your oCGI element with val( ).
//If it need to be padded with spaces check the length with len( ).
//If the value is needs to be case sensitive convert it with upper( ) or
lower( ).
//Or trim it as shown here.
cSearch = trim(oCGI["SEARCH"])
cTable = "Quotes.dbf"
cIndex = trim(oCGI["INDEX"])


// Open Database like this. You don't need to make everything an oCGI
element.
db = new DATABASE()
db.databaseName = "dUBI"
db.active = true

// Open Query like this
q = new QUERY()

//see db is easier to use than a reference to oCGI
q.database = db

// see how the variable cTable is outside the quotes of the sql select
statments
q.sql = "select * from "+cTable+".dbf"
q.active = true

//in this example the sending .html page
//included the name of the index
//I wanted to use so I use it to set the order of the records.
q.rowset.indexname = cIndex

//here is where I limit the records
//I want to include in the report this is my filter.
//It is also faster than the filter command
q.rowset.setRange( cSearch )

// other variation of set range would be.
//You can look this up in help under "setRange( )"
/*
q.rowset.setRange(<startKey exp> | null, <endKey exp> | null )
<key exp> Shows only those rows whose key value matches <key exp>.
<startKey exp> Shows those rows whose key value is equal to or greater
than <startKey exp>.
<endKey exp> Shows those rows whose key value is less than or equal to
<endKey exp>.
There are four ways to use setRange( ):
1. Exact match: setRange(<key exp> )
2. Range from start to end: setRange(<startKey exp>, <endKey exp> )
3. Range from starting value: setRange(<startKey exp>, null)
4. Range up to ending value: setRange(null, <endKey exp> )
*/

// Only stream out a report if some records where found.
if q.rowset.findkey(cSearch)
oCGI. streamHeader('Pendin
g Submissions for ' + oCGI['SEARCH'])
oCGI.StreamBody()
oCGI.streamFooter()
else
oCGI.sorryPage("<b>No matching records found.</b> )
endif

catch (exception e)

oCGI.errorPage(e)

endtry

r = null // Clean up

////// all done
Quit

//here is where you design your own output
Class MyCGISession of CGISession from "WebClass.cc"

function streamBody

//you can use public variables created above, but any local variables
cannot be used in this function.
local c
c = q.rowset.fields

with (this.fOut)

//you are creating the body section of your html page here so you need the
necessary html tags.
//like body, form, etc.
puts(' <body>')
puts(' <div align="center">
')
puts(' <h2>'Pending Submissions for ' <BR><font color="red">'+ cSearch
+'</font></h2>')

//if you include any submit buttons on this page you will need assign a
URL to the action
puts(' <form method="POST" action="" name="formb"
ENCTYPE="application/x-www-form-urlencoded">')
puts(' </div"> ')

puts(' <div align="left">
')
puts(' <table cols="5" border="0" cellpadding="2" cellspacing="0"
width="1%">')

//remember to stream out your table header here.

//I will guarantee this will filter your records.
//Since you set the range above only the records you want included will
stream out here.
do while not q.rowset.endofset

//you can insert your detail lines here
puts(' <tr>')
puts(' <td nowrap="nowrap" align="right">First Name</td>')
cValue = iif( not empty( c["FIRSTNAME"].value ),
c["FIRSTNAME"].value, "")
puts(' <td><Input type="text" maxlength="30" size="40"
name="FirstName" value=" '+cValue+' " </td> ')
puts(' </tr>')

// go to next record
q.rowset.next()

enddo
puts(' </table>')
puts(' </div>')
puts(' <div align="center">
')
puts([ <p> <a href="#" onClick="window.close();">Close
Window</a></p>])
puts(' </div>')
puts(' </form>')
puts('</body>')
endwith
return true

endclass


Claus Mygind

2005-04-09, 8:23 pm

In the example I just sent make sure you either print the message or view it
maximized as some of the line wraps may confuse you.


Claus Mygind

2005-04-10, 8:23 pm

Dan,

I have given this some more thought. If you already have the report you
like, working with the oCGI = new WebReportsCGISession
() and all you
really need to do is limit the data set. Do the following:

1. After you open the data base and the table and set your index just use
the ".setRange( )". Forget about the "Where" clause.

Public cSearch
cSearch = CGI["REC"]

oCGI.Database = "dUBI"
oCGI.Table = "Quotes.dbf"
oCGI.IndexName = "REC"

oCGI.sqlString = 'Select * From Quotes.dbf " //note "Where" has been
removed.

oCGI.Table.setRange(cSearch) // note use this instead to limit the
rowset.


2. If the code above does not limit the records to your search criteria,
then the value of cSearch is not what you expect it should be. You should
see one of 3 things, 1) just the records you want 2) all the records or 3)
no records at all. If it is either 2 or 3 here is what you should do

A) In the dBASE command window you can simulate "setRange(cSearch)" with
the following commands
Use Quotes order REC
cSearch = "<the value you want to use">
Set Key to cSearch
Browse

If the result from the browse is what you expect, then the value,
which is passed html page is not what you expected. If the result from the
browser, however is still incorrect then the value you assigned to cSearch
in the command window does not match the value in your index and you better
look at the formatting of your data in cSearch visa vie your index Tag. Then
go to step B below.

B) You probably already know this, but just to be safe. Insert these lines
at the top of your app:

Set procedure to debug.cc additive
oDebug = new webDebug()

After these two lines, insert the following:
Public cSearch
cSearch = CGI["REC"]

oCGI["myTest"] = cSearch
oDebug.ShowArrayList()

Then look at the result of myTest. Highlight the result to verify all blank
spaces. Then is the value of myTest what you want it to be? Remember this
is still a character value. If cSearch is suppose to be somthing else to
match the index "REC", then you need to convert and format the value when
you create cSearch.

I hope this helps smooth things out.







"Dan Anderson" <andersond@ubinc.com> wrote in message
news:Bgk3YbEPFHA.320@news-server...
>I have no problem with this screen as long as I am willing to look at every
>record in the table. I've tried everything I know to set a filter and it
>just won't accept any of them. Here is the error:
> An error ocurred on the server
>
> File: D:\htdocs\ubiquote\p
ublic\cgi-bin\status.prg
> Line No:46
> Error: Variable undefined: CSEARCH
>
> Please contact the Webmaster.
>
> And here is the code:
>
> Try
>
> Set proc to WebReports.cc additive //subclass of WebClass.cc
> oCGI = new WebReportsCGISession
()
> oCGI.Connect()
>
> Local cSearch, seaSEARCH
> seaSearch = oCGI["REC"]
> cSearch = seaSearch
>
> // oCGI["SEARCH"] = oCGI["REC"]
>
> /*
> IF oCGI.isKey('SEARCH')
> oCGI.filter =[" REC=]+oCGI['SEARCH']
+["]
> ENDIF
> */
> oCGI. setWebMasterAddress(
"webmaster@ubinc.com")
>
> aFieldArray = new Array()
> aFieldArray = {"QuoteNum","IName","SubmitDate","Status"}
>
> aCaptionArray = new Array()
> aCaptionArray = {"Quote Number","Name of Insured","Submitted","Status"}
>
> /* oCGI.Database = "dUBI"
> oCGI.Table = "Quotes.dbf"
> oCGI.IndexName = "REC"
> */
> //oCGI.sqlString = 'Select * From Quotes.dbf Where REC=cSearch'
>
> USE :dUBI:Quotes.dbf order tag REC
> SET FILTER TO QUOTES->REC=cSearch
> GO TOP
>
> IF oCGI.Lookup()
>
> oCGI.init(aFieldArray)
>
> oCGI.bAlternateShading = false
> oCGI.homePage = "http://www.ubiquote.com/monthly/select.htm"
>
> oCGI. ResponsePageTop('Pen
ding Submissions for ' + oCGI['SEARCH'])
> oCGI. ResponsePageTable(aC
aptionArray,aFieldAr
ray)
> oCGI. ResponsePageBottom()

>
> ELSE
>
> oCGI.SorryPage("No Records found")
>
> ENDIF
>
> USE
> catch(exception e)
>
> oCGI.errorPage(e)
>
> endtry
>
> oCGI = null
> aCaptionArray = null
> aFieldArray = null
>
> Quit
>
> As you can see I've tried everything under the sun. I tried using the sql
> statement and that wouldn't accept the an of the variations on the
> variable. I finally got so frustrated I went back to x-base. Still no
> luck. It ALWAYS interpretes the variable as a literal. How can I ONLY
> see the records for a variable (oCGI["REC"])???????
>
>
>
> --
> Dan Anderson
> UBI Processing Dept.
> andersond@ubinc.com
> 800-444-4824 ext 101
>



Dan Anderson

2005-04-11, 7:23 am

I would like to try the scoped index you keep mentioning but I don't
understand what you're talking about. But nothing else is working; so, I'm
willing to try anything. All-in-all I've got a reasonably complex
application working but can't get past this filter. And, the next stages of
this app require this to work. Please explain what a scoped index is.



--
Dan Anderson
UBI Processing Dept.
andersond@ubinc.com
800-444-4824 ext 101
"Claus Mygind" <cmygind@hotmail.com> wrote in message
news:T8KCOmKPFHA.444@news-server...
> Dan,
> As long as you are using dBASE tables, I would recommend staying away from
> the complex SQL statements. Sooner or later you are going to want to do
> more than just a simple filter and you will run in to other problems.
> That is what happend to me. I still suggest that you go back to a scoped
> index and use obj.setRange(cSearch) followed by a do while loop in your
> output. It will actually work very fast.
>
> if in your table "Quotes.dbf" the field "REC" is numeric you need to
> create the cSearch variable like this cSearch = val(oCGI["REC"]) because
> oCGI elements are always character no matter what the content is. You
> might also want to try and declare cSearch as Public instead of local.
>
> You cannot use xBase code in these apps you must use the OOP equivelant so
> that code would never work.
>
> I am not too familiar with WebReportsCGISession
s( ) so I can't provide
> help with that.
>
> //But to re-write your statement you would have to write it like this
> oCGI.sqlString = 'Select * From Quotes.dbf Where REC='+cSearch
>
> I generally just build my own reports to stream out.
>
> Here are a couple of tips that may help get the environment set up
>
> // Make your own instance of CGISessions where you will customize your
> report.
> set procedure to WebClass.cc additive
>
> //notice the "My" which is reference to the subclass of CGISessions that
> comes after the "Quit" command
> oCGI = new MyCGISession()
>
> ////// Create query variable for response reports to use
> Public cSearch, cTable, cIndex
>
> //make sure the search variable is the the right length and type needed
> to find your data.
> //If numeric convert your oCGI element with val( ).
> //If it need to be padded with spaces check the length with len( ).
> //If the value is needs to be case sensitive convert it with upper( ) or
> lower( ).
> //Or trim it as shown here.
> cSearch = trim(oCGI["SEARCH"])
> cTable = "Quotes.dbf"
> cIndex = trim(oCGI["INDEX"])
>
>
> // Open Database like this. You don't need to make everything an oCGI
> element.
> db = new DATABASE()
> db.databaseName = "dUBI"
> db.active = true
>
> // Open Query like this
> q = new QUERY()
>
> //see db is easier to use than a reference to oCGI
> q.database = db
>
> // see how the variable cTable is outside the quotes of the sql select
> statments
> q.sql = "select * from "+cTable+".dbf"
> q.active = true
>
> //in this example the sending .html page
> //included the name of the index
> //I wanted to use so I use it to set the order of the records.
> q.rowset.indexname = cIndex
>
> //here is where I limit the records
> //I want to include in the report this is my filter.
> //It is also faster than the filter command
> q.rowset.setRange( cSearch )
>
> // other variation of set range would be.
> //You can look this up in help under "setRange( )"
> /*
> q.rowset.setRange(<startKey exp> | null, <endKey exp> | null )
> <key exp> Shows only those rows whose key value matches <key exp>.
> <startKey exp> Shows those rows whose key value is equal to or greater
> than <startKey exp>.
> <endKey exp> Shows those rows whose key value is less than or equal to
> <endKey exp>.
> There are four ways to use setRange( ):
> 1. Exact match: setRange(<key exp> )
> 2. Range from start to end: setRange(<startKey exp>, <endKey exp> )
> 3. Range from starting value: setRange(<startKey exp>, null)
> 4. Range up to ending value: setRange(null, <endKey exp> )
> */
>
> // Only stream out a report if some records where found.
> if q.rowset.findkey(cSearch)
> oCGI. streamHeader('Pendin
g Submissions for ' + oCGI['SEARCH'])
> oCGI.StreamBody()
> oCGI.streamFooter()
> else
> oCGI.sorryPage("<b>No matching records found.</b> )
> endif
>
> catch (exception e)
>
> oCGI.errorPage(e)
>
> endtry
>
> r = null // Clean up
>
> ////// all done
> Quit
>
> //here is where you design your own output
> Class MyCGISession of CGISession from "WebClass.cc"
>
> function streamBody
>
> //you can use public variables created above, but any local variables
> cannot be used in this function.
> local c
> c = q.rowset.fields
>
> with (this.fOut)
>
> //you are creating the body section of your html page here so you need
> the necessary html tags.
> //like body, form, etc.
> puts(' <body>')
> puts(' <div align="center"> ')
> puts(' <h2>'Pending Submissions for ' <BR><font color="red">'+
> cSearch +'</font></h2>')
>
> //if you include any submit buttons on this page you will need assign
> a URL to the action
> puts(' <form method="POST" action="" name="formb"
> ENCTYPE="application/x-www-form-urlencoded">')
> puts(' </div"> ')
>
> puts(' <div align="left"> ')
> puts(' <table cols="5" border="0" cellpadding="2" cellspacing="0"
> width="1%">')
>
> //remember to stream out your table header here.
>
> //I will guarantee this will filter your records.
> //Since you set the range above only the records you want included will
> stream out here.
> do while not q.rowset.endofset
>
> //you can insert your detail lines here
> puts(' <tr>')
> puts(' <td nowrap="nowrap" align="right">First Name</td>')
> cValue = iif( not empty( c["FIRSTNAME"].value ),
> c["FIRSTNAME"].value, "")
> puts(' <td><Input type="text" maxlength="30" size="40"
> name="FirstName" value=" '+cValue+' " </td> ')
> puts(' </tr>')
>
> // go to next record
> q.rowset.next()
>
> enddo
> puts(' </table>')
> puts(' </div>')
> puts(' <div align="center"> ')
> puts([ <p> <a href="#" onClick="window.close();">Close
> Window</a></p>])
> puts(' </div>')
> puts(' </form>')
> puts('</body>')
> endwith
> return true
>
> endclass
>
>



Claus Mygind

2005-04-11, 7:23 am

Oops! I made a mistake here. setRange( ) is a property of rowset so the
line below should be written as shown on bottom.

> oCGI.Table.setRange(cSearch) // note use this instead to limit the
> rowset.



oCGI.Table.rowset.setRange(cSearch)


Claus Mygind

2005-04-11, 7:23 am

Scoping the index just means adding a "for <exp>" condition to the index.
Like "Index on REC for not empty(REC) tag FullRec". In this example only
records which have a value in the REC field are included in the index.
Therefore you have already filtered out records you don't want displayed.

But I see from your coding so far that may not be needed here. You already
have an index "REC", so you must have the records in the order you want
them. Now all you need is to limit the rowset to one specific value of
"REC". That is where you tried the "where" clause on the sql statement.
But I am suggesting now that you drop that idea and use "setRange( )"
property. It is really easy to use and will filter your records for you.
oCGI.Table.rowset.setRange( cSearch ) should do the job for you.


"Dan Anderson" <andersond@ubinc.com> wrote in message
news:2b81%23OnPFHA.1188@news-server...
>I would like to try the scoped index you keep mentioning but I don't
>understand what you're talking about. But nothing else is working; so, I'm
>willing to try anything. All-in-all I've got a reasonably complex
>application working but can't get past this filter. And, the next stages
>of this app require this to work. Please explain what a scoped index is.
>
>
>
> --
> Dan Anderson
> UBI Processing Dept.
> andersond@ubinc.com
> 800-444-4824 ext 101
> "Claus Mygind" <cmygind@hotmail.com> wrote in message
> news:T8KCOmKPFHA.444@news-server...
>
>



Michael Nuwer [dBVIPS]

2005-04-11, 7:23 am

Dan Anderson wrote:
> But nothing else is working; so, I'm
> willing to try anything. All-in-all I've got a reasonably complex
> application working but can't get past this filter.


You will need a strategy for isolating your program errors. Did you try
the problematic filter outside of a CGI architecture, i.e. from the
command prompt or in a simple procedure file? There is no reason why
the filter should not work, so you should be able to isolate the error
with some testing.

--
Michael Nuwer
http://www.nuwermj.potsdam.edu/dLearn/
http://www.nuwermj.potsdam.edu/dSamples/
Michael Nuwer [dBVIPS]

2005-04-11, 7:23 am

Claus Mygind wrote:
> Oops! I made a mistake here. setRange( ) is a property of rowset so the
> line below should be written as shown on bottom.
>
>
>
>
>
> oCGI.Table.rowset.setRange(cSearch)


WebReports.cc is desinged to manage the query objects. oCGI.table is
class property, it is not the a query object.

oCGI.RangeValue = oCGI['SEARCH']

or if the index key is numberic

oCGI.RangeValue = val(oCGI['SEARCH'])

The complete program that should work is the following:

Try

Set proc to WebReports.cc additive
oCGI = new WebReportsCGISession
()
oCGI.Connect()

oCGI. setWebMasterAddress(
"webmaster@ubinc.com")

aFieldArray = new Array()
aFieldArray = {"QuoteNum","IName","SubmitDate","Status"}
aCaptionArray = new Array()
aCaptionArray = {"Quote Number","Name of ;
Insured","Submitted","Status"}

oCGI.Database = "dUBI"
oCGI.Table = "Quotes.dbf"
oCGI.IndexName = "REC"

if oCGI.isKey('SEARCH')
// REC is a numeric field?
// if so you need to use VAL()
oCGI.RangeValue = val(oCGI['SEARCH'])
endif
//oCGI.sqlString = 'Select * From Quotes.dbf Where REC=cSearch'
IF oCGI.Lookup()
oCGI.init(aFieldArray)
oCGI.bAlternateShading = false
oCGI.homePage = "http://www.ubiquote.com/monthly/select.htm"
oCGI. ResponsePageTop('Pen
ding Submissions for ' + oCGI['SEARCH'])
oCGI. ResponsePageTable(aC
aptionArray,aFieldAr
ray)
oCGI. ResponsePageBottom()

ELSE
oCGI.SorryPage("No Records found")
ENDIF
catch(exception e)
oCGI.errorPage(e)
endtry
oCGI = null
aCaptionArray = null
aFieldArray = null
Quit






--
Michael Nuwer
http://www.nuwermj.potsdam.edu/dLearn/
http://www.nuwermj.potsdam.edu/dSamples/
Dan Anderson

2005-04-11, 9:23 am

I'm sorry this has been such a pain but I just can't get past this filter. When I use this code I get the error that follows. When I use the sql code I get the entire table. I have passed 'POTUS01' as the value of REC. And there are 3 records in the quotes.dbf table that match this. I need to be able to filter for other things as well but I just can't get past this simple filter.




Set proc to MyWebReports.cc additive //subclass of WebClass.cc
oCGI = new MyWebReportsCGISessi
on()
oCGI.Connect()

PUBLIC cSearch, seaSEARCH
seaSearch = oCGI["REC"]
cSearch = seaSearch

oCGI["SEARCH"] = oCGI["REC"]


IF oCGI.isKey('SEARCH')
oCGI.filter = 'REC='+oCGI['SEARCH'
]
ENDIF

oCGI. setWebMasterAddress(
"webmaster@ubinc.com")

aFieldArray = new Array()
aFieldArray = {"QuoteNum","IName","SubmitDate","Status","PD","NT","CG"}

aCaptionArray = new Array()
aCaptionArray = {"Quote Number","Name of Insured","Submitted","Status","PhysDam","Bobtail","Cargo"}

oCGI.Database = "dUBI"
oCGI.Table = "Quotes.dbf"
oCGI.IndexName = "REC"
/*
db = new database()
db.databasename = "dUbi"
db.active = true

q = new query()
q.database = db
q.sql = 'Select * from Quotes.dbf'
q.active = true

q.rowset.indexname = "REC"
q.rowset.setRange( cSearch )

//oCGI.sqlString = 'Select * From Quotes.dbf'

*/

An error ocurred on the server

File: D:\htdocs\ubiquote\p
ublic\cgi-bin\MyWebReports.cc
Line No:165
Error: Variable undefined: POTUS01

Please contact the Webmaster.


--
Dan Anderson
UBI Processing Dept.
andersond@ubinc.com
800-444-4824 ext 101
"Michael Nuwer [dBVIPS]" <nuwermj@nospam.please.yahoo.com> wrote in message news:L$EEPWoPFHA.432@news-server...
> Dan Anderson wrote:
>
> You will need a strategy for isolating your program errors. Did you try
> the problematic filter outside of a CGI architecture, i.e. from the
> command prompt or in a simple procedure file? There is no reason why
> the filter should not work, so you should be able to isolate the error
> with some testing.
>
> --
> Michael Nuwer
> http://www.nuwermj.potsdam.edu/dLearn/
> http://www.nuwermj.potsdam.edu/dSamples/

Dan Anderson

2005-04-11, 9:23 am

Thank you. That did work. I will compare it to the lines that didn't work
and draw conclusions. Thanks again.



--
Dan Anderson
UBI Processing Dept.
andersond@ubinc.com
800-444-4824 ext 101
"Michael Nuwer [dBVIPS]" <nuwermj@nospam.please.yahoo.com> wrote in message
news:MqeHMhoPFHA.432@news-server...
> Claus Mygind wrote:
>
> WebReports.cc is desinged to manage the query objects. oCGI.table is class
> property, it is not the a query object.
>
> oCGI.RangeValue = oCGI['SEARCH']
>
> or if the index key is numberic
>
> oCGI.RangeValue = val(oCGI['SEARCH'])
>
> The complete program that should work is the following:
>
> Try
>
> Set proc to WebReports.cc additive
> oCGI = new WebReportsCGISession
()
> oCGI.Connect()
>
> oCGI. setWebMasterAddress(
"webmaster@ubinc.com")
>
> aFieldArray = new Array()
> aFieldArray = {"QuoteNum","IName","SubmitDate","Status"}
> aCaptionArray = new Array()
> aCaptionArray = {"Quote Number","Name of ;
> Insured","Submitted","Status"}
>
> oCGI.Database = "dUBI"
> oCGI.Table = "Quotes.dbf"
> oCGI.IndexName = "REC"
>
> if oCGI.isKey('SEARCH')
> // REC is a numeric field?
> // if so you need to use VAL()
> oCGI.RangeValue = val(oCGI['SEARCH'])
> endif
> //oCGI.sqlString = 'Select * From Quotes.dbf Where REC=cSearch'
> IF oCGI.Lookup()
> oCGI.init(aFieldArray)
> oCGI.bAlternateShading = false
> oCGI.homePage = "http://www.ubiquote.com/monthly/select.htm"
> oCGI. ResponsePageTop('Pen
ding Submissions for ' + oCGI['SEARCH'])
> oCGI. ResponsePageTable(aC
aptionArray,aFieldAr
ray)
> oCGI. ResponsePageBottom()

> ELSE
> oCGI.SorryPage("No Records found")
> ENDIF
> catch(exception e)
> oCGI.errorPage(e)
> endtry
> oCGI = null
> aCaptionArray = null
> aFieldArray = null
> Quit
>
>
>
>
>
>
> --
> Michael Nuwer
> http://www.nuwermj.potsdam.edu/dLearn/
> http://www.nuwermj.potsdam.edu/dSamples/



Claus Mygind

2005-04-11, 8:23 pm

Mike,

I just took the time to read your online webReport lesson. Very nice. I
wish it had been available when I started.



Claus Mygind

2005-04-11, 8:23 pm


"Michael Nuwer [dBVIPS]" <nuwermj@nospam.please.yahoo.com> wrote in message
news:MqeHMhoPFHA.432@news-server...
> Claus Mygind wrote:
>
> WebReports.cc is desinged to manage the query objects. oCGI.table is class
> property, it is not the a query object.
>
> oCGI.RangeValue = oCGI['SEARCH']
>
> or if the index key is numberic
>
> oCGI.RangeValue = val(oCGI['SEARCH'])
>
> The complete program that should work is the following:
>
> Try
>
> Set proc to WebReports.cc additive
> oCGI = new WebReportsCGISession
()
> oCGI.Connect()
>
> oCGI. setWebMasterAddress(
"webmaster@ubinc.com")
>
> aFieldArray = new Array()
> aFieldArray = {"QuoteNum","IName","SubmitDate","Status"}
> aCaptionArray = new Array()
> aCaptionArray = {"Quote Number","Name of ;
> Insured","Submitted","Status"}
>
> oCGI.Database = "dUBI"
> oCGI.Table = "Quotes.dbf"
> oCGI.IndexName = "REC"
>
> if oCGI.isKey('SEARCH')
> // REC is a numeric field?
> // if so you need to use VAL()
> oCGI.RangeValue = val(oCGI['SEARCH'])
> endif
> //oCGI.sqlString = 'Select * From Quotes.dbf Where REC=cSearch'
> IF oCGI.Lookup()
> oCGI.init(aFieldArray)
> oCGI.bAlternateShading = false
> oCGI.homePage = "http://www.ubiquote.com/monthly/select.htm"
> oCGI. ResponsePageTop('Pen
ding Submissions for ' + oCGI['SEARCH'])
> oCGI. ResponsePageTable(aC
aptionArray,aFieldAr
ray)
> oCGI. ResponsePageBottom()

> ELSE
> oCGI.SorryPage("No Records found")
> ENDIF
> catch(exception e)
> oCGI.errorPage(e)
> endtry
> oCGI = null
> aCaptionArray = null
> aFieldArray = null
> Quit
>
>
>
>
>
>
> --
> Michael Nuwer
> http://www.nuwermj.potsdam.edu/dLearn/
> http://www.nuwermj.potsdam.edu/dSamples/



Claus Mygind

2005-04-11, 8:23 pm

Mike

Thanks for the update. I had not reviewed your webReport.cc, so I was not
sure where Dan came up with his coding. I just read through your module and
it looks great. It all makes sense now. Too bad you did not write this
module before I got so deep into writing my own reports. You sure make it
easy.

Claus


Dan Anderson

2005-04-12, 7:23 am

Here's a new twist. This report page is called from a webpage where the
user selects between (1) creating a new submission, (2) viewing pending
submissions or (3) completing quoted submissions. This report page is #2,
it allows the user to view pending submissions. I have subclassed
WebReports.cc to MyWebReports.cc and have changed a few things, like I did
away with the hyperlink to "Try their query again." And changed the
hyperlink "Home" to "Continue" This report page assigns where that
hyperlink sends the program flow. The problem is that calling page
(select.htm) that I need to go back to had data on it from a different table
than the one used for the report. So, I need to do a query before I go back
to that page. Here's the problem, the oCGI.connect() line is in this file
but the page, select.htm, is called by MyWebReports.cc. I have tried
placing the query in this file but it doesn't pass the data into select.htm.
How can I make this work?

I'm afraid I haven't explained it clearly enough. The application is in the
development phase so it is safe to play with. Here's the URL
http://www.ubiquote.com The user id is "POTUS01" and the password is
"bluedress." If you will just follow this link and follow your nose to
"Check Submissions" then "Continue" at the bottom of the report. I think
this will demonstrate the problem better than a narrative explanation. The
common lookup field here is the user ID, which is a field called "REC" in
both tables, the value of which, in this case is "POTUS01"

I just want the select.htm page to look the same when it comes out of the
report as it did when it went into the report.



--
Dan Anderson
UBI Processing Dept.
andersond@ubinc.com
800-444-4824 ext 101
"Michael Nuwer [dBVIPS]" <nuwermj@nospam.please.yahoo.com> wrote in message
news:MqeHMhoPFHA.432@news-server...
> Claus Mygind wrote:
>
> WebReports.cc is desinged to manage the query objects. oCGI.table is class
> property, it is not the a query object.
>
> oCGI.RangeValue = oCGI['SEARCH']
>
> or if the index key is numberic
>
> oCGI.RangeValue = val(oCGI['SEARCH'])
>
> The complete program that should work is the following:
>
> Try
>
> Set proc to WebReports.cc additive
> oCGI = new WebReportsCGISession
()
> oCGI.Connect()
>
> oCGI. setWebMasterAddress(
"webmaster@ubinc.com")
>
> aFieldArray = new Array()
> aFieldArray = {"QuoteNum","IName","SubmitDate","Status"}
> aCaptionArray = new Array()
> aCaptionArray = {"Quote Number","Name of ;
> Insured","Submitted","Status"}
>
> oCGI.Database = "dUBI"
> oCGI.Table = "Quotes.dbf"
> oCGI.IndexName = "REC"
>
> if oCGI.isKey('SEARCH')
> // REC is a numeric field?
> // if so you need to use VAL()
> oCGI.RangeValue = val(oCGI['SEARCH'])
> endif
> //oCGI.sqlString = 'Select * From Quotes.dbf Where REC=cSearch'
> IF oCGI.Lookup()
> oCGI.init(aFieldArray)
> oCGI.bAlternateShading = false
> oCGI.homePage = "http://www.ubiquote.com/monthly/select.htm"
> oCGI. ResponsePageTop('Pen
ding Submissions for ' + oCGI['SEARCH'])
> oCGI. ResponsePageTable(aC
aptionArray,aFieldAr
ray)
> oCGI. ResponsePageBottom()

> ELSE
> oCGI.SorryPage("No Records found")
> ENDIF
> catch(exception e)
> oCGI.errorPage(e)
> endtry
> oCGI = null
> aCaptionArray = null
> aFieldArray = null
> Quit
>
>
>
>
>
>
> --
> Michael Nuwer
> http://www.nuwermj.potsdam.edu/dLearn/
> http://www.nuwermj.potsdam.edu/dSamples/



Michael Nuwer [dBVIPS]

2005-04-12, 7:23 am


Hi Dan,

Yes the live web site was useful. There are a few ways to handle this
issue.

The easiest solution is to use the following for the "continue" link:

http://www.ubiquote.com/cgi-bin/app...serID=bluedress

You can construct this string in program file

oCGI.homePage = ;
"http://www.ubiquote.com/cgi-bin/appsignin.exe?REC=" + ;
oCGI["REC"] + "&UserID=" + oCGI["UserID"]

This is done in your "status.prg" program. Also you will need add a
hidden field in the appsingin.exe response page:

<input type="hidden" name="Agent" value="Havana Testers Insurance">
<input type="hidden" name="REC" value="POTUS01">

Add hidden field for name="UserID"

<input type="submit" value="Check Status" name="B2" style="font-weight:
bold"></td>

This should work, but you will note that the user's REC and UserID
values are visible in the browser. There are a few ways around this.

One would be to use a replacement for the UserID, like "UserID=Y" Then
your program can check for oCGI['UserID'] == "Y" and act accordingly.
This option is not all that secure, however. A user can get around your
login page if they know what to do.

A second option would be for the "Continue" link to call a JavaScript
function. That function would send a "POST" request (which does not
revel the name/value pairs). Let me know if you what to try this option
and I'll try to put together some code.

Perhaps the most common solution to this problem is to use a "Cookie".
When a user successfully logs in, the appsignin's response page (the one
with three buttons) would set this cookie and the cookie would contain
the REC and UserID names and values. Then you would need to modify the
appsignin program so that it a) checks for a cookie b) if it exists use
REC and UserID from the cookie to do your lookup c) if the cookie does
not exist use the oCGI array values.



Dan Anderson wrote:
> Here's a new twist. This report page is called from a webpage where the
> user selects between (1) creating a new submission, (2) viewing pending
> submissions or (3) completing quoted submissions. This report page is #2,
> it allows the user to view pending submissions. I have subclassed
> WebReports.cc to MyWebReports.cc and have changed a few things, like I did
> away with the hyperlink to "Try their query again." And changed the
> hyperlink "Home" to "Continue" This report page assigns where that
> hyperlink sends the program flow. The problem is that calling page
> (select.htm) that I need to go back to had data on it from a different table
> than the one used for the report. So, I need to do a query before I go back
> to that page. Here's the problem, the oCGI.connect() line is in this file
> but the page, select.htm, is called by MyWebReports.cc. I have tried
> placing the query in this file but it doesn't pass the data into select.htm.
> How can I make this work?
>
> I'm afraid I haven't explained it clearly enough. The application is in the
> development phase so it is safe to play with. Here's the URL
> http://www.ubiquote.com The user id is "POTUS01" and the password is
> "bluedress." If you will just follow this link and follow your nose to
> "Check Submissions" then "Continue" at the bottom of the report. I think
> this will demonstrate the problem better than a narrative explanation. The
> common lookup field here is the user ID, which is a field called "REC" in
> both tables, the value of which, in this case is "POTUS01"
>
> I just want the select.htm page to look the same when it comes out of the
> report as it did when it went into the report.
>
>
>



--
Michael Nuwer
http://www.nuwermj.potsdam.edu/dLearn/
http://www.nuwermj.potsdam.edu/dSamples/
Michael Nuwer [dBVIPS]

2005-04-12, 7:23 am



Thanks Claus.

Claus Mygind wrote:
> Mike
>
> Thanks for the update. I had not reviewed your webReport.cc, so I was not
> sure where Dan came up with his coding. I just read through your module and
> it looks great. It all makes sense now. Too bad you did not write this
> module before I got so deep into writing my own reports. You sure make it
> easy.
>
> Claus
>
>



--
Michael Nuwer
http://www.nuwermj.potsdam.edu/dLearn/
http://www.nuwermj.potsdam.edu/dSamples/
Dan Anderson

2005-04-12, 7:23 am

Michael, these are GREAT suggestion. I am going to try the simplest first.
I'm probably not as concerned with security as I should be. I know there
are weasels willing to hack anything, though. When this is up and running
it be in a SSL. Thanks again.

--
Dan Anderson
UBI Processing Dept.
andersond@ubinc.com
800-444-4824 ext 101
"Michael Nuwer [dBVIPS]" <nuwermj@nospam.please.yahoo.com> wrote in message
news:GDymWI1PFHA.1808@news-server...
>
> Hi Dan,
>
> Yes the live web site was useful. There are a few ways to handle this
> issue.
>
> The easiest solution is to use the following for the "continue" link:
>
> http://www.ubiquote.com/cgi-bin/app...serID=bluedress
>
> You can construct this string in program file
>
> oCGI.homePage = ;
> "http://www.ubiquote.com/cgi-bin/appsignin.exe?REC=" + ;
> oCGI["REC"] + "&UserID=" + oCGI["UserID"]
>
> This is done in your "status.prg" program. Also you will need add a hidden
> field in the appsingin.exe response page:
>
> <input type="hidden" name="Agent" value="Havana Testers Insurance">
> <input type="hidden" name="REC" value="POTUS01">
>
> Add hidden field for name="UserID"
>
> <input type="submit" value="Check Status" name="B2" style="font-weight:
> bold"></td>
>
> This should work, but you will note that the user's REC and UserID values
> are visible in the browser. There are a few ways around this.
>
> One would be to use a replacement for the UserID, like "UserID=Y" Then
> your program can check for oCGI['UserID'] == "Y" and act accordingly. This
> option is not all that secure, however. A user can get around your login
> page if they know what to do.
>
> A second option would be for the "Continue" link to call a JavaScript
> function. That function would send a "POST" request (which does not revel
> the name/value pairs). Let me know if you what to try this option and I'll
> try to put together some code.
>
> Perhaps the most common solution to this problem is to use a "Cookie".
> When a user successfully logs in, the appsignin's response page (the one
> with three buttons) would set this cookie and the cookie would contain the
> REC and UserID names and values. Then you would need to modify the
> appsignin program so that it a) checks for a cookie b) if it exists use
> REC and UserID from the cookie to do your lookup c) if the cookie does not
> exist use the oCGI array values.
>
>
>
> Dan Anderson wrote:
>
>
> --
> Michael Nuwer
> http://www.nuwermj.potsdam.edu/dLearn/
> http://www.nuwermj.potsdam.edu/dSamples/



Dan Anderson

2005-04-12, 11:24 am

Yes that worked nicely. So, I'll move on to the next dragon. Thanks for
all your help.

--
Dan Anderson
UBI Processing Dept.
andersond@ubinc.com
800-444-4824 ext 101
"Michael Nuwer [dBVIPS]" <nuwermj@nospam.please.yahoo.com> wrote in message
news:GDymWI1PFHA.1808@news-server...
>
> Hi Dan,
>
> Yes the live web site was useful. There are a few ways to handle this
> issue.
>
> The easiest solution is to use the following for the "continue" link:
>
> http://www.ubiquote.com/cgi-bin/app...serID=bluedress
>
> You can construct this string in program file
>
> oCGI.homePage = ;
> "http://www.ubiquote.com/cgi-bin/appsignin.exe?REC=" + ;
> oCGI["REC"] + "&UserID=" + oCGI["UserID"]
>
> This is done in your "status.prg" program. Also you will need add a hidden
> field in the appsingin.exe response page:
>
> <input type="hidden" name="Agent" value="Havana Testers Insurance">
> <input type="hidden" name="REC" value="POTUS01">
>
> Add hidden field for name="UserID"
>
> <input type="submit" value="Check Status" name="B2" style="font-weight:
> bold"></td>
>
> This should work, but you will note that the user's REC and UserID values
> are visible in the browser. There are a few ways around this.
>
> One would be to use a replacement for the UserID, like "UserID=Y" Then
> your program can check for oCGI['UserID'] == "Y" and act accordingly. This
> option is not all that secure, however. A user can get around your login
> page if they know what to do.
>
> A second option would be for the "Continue" link to call a JavaScript
> function. That function would send a "POST" request (which does not revel
> the name/value pairs). Let me know if you what to try this option and I'll
> try to put together some code.
>
> Perhaps the most common solution to this problem is to use a "Cookie".
> When a user successfully logs in, the appsignin's response page (the one
> with three buttons) would set this cookie and the cookie would contain the
> REC and UserID names and values. Then you would need to modify the
> appsignin program so that it a) checks for a cookie b) if it exists use
> REC and UserID from the cookie to do your lookup c) if the cookie does not
> exist use the oCGI array values.
>
>
>
> Dan Anderson wrote:
>
>
> --
> Michael Nuwer
> http://www.nuwermj.potsdam.edu/dLearn/
> http://www.nuwermj.potsdam.edu/dSamples/



Michael Nuwer [dBVIPS]

2005-04-13, 7:23 am

Dan Anderson wrote:
> Yes that worked nicely. So, I'll move on to the next dragon. Thanks for
> all your help.
>


Thanks for the success report.

--
Michael Nuwer
http://www.nuwermj.potsdam.edu/dLearn/
http://www.nuwermj.potsdam.edu/dSamples/
Michael Nuwer [dBVIPS]

2005-04-15, 9:23 am

Dan Anderson wrote:
> Okay, new dragon -- and I think we're pretty close on this one. I want to
> turn this report into a drilldown report. Per your paper "Creating Reports
> for the web" I added the following lines to the code you sent me:
>
> oCGI.drillDown = true
> oCGI.DrillDownCommand= "Jumpit.exe"
> oCGI.DrillDownField = "QuoteNum"
>
> This code works fine. The problem is how the program "jumpit.exe" deals
> with the incoming data. Since the calling programs generates a
> "jumpit.exe2005415492" line when I select "2005415492" I figured the
> jumpit.exe program should have an incoming "parameters" command. So here's
> the code for "jumpit.exe":


Nope, something is wrong. The Status prg should be streaming

"jumpit.exe?QuoteNum=2005415492"

I've got to go to class, but I'll check back in a few hours to follow-up.

Dan Anderson

2005-04-15, 9:23 am

Thanks. I actually get to go home right now. So I won't be able to read
your response until Monday.

--
Dan Anderson
UBI Processing Dept.
andersond@ubinc.com
800-444-4824 ext 101
"Michael Nuwer [dBVIPS]" <nuwermj@no.spam.yahoo.com> wrote in message
news:zgfp$OcQFHA.900@news-server...
> Dan Anderson wrote:
>
> Nope, something is wrong. The Status prg should be streaming
>
> "jumpit.exe?QuoteNum=2005415492"
>
> I've got to go to class, but I'll check back in a few hours to follow-up.
>



Michael Nuwer [dBVIPS]

2005-04-15, 11:23 am

Michael Nuwer [dBVIPS] wrote:
> Dan Anderson wrote:
>
>
>
> Nope, something is wrong. The Status prg should be streaming
>
> "jumpit.exe?QuoteNum=2005415492"
>



My fault. Its a bug in my CC.

Open WebReports.cc in a text editor. Find Line 335, change that line to
this:

cTDAnchorOpen = [<A HREF="] + this.DrillDownCommand ;
+ "?" + cDrillDownField + "=" + cIDValue + [">]
Dan Anderson

2005-04-18, 7:23 am

Okay, that took care of what was streaming. It is now streaming
"jumpit.exe?QuoteNum=2005415492." But now I'm having problems with the
character type on my "PARAMETERS" value. All the fields in Quotes.dbf are
character. So, naturally I would want my search value to be character. But
the following code generates a data type mismatch on the line "IF NOT
qQuote1.rowset.findKey(cQuoteNum)" saying "expecting" with no explanation of
what it is expecting. And if I change convert cQuoteNum to a string it
generates another data type mismatch error saying expecting numeric.

Am I supposed to using a PARAMETERS command? And if so, how do I let the
program know the value is supposed to be a character? I guess the real
question is what do I need to do to get it to look up the data and generate
the webpage I have indicated at the bottom?

_app.errorAction = 3
PARAMETERS cQuoteNum

set proc to WebClassEx.cc additive
set proc to Dollarz.prg additive
oCGI = new CGISessionEx()
oCGI.Connect()

d= new database()
d.databaseName = "dUBI"
d.active = true

qQuote1 = new query()
qQuote1.database := d
qQuote1.sql = 'select * from "quotes.dbf"'
qQuote1.active := true

qQuote1.rowset.fields["BaseState"].lookupsql = 'SELECT code, state FROM
"States.dbf" ORDER BY code'
qQuote1.rowset.indexName := "quotenum"

// -- move pointer to proper row
IF NOT qQuote1.rowset.findKey(cQuoteNum)
oCGI.SorryPage("Quote could not be located in database.")
ENDIF

// -- save data from cargo app or physdam app
oCGI. loadFieldsFromArray(
qQuote1.rowset.fields, false)

// -----------------------------------------


for i=1 to qQuote1.rowset.fields.size
cFieldName = qQuote1.rowset.fields[i].fieldname
oCGI[cFieldName]=""
next

// populate array with fields from query
oCGI. LoadArrayFromFields(
qQuote1.rowset.fields)

oCGI["QuoteNum"] = Quotenum
oCGI["TotalValue"] = DOLLARZ(oCGI["TotalValue"])
oCGI["PDPriorLoss0"] = DOLLARZ(oCGI["PDPriorLoss0"])
oCGI["PDPriorLoss1"] = DOLLARZ(oCGI["PDPriorLoss1"])
oCGI["PDPriorLoss2"] = DOLLARZ(oCGI["PDPriorLoss2"])
oCGI["CGPriorLoss0"] = DOLLARZ(oCGI["CGPriorLoss0"])
oCGI["CGPriorLoss1"] = DOLLARZ(oCGI["CGPriorLoss1"])
oCGI["CGPriorLoss2"] = DOLLARZ(oCGI["CGPriorLoss2"])
oCGI["ReceiptsThis"] = DOLLARZ(oCGI["ReceiptsThis"])
oCGI["ReceiptsNext"] = DOLLARZ(oCGI["ReceiptsNext"])
oCGI["AvgLoadValue"] = DOLLARZ(oCGI["AvgLoadValue"])
oCGI["ReeferDeduct"] = DOLLARZ(oCGI["ReeferDeduct"])

IF oCGI["PD"] = "Y"
oCGI["PD"] = "Yes"
ELSE
oCGI["PD"] = "No"
ENDIF

IF oCGI["NT"] = "Y"
oCGI["NT"] = "Yes"
ELSE
oCGI["NT"] = "No"
ENDIF

IF oCGI["CG"] = "Y"
oCGI["CG"] = "Yes"
ELSE
oCGI["CG"] = "No"
ENDIF


cHTMLFile = '../Monthly/summary.htm'
oCGI. DisplayHTML(NULL,cHT
MLFile)

oCGI = null
RELEASE ALL

QUIT

--
Dan Anderson
UBI Processing Dept.
andersond@ubinc.com
800-444-4824 ext 101
"Michael Nuwer [dBVIPS]" <nuwermj@no.spam.yahoo.com> wrote in message
news:lDgBV4cQFHA.320@news-server...
> Michael Nuwer [dBVIPS] wrote:
>
>
> My fault. Its a bug in my CC.
>
> Open WebReports.cc in a text editor. Find Line 335, change that line to
> this:
>
> cTDAnchorOpen = [<A HREF="] + this.DrillDownCommand ;
> + "?" + cDrillDownField + "=" + cIDValue + [">]



Michael Nuwer [dBVIPS]

2005-04-18, 1:23 pm

Dan Anderson wrote:
>
> Am I supposed to using a PARAMETERS command? And if so, how do I let the
> program know the value is supposed to be a character? I guess the real
> question is what do I need to do to get it to look up the data and generate
> the webpage I have indicated at the bottom?


You should not be using the Parameters value. In this case that value
is: "QuoteNum=2005415492" You what:

cQuoteNum = oCGI['QuoteNum']

I'm not sure why you are getting the data mismatch message. Are both
fields in the State.dbf table characters?


>
> _app.errorAction = 3
> PARAMETERS cQuoteNum
>
> set proc to WebClassEx.cc additive
> set proc to Dollarz.prg additive
> oCGI = new CGISessionEx()
> oCGI.Connect()
>
> d= new database()
> d.databaseName = "dUBI"
> d.active = true
>
> qQuote1 = new query()
> qQuote1.database := d
> qQuote1.sql = 'select * from "quotes.dbf"'
> qQuote1.active := true


cQuoteNum = oCGI['QuoteNum']

>
> qQuote1.rowset.fields["BaseState"].lookupsql = 'SELECT code, state FROM
> "States.dbf" ORDER BY code'
> qQuote1.rowset.indexName := "quotenum"
>
> // -- move pointer to proper row
> IF NOT qQuote1.rowset.findKey(cQuoteNum)
> oCGI.SorryPage("Quote could not be located in database.")
> ENDIF
>

Dan Anderson

2005-04-19, 3:23 am

Michael,
As always you've hit another home run. I had to clean up some other
items farther down the program but that did the trick. After you show me
these solutions they make perfect sense. But for some reason I just don't
make the connection until then. I have another place or two in the program
where I will need this same sort of thing; and, I have no doubt I will be
able to figure it out. Because, like I said, now it makes sense.

Thanks,
Dan


--
Dan Anderson
UBI Processing Dept.
andersond@ubinc.com
800-444-4824 ext 101
"Michael Nuwer [dBVIPS]" <nuwermj@no.spam.yahoo.com> wrote in message
news:4XsSbbDRFHA.432@news-server...[color=darkred]
> Dan Anderson wrote:
>
> You should not be using the Parameters value. In this case that value is:
> "QuoteNum=2005415492" You what:
>
> cQuoteNum = oCGI['QuoteNum']
>
> I'm not sure why you are getting the data mismatch message. Are both
> fields in the State.dbf table characters?
>
>
>
> cQuoteNum = oCGI['QuoteNum']
>


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