Tuesday, March 20, 2012

Pulling info from the "current row" of one dataset into another

This is day 1 of me ever using RS so forgive ignorance of the topic.

Here's the basic scenario:

Input parameter from the user is an Account name.

For that account name I want to list Addresses of locations under the account, and then for each of those, I want to list received shipments from the address.

So Ideally the result is:

Account Name

Address 1

Shipment 1
Shipment 2
Shipment 3

Address 2

Shipment 1
Shipment 2

Address 3

Shipment 1

So, I am able to list the addresses just fine, but the next step is getting the stuff from the shipments table based on the currently running address? I'm probably saying that poorly. What I need to know is how do I structure the dataset/report to accomplish this. I suppose I could combine the query for the shipments with the query for the addresses, but that seems suboptimal to me.

TIA for the help.

Hello Scott,

If it is a one query i.e. one Dataset which gets al the AccountName, Address and Shipment then I would follow this.

1.) On the Toolbox, drag and drop the Table which is grid kinda structure.

2.) RightClick on the Table and add a Group and name it grpAccountName and from the dataset select the AccountName field in the field selection.

3.) On the first column of the grpAccountName drag and drop the AccountName field.

4.) Again RightClick on the Table and add a Group and name it grpAddress and from the dataset select the Address field in the field selection.

5.) On the First column of the grpAddress drag and drop the Address field from the dataset.

4.) Again RightClick on the Table and add a Group and name it grpShipment and from the dataset select the Shipment field in the field selection.

5.) On the Second column of the grpShipment drag and drop the Shipment field from the dataset

I think it should work. I have not tested it but I think this should solve your problem.

All the best.

Hope this helps...

--Deepak

No comments:

Post a Comment