Problem with Form Dialogs

Stimulsoft Reports.NET discussion
Andre2
Posts: 47
Joined: Thu Jan 24, 2008 12:30 am
Location: Australia

Problem with Form Dialogs

Post by Andre2 »

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
Vital
Posts: 1278
Joined: Fri Jun 09, 2006 4:04 am

Problem with Form Dialogs

Post by Vital »

Hello Andrea,

Please run Demo application. In category "SQL" check report "Parameters from Dialog Form".

Thank you.
Andre2
Posts: 47
Joined: Thu Jan 24, 2008 12:30 am
Location: Australia

Problem with Form Dialogs

Post by Andre2 »

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
Andre2
Posts: 47
Joined: Thu Jan 24, 2008 12:30 am
Location: Australia

Problem with Form Dialogs

Post by Andre2 »

Nope fed up trying to make it work...
Think you need to do some more work here:pffft:
Vital
Posts: 1278
Joined: Fri Jun 09, 2006 4:04 am

Problem with Form Dialogs

Post by Vital »

Hello Andre,
Andre wrote:Nope fed up trying to make it work...
Think you need to do some more work here:pffft:
Please try use comboBox1.SelectedItem.

Thank you.
Andre2
Posts: 47
Joined: Thu Jan 24, 2008 12:30 am
Location: Australia

Problem with Form Dialogs

Post by Andre2 »

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
Andre2
Posts: 47
Joined: Thu Jan 24, 2008 12:30 am
Location: Australia

Problem with Form Dialogs

Post by Andre2 »

PS and that with the latest version :-)
Brendan
Posts: 309
Joined: Sun Jul 16, 2006 12:42 pm
Location: Ireland

Problem with Form Dialogs

Post by Brendan »

How is the Combobox populated? With hardcoded data or some some binding source?

You can also try

Code: Select all

combobox1.Control.Text
To retreive the text from the control item itself
Edward
Posts: 2913
Joined: Fri Jun 09, 2006 4:02 am

Problem with Form Dialogs

Post by Edward »

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.


Attachments
53.ComboboxExample.mrt
(13.82 KiB) Downloaded 189 times
Andre2
Posts: 47
Joined: Thu Jan 24, 2008 12:30 am
Location: Australia

Problem with Form Dialogs

Post by Andre2 »

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
Post Reply