Print Page | Close Window

Creating formula through VB.Net

Printed From: Crystal Reports Book
Category: Crystal Reports for Visual Studio 2005 and Newer
Forum Name: Writing Code
Forum Discription: .NET programming API, report integration
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=17130
Printed Date: 19 May 2024 at 9:36pm


Topic: Creating formula through VB.Net
Posted By: KarthickBabu
Subject: Creating formula through VB.Net
Date Posted: 26 Jul 2012 at 5:39am
Thanks to all.

Is it possible to add new formula field in CR through vb.net code?

-------------
Regards,
KarthickBabu



Replies:
Posted By: hilfy
Date Posted: 26 Jul 2012 at 8:01am
Yes and no - it can be done through the ReportAppServer SDK which I believe is only available when you have Crystal Server or BusinessObjects installed.  What are you trying to do?
 
-Dell
 
p.s. I moved this post to its own thread as it wasn't really a continuation of the thread where you posted.


-------------
Proviti, Data & Analytics Practice
http://www.protiviti.com/US-en/data-management-advanced-analytics - www.protiviti.com/US-en/data-management-advanced-analytics


Posted By: KarthickBabu
Date Posted: 26 Jul 2012 at 7:42pm
Thanks for moving the post into separate thread...

I am trying to do write a piece of code. Add new formula fields to add in multiple reports using code.



-------------
Regards,
KarthickBabu


Posted By: hilfy
Date Posted: 27 Jul 2012 at 2:58am
So, if I understand you correctly, you're trying to update a set of reports by adding new formula fields.  Is this correct?
 
You could look at the ReportAppServer SDK - the documentation is available at help.sap.com.  There may be a way to use it without Crystal Server or BusinessObjects.  I haven't really used it so I'm not sure.
 
Another way to handle this without actually typing the formulas in to every report would be to add them to one report, place the formula on the report, then copy the object and paste it into the reports where you want the formula.  Pasting the formula object automatically creates the formula if it doesn't exist.
 
-Dell


-------------
Proviti, Data & Analytics Practice
http://www.protiviti.com/US-en/data-management-advanced-analytics - www.protiviti.com/US-en/data-management-advanced-analytics


Posted By: KarthickBabu
Date Posted: 27 Jul 2012 at 8:38pm
Yes, your understanding is correct.

Thanks for your suggestion hilfy... I will try this way.


-------------
Regards,
KarthickBabu


Posted By: KarthickBabu
Date Posted: 27 Jul 2012 at 8:53pm

One more doubt, Shall we pass optional formula fields to crystal reports? I am using CR in VS 2008 version.

-------------
Regards,
KarthickBabu


Posted By: hilfy
Date Posted: 29 Jul 2012 at 11:36am
There is no way to "pass" a formula into Crystal - Crystal can't parse and run a formula that's in data or a parameter, formulas have to be defined in the report itself.  However, if you calculated the value of a field as part of the data set you're connecting Crystal to, that would work.
-Dell


-------------
Proviti, Data & Analytics Practice
http://www.protiviti.com/US-en/data-management-advanced-analytics - www.protiviti.com/US-en/data-management-advanced-analytics



Print Page | Close Window