Problem with Form Dialogs
Problem with Form Dialogs
Hi There
Im trying to use a dialog form on a report but carnt work out how to get the data from the Dialog to some variables I have declared.
The values in the variables are parameters for an SQL query (HTMS)
The form has a combo box which has a list of names and
Two DateTime pickers which allow the user to choose a date range.
I need to be able to "populate" the variables with values from this dialog when the user hit OK
If tried to set the default vale of each variable as a function of the respective controls on the dialog but this doesnt work
Can anyone help?
many Thanks
Andre
Im trying to use a dialog form on a report but carnt work out how to get the data from the Dialog to some variables I have declared.
The values in the variables are parameters for an SQL query (HTMS)
The form has a combo box which has a list of names and
Two DateTime pickers which allow the user to choose a date range.
I need to be able to "populate" the variables with values from this dialog when the user hit OK
If tried to set the default vale of each variable as a function of the respective controls on the dialog but this doesnt work
Can anyone help?
many Thanks
Andre
Problem with Form Dialogs
Hello Andrea,
Please run Demo application. In category "SQL" check report "Parameters from Dialog Form".
Thank you.
Please run Demo application. In category "SQL" check report "Parameters from Dialog Form".
Thank you.
Problem with Form Dialogs
Thanks for that ;-0
Unfortunatly seems to work fine for dates but doesnt want ot know about combo drop down values.
keeps telling me i havent provided a value...then again it wont bring up the dialog form to allow me to.
if I hard code the comboBox1.selectedValue I can get it to work
Thanks
Andre
Unfortunatly seems to work fine for dates but doesnt want ot know about combo drop down values.
keeps telling me i havent provided a value...then again it wont bring up the dialog form to allow me to.
if I hard code the comboBox1.selectedValue I can get it to work
Thanks
Andre
Problem with Form Dialogs
Nope fed up trying to make it work...
Think you need to do some more work here:pffft:
Think you need to do some more work here:pffft:
Problem with Form Dialogs
Hello Andre,
Thank you.
Please try use comboBox1.SelectedItem.Andre wrote:Nope fed up trying to make it work...
Think you need to do some more work here:pffft:
Thank you.
Problem with Form Dialogs
Nope ....That dont work either...Generally I will worry something untill I can get it to work...if not Ill resort to the manual...and if that doesnt help Ill call support.
it only works for combobox1.Text...which is not what I want
it only works for combobox1.Text...which is not what I want
Problem with Form Dialogs
PS and that with the latest version 

Problem with Form Dialogs
How is the Combobox populated? With hardcoded data or some some binding source?
You can also try
To retreive the text from the control item itself
You can also try
Code: Select all
combobox1.Control.Text
Problem with Form Dialogs
Please use the following technique for working with parameters for SQL queries which are taken from the dialog form.
1. In the Designer please set the ConnectOnStart property of DataSources in false.
2. Assign the following properties of the ComboBox component:
Items, if they are predefined or
Items and SelectedItem properties in the DataBinding section of Combobox's properties.
3. ComboBox1.SelectedItem returns current selection of the ComboBox1 component.
After assigning of the parameters to your SqlDataSource you can connect it to the data with the following command:
DataSource.Connect()
or you can Connect all Datasources at a time:
this.Dictionary.Connect()
I hope this information can help to achieve the the result you need.
Also please see the report in the attachment.
Please open this report in the Demo.exe sample application from the standard delivery of Stimulsoft Reports.Net.
Thank you.
1. In the Designer please set the ConnectOnStart property of DataSources in false.
2. Assign the following properties of the ComboBox component:
Items, if they are predefined or
Items and SelectedItem properties in the DataBinding section of Combobox's properties.
3. ComboBox1.SelectedItem returns current selection of the ComboBox1 component.
After assigning of the parameters to your SqlDataSource you can connect it to the data with the following command:
DataSource.Connect()
or you can Connect all Datasources at a time:
this.Dictionary.Connect()
I hope this information can help to achieve the the result you need.
Also please see the report in the attachment.
Please open this report in the Demo.exe sample application from the standard delivery of Stimulsoft Reports.Net.
Thank you.
- Attachments
-
- 53.ComboboxExample.mrt
- (13.82 KiB) Downloaded 188 times
Problem with Form Dialogs
Nope Still does NOT work
The selected item is NOT being read correctly
If the the combo box is filled from a database of names (this Works)
FullName,Code
in databindings:
Items is set to Fullname
SelectedItem is set to Code
using the supplied example
MyVariable = ComboBox.SelectedItem.ToString()
Results in MyVariable = FullName NOT Code as required
The selected item is NOT being read correctly
If the the combo box is filled from a database of names (this Works)
FullName,Code
in databindings:
Items is set to Fullname
SelectedItem is set to Code
using the supplied example
MyVariable = ComboBox.SelectedItem.ToString()
Results in MyVariable = FullName NOT Code as required