473,765 Members | 1,956 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

how to calculate data at run time in crystal report 10

284 Contributor
how can we calculate data at run time in crystal report 10
i had made three fields in my database name
debit,credit , balance
debit and credit shows data directly from database now i want
a third field balance which is not stored in database and it has
to show the debit -credit values in report after each recodd
like
de cr balance
10 0 10
0 10 0
20 0 20
how can i do this.

second i also want previous balacne at the top which is the
sum of all the debit-sum of all the credit before that date
i know the query about this but how can i show it only one at
the beginnig of the report and add that value in first record in
the balance field

thanks in advance
Oct 22 '07 #1
8 4488
debasisdas
8,127 Recognized Expert Expert
Try to add a SQL Expression field to the report. That can easily solve your problem.
Nov 4 '07 #2
QVeen72
1,445 Recognized Expert Top Contributor
Hi,

In CR Designer, Add a Formula say MyBal:

Expand|Select|Wrap|Line Numbers
  1. {MyTableName.Debit}-{MyTableName.Credit}
  2.  
And then Place it in the Detail Section of the Report , hide this formula and Add a Running Total for this Formula..

Regards
Veena
Nov 4 '07 #3
muddasirmunir
284 Contributor
this code only add or subtract the debit and credit field at the
current line ok
now i also want to add in it the balance of the previous line
of the report
how cant i take the value of the previous line just above any line
of recorset .
if you can explain i will be thank ful



Hi,

In CR Designer, Add a Formula say MyBal:

Expand|Select|Wrap|Line Numbers
  1. {MyTableName.Debit}-{MyTableName.Credit}
  2.  
And then Place it in the Detail Section of the Report , hide this formula and Add a Running Total for this Formula..

Regards
Veena
Nov 4 '07 #4
muddasirmunir
284 Contributor
thanks Veena,
for solving my problem.
Nov 4 '07 #5
muddasirmunir
284 Contributor
hi all

now i am facing anothe problem in it , as long as balance is concrned
running field sovle my proble now what i want to add a spcific number
it may be 0 or from query sum(debit)-sum(credit) to the firslt
record of the runnig total
Nov 5 '07 #6
QVeen72
1,445 Recognized Expert Top Contributor
Hi,

Write another Formula say :

Expand|Select|Wrap|Line Numbers
  1. If RecordNumber =1 Then
  2.   200
  3. Else
  4. 'Your old Formula
  5.  
Regards
Veena
Nov 6 '07 #7
muddasirmunir
284 Contributor
now , there is another porblem i am facing
i made a formulal field and give theme a code
Expand|Select|Wrap|Line Numbers
  1. (slaes.credit)-(sales.debit) +200
and then made a runnnig total of formula field
its work fine

but i know want not to add 200 to it but want to add the resulte
of the following querey

"select sum(credit) - sum( debit) where date < userinput"
or
the number which is is any form for this i use the following formula

(slaes.credit)-(sales.debit) + form1.text1.tex t
but its shows an error

i want answer of how inseted of 200 we give number given by the query
and
how to add number which is in form1.text1.tex t
how to solve this
thanks






Hi,

Write another Formula say :

Expand|Select|Wrap|Line Numbers
  1. If RecordNumber =1 Then
  2. 200
  3. Else
  4. 'Your old Formula
  5.  
Regards
Veena
Nov 8 '07 #8
QVeen72
1,445 Recognized Expert Top Contributor
Hi,

Create One more formula say F_OpBal
Initially assign Zero to this formula.
and pass the Textbox value From VB6..

and in CR, use this :

Expand|Select|Wrap|Line Numbers
  1. (slaes.credit)-(sales.debit) + {@F_OpBal}
  2.  
Regards
Veena
Nov 13 '07 #9

Sign in to post your reply or Sign up for a free account.

Similar topics

1
3522
by: Manal/report designer | last post by:
Thank you in advance for any suggestions... I'm using crystal reports version 8 & SQL server. I've created a report that is composed of 2 parts: 1st part contains the main report which uses database1 (db1) located on server1(S1), 2nd part contains the subreport which uses database2 (db2) located on server2 (S2), and I've used (parameter field & a certain fields) to link the subreport to the main report. The subreport is composed of 2...
3
6749
by: Thad | last post by:
I'm new to C# and I was trying to create a Crystal Report. I've designed a simple report and I've used several methods for attaching fields to the report at design time. I've used a DataSet that I've created by add new item, and I've used the add command and used an actual SQL statement, and I've used the OLEDB ADO and connected to my database (Access) tables directly. I have code that will create a query, use that query with an Adapter...
3
5245
by: Diggler | last post by:
I was working on a report that is populated with three different tables in a strongly-typed dataset. The tables are populated from custom objects rather than directly from SQL Server. I loop through the objects and add the rows one at a time. I then push the dataset to the Crystal Report. The report worked fine, until this morning. I added another field or two to the dataset, and rearranged the report fields to organize the report...
6
5187
by: Ray | last post by:
Hi all, While I use the ReportDocument of vb.net to set filter to the data to the Crystal Report, it is successful for the first time while running the program. However, for the second time while running the program, when I set filter to other set of data, all the data is lost. Please help. Thanks a lot, Ray
0
1384
by: Ray | last post by:
Dear Bernie, Yes, if the same pfieldname is used. The same data will be filtered. But I only use the code shown you before. I have not used any dataset or datatable. How to fix the problem? Thanks a lot, Ray "Bernie Yaeger" <berniey@cherwellinc.com> ¦b¶l¥ó news:egBcd1QuEHA.3188@TK2MSFTNGP15.phx.gbl ¤¤¼¶¼g... > Hi Ray, >
3
3049
by: Tyranno.Lex | last post by:
I am using Visual Studio .NET 2003 and have successfully deployed a commercial web application written in C# and ASP.NET. I am now wanting to add reporting using Crystal Reports and am having a devil of a time doing this. The problem is that my application uses an encapsulated data tier for accessing the database vs. accessing it directly via the client tier. However, EVERY example that I have ever seen for creating a Crystal Report at...
1
9435
by: sandeepjakhotya | last post by:
Hello All Enyone knows how to change DB Location for the Crystal Report in VB 6. I have created a application in vb 6 and report in crystal report 9.0 The report created is then added to vb programme itself using Add-ins manager into the designers section. Now My programme select for the DB as per user choice at run time and accordingly changes the data enviroment's connection Location but I am anable to change the same with Report At...
11
9694
by: =?Utf-8?B?cmtibmFpcg==?= | last post by:
How can I stop receiving this message while calling a crystal report? "The report you requested requires further information." Thanks
8
3086
by: Brock | last post by:
I am trying to populate a Crystal Report from data in my DataGrid. The reason for this is that I want the user to be able to change values without updating the database, but still have their report reflect the values they anticipate committing to see hypothetical totals of columns from a set of records. These records are displaying properly on my DataGrid but I'm not sure how to get Crystal Reports 10 to use as its datasource the dataset...
0
9568
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10163
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9957
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8832
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7379
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6649
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5276
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
3532
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2806
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.