Data Connectivity
 Crystal Reports Forum : Crystal Reports for Visual Studio 2005 and Newer : Data Connectivity
Message Icon Topic: Modify SqlExpression fields Post Reply Post New Topic
Author Message
accibitinga
Newbie
Newbie


Joined: 10 Jan 2008
Location: Brazil
Online Status: Offline
Posts: 5
Quote accibitinga Replybullet 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 IP Logged
BrianBischof
Admin Group
Admin Group
Avatar

Joined: 09 Nov 2006
Online Status: Offline
Posts: 2458
Quote BrianBischof Replybullet 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 IP Logged
accibitinga
Newbie
Newbie


Joined: 10 Jan 2008
Location: Brazil
Online Status: Offline
Posts: 5
Quote accibitinga Replybullet 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 IP Logged
jkwrpc
Senior Member
Senior Member


Joined: 19 Jun 2007
Location: United States
Online Status: Offline
Posts: 432
Quote jkwrpc Replybullet 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 IP Logged
accibitinga
Newbie
Newbie


Joined: 10 Jan 2008
Location: Brazil
Online Status: Offline
Posts: 5
Quote accibitinga Replybullet 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 IP Logged
Lugh
Senior Member
Senior Member
Avatar

Joined: 14 Nov 2007
Online Status: Offline
Posts: 377
Quote Lugh Replybullet 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 IP Logged
accibitinga
Newbie
Newbie


Joined: 10 Jan 2008
Location: Brazil
Online Status: Offline
Posts: 5
Quote accibitinga Replybullet 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 IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.035 seconds.