AutoSearch issue in WebTier
Hi,
According to the demos about Custom Parameters, I made a new webtier using a
date parameter (like Date between '2001-1-1' and '2003-1-1').
But, when I open my report in the browser, I have to click the Search button
to search twice, then I can get the corrent report. That is, when I search
at the first time, the report is not the corrent one. And if I select Show
all values about this field, the report works fine. What's the possible
reason about this issue?
Thanks in advance.
Michael
According to the demos about Custom Parameters, I made a new webtier using a
date parameter (like Date between '2001-1-1' and '2003-1-1').
But, when I open my report in the browser, I have to click the Search button
to search twice, then I can get the corrent report. That is, when I search
at the first time, the report is not the corrent one. And if I select Show
all values about this field, the report works fine. What's the possible
reason about this issue?
Thanks in advance.
Michael
This discussion has been closed.
Comments
1. Be aware that AutoSearch is supported by the WebTier. The custom
parameters demo shows how to display a custom autosearch form. However, to
display the default autosearch form does not require any custom code.
2. Try running the custom parameters example - it work properly. Compare you
code to the example.
Best regards,
Nard Moseley
Digital Metaphors
www.digital-metaphors.com
I think I've found the problem. It's the format of DateTime field. For
example, if I set the autosearch parameter like Between '8/10/1997' and
'8/11/1997' (their format is dd/mm/yyyy from my system), when I open the
report on the browser at first time, it got the correct format as what I
want, so it works fine. But when I click the Search button on the browser,
it pops up the AutoSearch form with parameters like between '8/10/1997' and
'8/11/1997' (actually their format is mm/dd/yyyy), so I can't get the
correct report. However, if I click the button again, it shows the
parameters like between '10/8/1997' and '11/8/1997'(their format is
mm/dd/yyyy), this time I can get the correct report.
I don't know why every time the parameters change its value. How can I avoid
this problem?
Thanks a lot
Michael
Are you using the same machine to run the report server and the web tier? If
they are running on separate machines, do the two machines have the same
date format in the regional settings?
Try a test with a simple client report application to determine whether that
works correctly.
Best regards,
Nard Moseley
Digital Metaphors
www.digital-metaphors.com
1. I use the same machine to run the report server and the web tier. Even I
change my system date format to 'mm/dd/yyyy', it has the same problem. It
always takes the date format as 'mm/dd/yyyy', but when search again, it
changes the value of the date on AutoSearch form.
However, if I run the report server on the server, no matter what date
format I have, it works fine, even two machines have different data formats.
This time its date format is 'mm/dd/yyyy', I suppose it's from the server.
2. With a simple client report app it works fine. It displays different date
string on AutoSearch form according to system date format in the regional
settings.
Cheers,
Michael
avoid the date format issue. But it does not work. It still shows the
default autosearch dialog. Any trick to do that ?
Cheers,
Michael
I create the AutoSearchField in the code, not create in the dataview.
Cheers,
Michael
For an example of implementing custom autosearch parameter form - see the
following article.
-------------------------------------------------------
Tech Tips: RB Server and Custom Parameters
-------------------------------------------------------
The RBServer Custom Parameter demos show how to define custom session and
report level parameters that can be used to implement security and other
types of custom processing.
The are three projects that work together. Each project includes a
ReadMe.doc and commented code.
1. RBServer\Demos\Servers\Custom Parameters
2. RBServer\Demos\WebTier\Custom Parameters
3. RBServer\Demos\Clients\Custom Parameters
The demos include examples of how to...
1. Define Custom Session parameters.
A custom login form is displayed. Based upon the login, the catalog of
reports available to the user is filtered.
2. Define Custom Report parameters
A custom parameter form is displayed. The parameters are used by the report.
3. Custom AutoSearch form
A custom autosearch form is displayed. The parameter values are used by the
autosearch criteria.
Best regards,
Nard Moseley
Digital Metaphors
www.digital-metaphors.com
I researched this further and I think the issue is related to the JavaScript
that is generated for the search panel. The JavaScript Date.Parse function
is used to parse the string entered by the user. We used it because we
thought it would handle various date formats. In searching Google Groups, a
developer mentioned that the Date.Parse function does not work properly on
date strings entered in dd/mm/yyyy format. If that is correct, then that
would explain why you are having a problem.
Try testing the WebTier by entering the date in mm/dd/yyyy format.
For now a work around would be to use a custom search form as you discussed
elsewhere on this thread.
Best regards,
Nard Moseley
Digital Metaphors
www.digital-metaphors.com
But I still not quite sure why I search again the date "12/05/2006" changes
to "05/12/2006". I suppose that there is some wrong in getting the value of
SearchExpression. It could get the value of "12/05/2006" from somewhere, its
format actually is "MM/DD/YYYY", but the getting value process persumes its
format is "DD/MM/YYYY" (from system or somewhere else), when it is showed in
the AutoSearch Panel, it displays like "05/12/2006". So I think it could be
an inconsistent date format problem or logical problem in somewhere. Can you
help me to find out? Thanks a lot!
Michael
What I mean is about \RBuilder\Demos\5. AutoSearch\4. Custom AutoSearch
Dialog.
Michael