Comparing Data in Subreports 
Author Message
 Comparing Data in Subreports

Hello,

I want to know how I can create a formula to compare fields between the sub report and main report.

In other words, there is a field in the sub report called INSTOCK, and I have another field in the main report called REQUIRED.

How can I make a formula to do this simple math of how many parts to buy?

--
______________________

Regards,
Jim Osdale
A-2 Technologies




Tue, 15 Jul 2003 12:52:04 GMT  
 Comparing Data in Subreports

Quote:
> I want to know how I can create a formula to compare fields between the sub report and main report.
> In other words, there is a field in the sub report called INSTOCK, and I have another field in the main report called
> REQUIRED.

In Crystal 8 you can use the new function to define Global vars. These are known in both the main report and the subreport. The syntax could be something like this:

Formula in SubReport:

Global NumberVar InStock;
InStock := {Article.InStock};

Formula in MainReport:

Global NumberVar InStock;
Local NumberVar OrderQuantity:

OrderQuantity := InStock - {Order.ArticlesRequired};

For older versions you could create almost something like this using the functions in UFLSTORE.ZIP. This file can be downloaded from the Crystal Support website.

Gert

p.s. newsgroup messages are preferred to be in ASCII.



Thu, 17 Jul 2003 06:55:36 GMT  
 Comparing Data in Subreports

Variable scope (Local, Global and Shared)  turned up in CR7, and you actually need Shared variables to exchange data between a main report and a subreport.

It might be simplier to create a Paramater in your subreport and then link the field in the main report to that parameter.


  > I want to know how I can create a formula to compare fields between the sub report and main report.
  > In other words, there is a field in the sub report called INSTOCK, and I have another field in the main report called
  > REQUIRED.
  In Crystal 8 you can use the new function to define Global vars. These are known in both the main report and the subreport. The syntax could be something like this:

  Formula in SubReport:

  Global NumberVar InStock;
  InStock := {Article.InStock};

  Formula in MainReport:

  Global NumberVar InStock;
  Local NumberVar OrderQuantity:

  OrderQuantity := InStock - {Order.ArticlesRequired};

  For older versions you could create almost something like this using the functions in UFLSTORE.ZIP. This file can be downloaded from the Crystal Support website.

  Gert

  p.s. newsgroup messages are preferred to be in ASCII.



Thu, 24 Jul 2003 13:43:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Using data from a subreports, in other subreport :|

2. Comparing user entered data to listbox data??

3. comparing MSChart populated data with original data in variant form

4. Compare or not Compare !

5. COMPARE DATA IN OUTLOOK TO ACCESS

6. Comparing data in diff fields

7. HELP comparing table data....

8. comparing data in specific fields from two tables ???

9. Comparing Data in a table

10. comparing data in arrays

11. Comparing two data fields in Access through Visual Basic

12. Compare user defined data types

 

 
Powered by phpBB® Forum Software