CodeCharge Studio
search Register Login  

Web Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> Archive -> GotoCode Archive

 Listbox and code expression

Print topic Send  topic

Author Message
lneisius
Posted: 11/26/2003, 7:11 AM

I'm trying use a listbox to show the current year and plus five to minus five years from the current year. I thought that I could use code expression as the datasource and accomplish this. Anyone have any ideas?
Rick
Posted: 11/28/2003, 10:19 AM

lneisius,

I was trying something similar and was not able to figure out how to do it with code expression.

I was able to do it with code using the help example as a starting point:
Search help for 'Dynamically Modify the "List Of Values" of a ListBox'
ASP Code Help Example:
Set Tasks.Status.DataSource = CCCreateDataSource(dsListOfValues, Empty, _
Array(Array("1","2","3"),Array("High","Normal","Low")))

To get a Listbox with consecutive dates I used ASP code (I also need to do this in PHP code in another project so will try that later):

Set employees.emp_name.DataSource = CCCreateDataSource(dsListOfValues, Empty, _
Array(Array(date(),(date()+1),(date()+2),(date()+3)),Array( WeekdayName(weekday(date)) & ", " & date(),WeekdayName(weekday( (date()+1) )) & ", " & (date()+1), WeekdayName(weekday( (date()+2) )) & ", " & (date()+2) , WeekdayName(weekday( (date()+3) )) & ", " & (date()+3) )))

This created a list with value (value placed in db) of 11/28/2003, etc and screen display values of Friday, 11/28/2003, etc.

Note: Data source type for listbox field must be 'List of Values'. I also found out (the hard way) you must specify a starting Data Source value pair to start out with even though it will be replaced by the Record Before Show Code. If you do not have a starting value you get an error message when you generate page - I at first abandoned my attempt to do it this way until I thought hours later that a starting pair value may be required.

Hope this helps.

Rick
mentecky
Posted: 11/28/2003, 10:43 AM

What language are you using?

Rick
lneisius
Posted: 11/29/2003, 7:36 AM

I to found out that you can replace the values with additional code. I believe CCS should work with this List of values as the original datasource when you choose code expression for the datasource. The only problem with the code generated is the quotation marks. Must be a bug! I've reported it and will wait to see what support says.

   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

PHP Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.