Print Page | Close Window

Pass the value in Formula Field to subreport!

Printed From: Crystal Reports Book
Category: Crystal Reports for Visual Studio 2005 and Newer
Forum Name: Report Design
Forum Discription: The best way to design a report and problems you have encountered
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=12656
Printed Date: 07 May 2024 at 4:15pm


Topic: Pass the value in Formula Field to subreport!
Posted By: avt2011
Subject: Pass the value in Formula Field to subreport!
Date Posted: 19 Mar 2011 at 7:38am
Hello all,

I got an issues when pass value of Formula Field from main report to subreport Parameter Field in Crystal Report. Here are the steps that I did as following:
1. In main report, I created a TOTAL_AMOUNT Formula Field. I can see that value of TOTAL_AMOUNT when drag and drop it on main report. There are some other column field in main report.
2. I created a subreport in the GroupFooterSection of main report (not in the section details). In this subreport, I used the store procedure as a Crystal Report datasource. Therefore, Crystal Report to ask for enter parameter value and and just set NULL and ignore them at this step. Next I went to subreport and right click on it that will pop up the panel window and choose the option Change Subreports Links ..then opened Subreport Links to allow us setting the Available Fields to link the fields to subreport parameter. I linked three database fields from main reports to subreport parameter, and one dynamic formula field from main report to subreport parameter.
3. when I ran the application, the report showed the results of database field but not the result that associated to Formula Field

I found the interested thing if I click on the subreports area, it will popup another tabpage to show the result of missing TOTAL_AMOUNT field. I really got stuck in this issue. Any option to set between main report and subreport in order to asynchonize for displaying the results ???

Any helps or codes to solve this issues, I really appreciate it. Thanks in advance.

-------------
AVT



Replies:
Posted By: lockwelle
Date Posted: 21 Mar 2011 at 3:22am
set your formula to a shared variable and then have the subreport access it and use that value (in the subreport) to drive the stored proc.
 
Not sure if it will work, as I don't call stored procs from my reports anymore, but it is worth a try.


Posted By: avt2011
Date Posted: 23 Mar 2011 at 4:18pm
Hello,

I found the solution why it did not display the TOTAL_AMOUNT on subreport because the size was too small when created the sub-report. I increased the size and the amount showed up the missing result. Thank anyways.

-------------
AVT



Print Page | Close Window