Author |
Message |
accibitinga
Newbie
Joined: 10 Jan 2008
Location: Brazil
Online Status: Offline
Posts: 5
|
Topic: Modify SqlExpression fields Posted: 10 Jan 2008 at 3:26am |
How modify Text property of sqlExpressionFields in CReport 2005/2008 + C# Error: read-only. Thanks all! Antonio / Brasil
Edited by accibitinga - 10 Jan 2008 at 3:26am
|
IP Logged |
|
BrianBischof
Admin Group
Joined: 09 Nov 2006
Online Status: Offline
Posts: 2458
|
Posted: 10 Jan 2008 at 11:17am |
You can't modify the SQL Expressions with .NET.
|
Please support the forum! Tell others by linking to it on your blog or website:<a href="http://www.crystalreportsbook.com/forum/">Crystal Reports Forum</a>
|
IP Logged |
|
accibitinga
Newbie
Joined: 10 Jan 2008
Location: Brazil
Online Status: Offline
Posts: 5
|
Posted: 11 Jan 2008 at 5:00am |
I need past a new date value for the field sqlExpression to sum values.
in the VB it functioned perfectly, see:
Public Report As New CRAXDRT.Report
Report.SQLExpressionFields(1).Text = (SELECT Sum(`Quantidade`) AS sdoPrevious FROM `Moviment` WHERE (`Moviment`.`Date`<=#1/1/1900#)
Please, it helps me!!! it knows as I can make this in c #?
thanks!! Antonio
Edited by accibitinga - 11 Jan 2008 at 5:01am
|
IP Logged |
|
jkwrpc
Senior Member
Joined: 19 Jun 2007
Location: United States
Online Status: Offline
Posts: 432
|
Posted: 16 Jan 2008 at 12:04pm |
You may be able to move your SQL statement from a SQL Expression field to a Command Object. Then you could pass a parameter(s) to the SQL statement in the command object to make it do what you want.
Regards,
John W.
|
IP Logged |
|
accibitinga
Newbie
Joined: 10 Jan 2008
Location: Brazil
Online Status: Offline
Posts: 5
|
Posted: 17 Jan 2008 at 1:45am |
Thanks, friend...
I thought about this, but the field must move dynamic in function of the listed values in Details Section.
I used library CRAXDRT for CR9 and VB6, but he must have a way to make in c#!!!
I have a SubReport that it shows given of each listed item, capture the previous value of each listed element and add to the current.
Edited by accibitinga - 17 Jan 2008 at 1:55am
|
IP Logged |
|
Lugh
Senior Member
Joined: 14 Nov 2007
Online Status: Offline
Posts: 377
|
Posted: 17 Jan 2008 at 5:03am |
Er, not to possibly be dense here, but why are you doing this with a SQL Expression to being with? First, this is a classic running total. You should be able to do this with just a running total field. If it's too complex for that, you could probably do something using the Previous() function, to get the value of the previous record. If it's too complex for that, you could probably make do with a global (or shared, if it needs to go from subreport to subreport) variable, that stores the value of the record, manipulates it to generate the new value you want, and then stores the current value to use for the next record.
In short, I think you've ended up making things harder on yourself than they need to be.
|
IP Logged |
|
accibitinga
Newbie
Joined: 10 Jan 2008
Location: Brazil
Online Status: Offline
Posts: 5
|
Posted: 17 Jan 2008 at 10:40am |
Excuse me, but still I did not obtain resulted necessary. The values of totalized sqlExpressionFiellds field will not be listed.
The sum will be obtained in a previous interval of dates to that it will be listed in report.
I do not know way simpler to make this. Please... see my code:
|
IP Logged |
|
|