Print Page | Close Window

Modify SqlExpression fields

Printed From: Crystal Reports Book
Category: Crystal Reports for Visual Studio 2005 and Newer
Forum Name: Data Connectivity
Forum Discription: How to connect to data sources and export reports
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=2027
Printed Date: 29 Apr 2024 at 1:43am


Topic: Modify SqlExpression fields
Posted By: accibitinga
Subject: Modify SqlExpression fields
Date 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



Replies:
Posted By: BrianBischof
Date 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>


Posted By: accibitinga
Date 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




Posted By: jkwrpc
Date 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.
http://www.CustomReportWriters.net - www.CustomReportWriters.net
 


Posted By: accibitinga
Date 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.
 


Posted By: Lugh
Date 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.




Posted By: accibitinga
Date 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:
http://rapidshare.com/files/84568691/F_brica_2008.rar.html - http://rapidshare.com/files/84568691/F_brica_2008.rar.html
 



Print Page | Close Window