Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

shared variable issue

Status
Not open for further replies.

Newbi1

Programmer
Apr 4, 2005
64
US
CR9
Windows XP
SQL server

I have to pass 2 values to the subreport. I link via an invoice number, however I also need to pass the invoice type too as it uses a dual primary key.

I have not found how to get the variable passed to the subreport for each invoice.

what I have is:

Main report:
Shared stringVar ttype:= {tfacr200.ttyp};

I placed that value in the hear for the invoice group. I am linked via invoice number.

In the subreport selection group I tried:
{tfacr200.ninv} = {?Pm-tfacr200.ninv}
and
{tfacr200.ttyp} = stringVar ttype;

This produces no records in the subreport. How should I be passing this across?
 
Go to edit->subreport links and after linking on the invoice number, add a link on {tfacr200.ttyp}. If you are grouping in the main report on invoice number, then add a group on {tfacr200.ttyp} and insert the subreport in the group header or footer for that new group.

-LB



 
perhaps I was not clear enough.
Let me try again.
In order to retrieve the payments from the subreport. I need to pass it both keys. If I pass it one or the other it will not retrieve the correct records 100% of the time.

I am not understanding how what header I pace the subreport in will affect whether it sends both the invoice number and the payment type to the subreport.

Example:

Ptype Invoice
ACR 5000
ACM 5000
SO 5000

Same field could be repeated with the same value multiple times. I need to pay both fields across and still keep the 70000 records it retieves accurate and in less than 10 min. (tried sending it as a formula and took over an hour to run.)
 
I am suggesting that you should be linking on BOTH fields. The location of the subreport does matter. I think it would help if you explained the group structure of your main report and the content of the subreport so we can tell how the subreport display relates to the main report structure.

-LB
 
Ok... I am no understanding, but here goes. I have a group of account managers, then a regions group under that then a customer group, then an invoice group with the payments. Then in the drill down n details is the invoice details.

Th sub report contains payments on a specific invoice. It is in the same table as the invoices (why I have no clue).

So in the table I have Invoices and accounting credits/memos

Type Invoice Amount duedate balance customer docdate
ACM 5000 -5000 1/14/2005 -1400.00 0555 1/14/05
SO 5000 25000 1/14/2005 1000.00 0555 1/14/05

and I have payments


Type Invoice Amount docdate balance customer
SO 5000 -24000 2/15/2005 0 0555
ACM 5000 3600 2/1/2005 0 0555

in the main report I have eliminated all invoices with a 0 blance. This also elimiates the payments. I am using the subreport to get the payments on the specific invoice.

what I need to see is:
Invoice duedate invoice amt balance
---payment rec date amount
ACM 5000 1/14/2005 -5000 1400
acm5000 2/15/2005 3600

SO 5000 1/14/2005 25000 1000
SO5000 2/1/2005 -24000


 
If this display is at the detail level, then you would place the subreport in the detail section, and link it on both the invoice field and the type field to the main report. To do this, either click on the "link" tab after designing the subreport or, in the main report, go to edit->subreport links->and first move {table.invoice} to the right and you will see in the bottom left "?Pm-table.invoice" and in the bottom right you will see "select data in subreport based on 'Invoice'". Then go to the top left again and move {table.type} to the right and you will see in the bottom left ?Pm-table.type and in the bottom right "select data in subreport based on 'type'".

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top