Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Formula Help Post Reply Post New Topic
Author Message
Butterfly_Joe
Newbie
Newbie


Joined: 04 Feb 2009
Online Status: Offline
Posts: 8
Quote Butterfly_Joe Replybullet Topic: Formula Help
     Posted: 10 Jun 2009 at 7:06pm
Hello,

I was hoping someone could help me out with an issue I'm having. As you can see from the image below, I want have a specific GL account's balance to display. That balance for that account only. This is a sub-report, so my anticipation of adding a sub-report into this one to simplify this task, has failed. Granted, I'm new to Crystal Reports, so maybe I'm just missing something in a formula to achieve what I desire, that would be easier than a sub-report.



Any help would be appreciated! Thanks!

-Butterfly_Joe
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 11 Jun 2009 at 6:48am
if the subreport is to only show the balance of an account, and that is in the database, why not display it in the main report?
 
if you only want the balance for one specific account, suppress the field in the report.  right click on the field, format field, general tab.  click the x+1 button by suppress and enter {table.field} <> "account number you want to see"
 
seems way easier than a supreport, and subreport takes resources.
 
Does this help?
IP IP Logged
Butterfly_Joe
Newbie
Newbie


Joined: 04 Feb 2009
Online Status: Offline
Posts: 8
Quote Butterfly_Joe Replybullet Posted: 17 Jun 2009 at 7:40pm
Unfortunately, the main report is not related to the subreport, hence the sub in the first place. I can link related tables in the subreport, but I just cannot figure out how to fix that formula to calculate/display the balance for that specific account only. Granted, I am very new to formulas, so it might be simple as pie. I just cannot think of another way to achieve what I need.

I enjoy your input though, it is greatly appreciated. :)

Thanks!
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 18 Jun 2009 at 6:25am
There should be a link of some sort into the subreport, otherwise how it know which GL to get.  If the GL is fixed and you only want to display it once, then you would select that one GL from the database, or filter it, but usually there is a link from the main report to the subreport so that the subreport can do something that 'adds value' to the main report.
 
I guess I am bit confused.  Another way that others have gotten this type of information, especially if it is just one GL, is to use a command object (database expert, above the tables is Add a Command, and you can type SQL here.  I believe that is it designed to be used to get data for dynamic parameters, others have used as a data source in their reports.  For one GL, this might be an option.
 
HTH
IP IP Logged
Butterfly_Joe
Newbie
Newbie


Joined: 04 Feb 2009
Online Status: Offline
Posts: 8
Quote Butterfly_Joe Replybullet Posted: 21 Jun 2009 at 7:09pm
The way the report is set up is as follows:
Main Report - Simple report which displays company logo/info with on-demand subreport links up top (for A/R, A/P, etc. detailed info), while regular subreports are embedded into the main report, which displays YTD company information. I did not make this report, I am simply altering certain aspects of it.

That being said, I realize that normally, a subreport contains some sort of link to the main report, however it does not seem as such (see 1st img below). I also have two more images below that show the makeup of the subreport I want to alter. If this helps you visualize how things are set up, and you can offer any other help on how I can get it to work, I'd be thrilled.









Thanks!
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 22 Jun 2009 at 2:10pm
I've been mulling this over.  How does the subreport get the bank accounts?  Via stored proc, joining to the tables? 
 
If via stored proc, I would try working on a union of all the bank accounts and add the GL balance that is desired.
 
While I don't like to recommend this, but other have used this, if you join directly to the tables, you could do the above select w/union in the command object and then utilize that as the datasource for this subreport.
 
Hope one of these ideas can get you to the desired report.
IP IP Logged
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