-
DataReport
I have a form (F) with text box T. Also Created 1 DataEnvironment and DataReport. (connection with DB is tested OK)
DataEnvironment is created using Query statement.
When new command is created using SQL statement we can not add parameters.
Question 1: How to Dyanamically change the condition (commandText) ?
2: How to Pass values from Form to Report. (parameters)
Please advice
Thanks
-
Re: DataReport
In the dataenviorment you need to make a SQL statement, and the parameters that you need to change put in '?', for example i need the records between 2 dates, in the dataenviorment in the SQL statement I write the follow "SELECT fecha, litrosreacom, precio, importereapag FROM SarabiaAsf WHERE litrosreacom <> 0 and fecha BETWEEN ? and ?" and in the form the next code
If DataEnvironment1.rsCommand1.State = adStateOpen Then
DataEnvironment1.rsCommand1.Close
End If
DataEnvironment1.Command1 Format(CDate(DTPicker1.Value), "dd/MM/yyyy"), Format(CDate(DTPicker2.Value), "dd/MM/yyyy")
DataReport1.Show
i hope that this would be helpful
-
Re: DataReport
Thank You, Great Help !!!
It did Work, Now I have another small Question
How to pass Values to DataReport.
I have a form with UserName and Today(Date) as text box. 1 push button. on click event I am calling DataReport. On DataReport I have 1 text box rUserName. How to assign Form.Username.text to rUserName ?
Please Advice
Thanks