Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Placing a formula field on to Crystal Report from .aspx page

Posted on 2006-10-26
4
Medium Priority
?
277 Views
Last Modified: 2008-02-01
Hi All,
I am using Visual Stuido 2005 and Crystal Reports.NET
Can I place a formula field on to the report from code-behind(.aspx) page

Thanks,
Prasad.
0
Comment
Question by:balabommala
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 101

Expert Comment

by:mlmcc
ID: 17815568
I believe it is possible.  But it may require all your users to have runtime licenses for Crystal which, last I checked, cost $199 per user.

A way that should work with out requiring the license is to put the formula on the report during design then changing the formula from the code.

From VB it is done liek this

                For k = 1 To crRpt.FormulaFields.Count
                    If (UCase$(crRpt.FormulaFields(k).Name) = "YOURFORMULA")  Then
                        crRpt.FormulaFields(k).Text = "Your Formula in a string"
                    End If
                Next k

mlmcc
0
 
LVL 42

Expert Comment

by:frodoman
ID: 17816342
Prasad,

I believe you can do it and it doesn't require a runtime license (you get distribution rights for the OEM version as part of Visual Studio).  mlmcc is correct though that you're going to be *far* better off simply placing the formula on your report, even if it's completely blank, and modifying the formula contents at runtime.  If this works for you, I have a sample of the .net code I can give you but you'll need to let me know if you're writing a Windows app or a Web app because as I recall the code is slightly different.

frodoman
0
 

Author Comment

by:balabommala
ID: 17836672
Hi
Sorry for my late reply.
I am writing a web application.

Thanks
0
 
LVL 42

Accepted Solution

by:
frodoman earned 500 total points
ID: 17836749
Piece of cake to modify a formula:

  MyReportDocument.DataDefinition.FormulaFields("YourFormulaName").Text = "{field1} * {field2}"

You'll need to write th formula w/in the quotes just like you would in the Crystal editor, so enclose strings in single quotes, etc.  

frodoman
0

Featured Post

[Webinar] Lessons on Recovering from Petya

Skyport is working hard to help customers recover from recent attacks, like the Petya worm. This work has brought to light some important lessons. New malware attacks like this can take down your entire environment. Learn from others mistakes on how to prevent Petya like worms.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Hot fix for .Net Crystal Reports 10.2.3600.0 to fix problems with sub reports running on 64 bit operating systems ISSUE: Reports which contain subreports fail with error "Missing Parameter Value" DEPLOYMENT SERVER OS: Windows 2008 with 64 bi…
Hello everyone, Hope you find this as helpful as we did. We have on the company I work for an application built in Delphi V with Crystal Reports 8. We all know that Crystal & Delphi can be temperamental sometimes and the worst thing is, nearly…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …

610 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question