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

 Page 1 of 1 [ 3 post ]

Relevant Pages