Sql with params
Hi, I have a report with a table only using Sql Editor
Example :
SELECT * FROM ZPRNC WHERE DATAEMISSAO >= '01/01/2004' AND DATAEMISSAO <=
'01/31/2004'
But, I need change this dates in run time on the user click in preview
report.
How Can I do that??
--
Lorival Guerreiro Filho
An?lise e Desenvolvimento - RM Sistemas - Limeira - SP - Brasil
Example :
SELECT * FROM ZPRNC WHERE DATAEMISSAO >= '01/01/2004' AND DATAEMISSAO <=
'01/31/2004'
But, I need change this dates in run time on the user click in preview
report.
How Can I do that??
--
Lorival Guerreiro Filho
An?lise e Desenvolvimento - RM Sistemas - Limeira - SP - Brasil
This discussion has been closed.
Comments
----------------------------------------------------
Tech Tips: Creating AutoSearch parameters via DADE
----------------------------------------------------
1. Access the Data workspace of the Report Designer.
2. Create a DataView using the Query Wizard or Query Designer.
2. A DataView tool window will be displayed in the data workspace.
3. Press the Search button. The Search tab of the Query Designer will be
displayed.
4. Add a search criteria item and select the AutoSearch checkbox. You can
optionally select Mandatory as desired.
5. Close the query designer.
6. Now when you select the Preview tab of the Report Designer. A search
button will appear on the toolbar. This displays the AutoSearch dialog.
7. By calling Report.Print in code, or by selecting print/preview from the
report explorer the AutoSearch dialog will be automatically be displayed.
--
Nard Moseley
Digital Metaphors
http://www.digital-metaphors.com
Best regards,
Nard Moseley
Digital Metaphors
www.digital-metaphors.com
inputing Sql Code.
--
Guerreiro
Okay, now I understand the question. Once the SQL has been manually edited
then you need to extract the TdaSQLObject and update the text. The following
example shows how to do this
http://www.digital-metaphors.com/tips/EditSQLAndSearch.zip
--
Nard Moseley
Digital Metaphors Corporation
http://www.digital-metaphors.com
Best regards,
Nard Moseley
Digital Metaphors
www.digital-metaphors.com
edit a SQL manually, and create criterias???
----------------------------------------------
Tech Tip: Limitations of using TdaSQL.SQLText
----------------------------------------------
The TdaSQL object can contain either an object based description of the SQL
(SelectTables[], SelectFields[], etc.) that it uses to generate SQLText OR
it contain a SQLText string. If you specify the SQLText string then TdaSQL
will not generate any SQLText. Therefore the built-in AutoSearch and Linking
features can no longer be used - because these require that special SQLText
be generated.
If you want to use AutoSearch with a SQLText, you will need to handle this
in your custom dataview code. For an example see RBuilder\Demos\AutoSearch
and see the TdaQueryDataView.CreateAutoSearchFields and
TdaQueryDataView.ReportGetAutoSearchValuesEvent methods in
daQueryDataView.pas.
--
Nard Moseley
Digital Metaphors Corporation
http://www.digital-metaphors.com
Best regards,
Nard Moseley
Digital Metaphors
www.digital-metaphors.com