Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Setting Field Type

Status
Not open for further replies.

LikePork

Programmer
Aug 13, 2004
42
CA
Hello,

I'm creating a report using an ADO.net dataset and the crystal reports bundled with VS .net.

I'm trying to set a field value programmatically for the report as I hear parameters are no good.

myReport.DataDefinition.FormulaFields("DateSent").Text = Date.Today

date.today is just an example, I'd like to be able to put any date into the field. However, I can't set the the formulas data type with code as it is ReadOnly.

myReport.DataDefinition.FormulaFields("DateSent").ValueType is Read Only

So I added a couple formula fields to the report,leaving the code in the formula editor blank. One is of type number and two are of type string. I don't know why though :(, I can't seem to change their type. The number field displays 0.0 and the text field dosen't display anything.

I looked through the fields properties after I placed it on the report, but I can't change it there. I think that's just for dispaly of the formula in that particular instance and dosen't affect the formula itself.

Is there a way to do this, or is this version of CR just too crappy? Thanks
 
Try something like this:

myReport.DataDefinition.FormulaFields.Item("StringFormulaName").Text = "'A String'"

-dave
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top