Two designs on same report opened from one button

I have another thread opened called Class to Form to Table to Report that I added this to the end of but no one has responded so I’m going to open a new thread.

Here is my need:

There is an existing form (Arrival Overview) that users can choose PO’s and then the items on that PO. They can choose multiple PO’s and multiple items. Then I have created a button that they can click which grabs only the info I’m interested in (item) and writes it to a table (TCI_ReceivingLabels). Also in this table is two int fields, NumOfSmallLabels and NumOfLargeLabels which are defaulted to 1. A form opens with all the items listed and a 1 beside them in both Small and Large label columns. Here the user can edit how many labels they want to print for each item. Right now I only have the small labels part working. They can change the number of small labels and click on button on that form which calls a controller (TCI_ReceivingLabelsController) and rewrites the table and sends the info to the report. All that works perfectly. I’ve added a second design to the report which I also want to open on the same click of the button but I don’t know how to do this. I don’t think I’m doing things the right way so please help me figure out best practice for what I want to accomplish. Here is what I have:

A report named TCI_ReceivingLabels with 2 designs - Label and LargeLabel

A form called TCI_ReceivingLabels with a print labels button that calls a controller (and opens a prompt form with Parameters Item Number which I would prefer not to have since the user will never put in a specific item. They will always just print all the items in that table.

A controller class called TCI_ReceivingLabelsController with the following code:
class TCI_ReceivingLabelsController extends SrsReportRunController
{
}
protected void prePromptModifyContract()
{
TCI_ReceivingLabelsContract contract;

contract = this.parmReportContract().parmRdpContract() as TCI_ReceivingLabelsContract;
}
public static client void main(Args args)
{
TCI_ReceivingLabelsController controller = new TCI_ReceivingLabelsController();

controller.parmReportName(ssrsReportStr(TCI_ReceivingLabels, Label));
controller.parmShowDialog(false);
controller.parmShowReportViewerParameters(false);
controller.startOperation();
}

A contract class called TCI_ReceivingLabelsContract with the following code:
[DataContractAttribute]
public class TCI_ReceivingLabelsContract
{
}

A data provider class called TCI_ReceivingLabelsDP with the following code:
[SRSReportParameterAttribute(classStr(TCI_ReceivingLabelsContract))]
public class TCI_ReceivingLabelsDP extends SRSReportDataProviderBase
{
TCI_ReceivingLabels tci_ReceivingLabels;
}
[SRSReportDataSetAttribute(tableStr(TCI_ReceivingLabels))]
public TCI_ReceivingLabels getFields()
{
container tmpContainer;
str tmpItem, tmpName, tmpLoc, tmpWhse;
int cnt, conLength, tmpSmallLabels, tmpLargeLabels;

while select tci_ReceivingLabels
{
tmpContainer += tci_ReceivingLabels.ItemId;
tmpContainer += tci_ReceivingLabels.Name;
tmpContainer += tci_ReceivingLabels.NumOfSmallLabels;
tmpContainer += tci_ReceivingLabels.NumOfLargeLabels;
tmpContainer += tci_ReceivingLabels.TCI_Location;
tmpContainer += tci_ReceivingLabels.TCI_Warehouse;
}

conLength = conLen(tmpContainer);
delete_from tci_ReceivingLabels;

for (cnt = 1; cnt <= conLength; cnt++)
{
tci_ReceivingLabels.ItemId = conPeek(tmpContainer, cnt);
tmpItem = conPeek(tmpContainer, cnt);
cnt++;
tci_ReceivingLabels.Name = conPeek(tmpContainer, cnt);
tmpName = conPeek(tmpContainer, cnt);
cnt++;
tci_ReceivingLabels.NumOfSmallLabels = conPeek(tmpContainer, cnt);
tmpSmallLabels = conPeek(tmpContainer, cnt);
cnt++;
tci_ReceivingLabels.NumOfLargeLabels = conPeek(tmpContainer, cnt);
tmpLargeLabels = conPeek(tmpContainer, cnt);
cnt++;
tci_ReceivingLabels.TCI_Location = conPeek(tmpContainer, cnt);
tmpLoc = conPeek(tmpContainer, cnt);
cnt++;
tci_ReceivingLabels.TCI_Warehouse = conPeek(tmpContainer, cnt);
tmpWhse = conPeek(tmpContainer, cnt);
tci_ReceivingLabels.insert();
while (tmpSmallLabels > 1)
{
tmpSmallLabels–;
tci_ReceivingLabels.ItemId = tmpItem;
tci_ReceivingLabels.Name = tmpName;
tci_ReceivingLabels.NumOfSmallLabels = tmpSmallLabels;
tci_ReceivingLabels.TCI_Location = tmpLoc;
tci_ReceivingLabels.TCI_Warehouse = tmpWhse;
tci_ReceivingLabels.insert();
}
}

return tci_ReceivingLabels;
}
public void processReport()
{

}

How I accomplished the small labels as you can see is saving the table to a container and then rewriting the number of items for the number of labels they chose. How can I do this same thing for large labels and send the info to the new design? For example, let’s say they have item 123 and 456 and they input on the form they want 2 small labels for each item and 3 large labels for each. I then want it to send this to the small label design of the report.
123
123
456
456
The rewrite the table maybe? and send this to the large label design of the report:
123
123
123
456
456
456

I have a feeling I’m not going about this the right way but since I have never done anything like this before, I’m just trying different things. Maybe I create a second table? A second DP but that seems redundant??? Please help!

Right now I’m considering create 2 temp tables. TCI_ReceivingLabelsSmallTmp and TCI_ReceivingLabelsLargeTmp. I can use those as my data sources for the reports. Instead of wiping out my first table, I can just write to the temp tables the amount of items I want printed.

I’ve got this working. Msg me if you would like me to explain what I have done. Quick summary is 1 controller, 1 contract, 1 temp table, 1 report with 2 designs, and 2 DP’s.