cancel
Showing results for 
Search instead for 
Did you mean: 

Using fields from a subreport in the formula editor.

Former Member
0 Kudos

I'm using crystal 9. I have a subreport within a main report. The main report is invoices for customers. The subreport is in a footer and it contains payment information. It is linked to the main report by the Invoice's Packslip ID. The subreport uses a separate stored procedure to find all the payments associated to that single invoice. The subreport works great but I need to supress some of the payment records if they are not credit cards (payment type). The payment type is a field in the subreport but when I try to create a formula to supress records the only fields I have available are fields that are either in the main report or fields from the Main stored procedure. Why don't I have fields pulled in from the subreport's stored procedure available for the editor?

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

I hope I'm not misunderstanding what you want me to do but I can't add the payment fields to the main fields as they would not be a one to one relation. For example: If I have an invoice and they ordered 2 items, the main stored procedure would be pulling in 2 records/lines for this invoice. What happens if they used 4 payments on the order? Also the subreport is in a group footer so all the records have already been read. The main fields I have available to add to the formula would only be coming from the very last record it read.

Former Member
0 Kudos

I think the only way is to process the subreport two times so that you can get the payment type from subreport by using shared variables and place this subreport before the section where you want to suppress and suppress the subreport section also as we are placing this to get the payment type from subreport and after getting the value you can supress the sections that you want.

I hope you understand!

Raghavendra

Answers (1)

Answers (1)

Former Member
0 Kudos

Try to pass the field from main report to subreport with out linking with subreport fields and use that field in the formula editor or suppress condition

Regards,

Raghavendra

Former Member
0 Kudos

I don't think I can get rid of the link because then the report will promting me for a Packslip Id parameter, unless you know of a different way where I can pass it the Packslip Id. I need this report to print out large batches of invoices without a user entering a packslip ID for every invoice that comes up. They enter a date range parameter at the very beginning and then it does the rest on its own.

Former Member
0 Kudos

do you want to surpress all records if they are not a credit card payment, or is it dependent on additional restrictions as well? you can supress records in the subreport, would that work?

Former Member
0 Kudos

Yes, I am trying to just supress the records that are not a credit card payment. So if 3 of 5 payments are credit cards, I want those 3 records to show up in the subreport. I am trying to do this within the subreport. I right click on the subreport, click on format subreport and then I try to add a formula to the "supress" section, the only fields that are available are the ones from the main report's stored procedure. I need it to recognize that second stored procedure and the fields that it pulls in.

Former Member
0 Kudos

If the fields are in subreport then you cannot get the values untill subreport is processed. If the subreport is processed then you cannot suppress it. So I think by adding one more command in main report same as the command in subreport and use those fields from main report to suppress subreports.

Regards,

Raghavendra