I am working on printing a pick list with the bulk print. I added the PrintPicLIst Applogic and set it to true. Can someone help clean thi up .. It is working if I print one at a time. but when I check more than 1 to print it is correct.
on printreceipts.aspx.cs I have


if (AppLogic.AppConfigBool("PrintPicList"))
{
// requires new db mods, not supported or documented.
// write pic list:
Response.Write("<p><b>Store Name</b></p>");
using (DataTable dt = new DataTable())
{
using (SqlConnection con = new SqlConnection(DB.GetDBConn()))
{
con.Open();

using (IDataReader rs = DB.GetRS("aspdnsf_getOrder " + DB.SQuote(TheseOrderNumbers), con))
{
dt.Load(rs);
}
}

if (dt.Rows.Count == 0)
{
Response.Write("<p>No Items Found in PickList</p>");
}
else
{
Response.Write("<table width=\"100%\" cellpadding=\"2\" cellspacing=\"0\" border=\"1\" style=\"border-style: solid; border-width: 1px; border-color: #CCCCCC;\">");
Response.Write("<tr><th align=\"left\" valign=\"top\">Line #</th><th align=\"left\" valign=\"top\">Order #</th><th align=\"left\" valign=\"top\">Product Name</th><th align=\"left\" valign=\"top\">Full SKU</th><th align=\"left\" valign=\"top\">BIN#</th><th align=\"left\" valign=\"top\">Size</th><th align=\"left\" valign=\"top\">Color</th><th align=\"left\" valign=\"top\">Count</th></tr>");
String LastCat = String.Empty;
int i = 1;
foreach (DataRow row in dt.Rows)
{
/// Header

Response.Write ("<b>Order Number:" + "&nbsp" + DB.RowField(row, "OrderNumber") + "&nbsp" + DB.RowField(row, "OrderDate") + "</b><br/><br/>");

Response.Write ("<b>Bill To:" + "</b><br/>");
Response.Write(DB.RowField(row, "BillingFirstName")+ "&nbsp" + DB.RowField(row, "BillingLastName") + "<br/>");
Response.Write(DB.RowField(row, "BillingAddress1") + "<br/>");
Response.Write(DB.RowField(row, "BillingAddress2") + DB.RowField(row, "BillingSuite") +"<br/>");
Response.Write(DB.RowField(row, "BillingCity") + "&nbsp" + DB.RowField(row, "BillingState") + "&nbsp" + DB.RowField(row, "BillingZip") + "<br/>");
Response.Write(DB.RowField(row, "BillingCountry") + "<br/>");
Response.Write(DB.RowField(row, "BillingPhone") + "<br/><br/>");

Response.Write ("<b>Ship To:" + "</b><br/>");
Response.Write(DB.RowField(row, "ShippingFirstName")+ "&nbsp" + DB.RowField(row, "ShippingLastName") + "<br/>");
Response.Write(DB.RowField(row, "ShippingAddress1") + "<br/>");
Response.Write(DB.RowField(row, "ShippingAddress2") + DB.RowField(row, "ShippingSuite") +"<br/>");
Response.Write(DB.RowField(row, "ShippingCity") + "&nbsp" + DB.RowField(row, "ShippingState") + "&nbsp" + DB.RowField(row, "ShippingZip") + "<br/>");
Response.Write(DB.RowField(row, "ShippingCountry") + "<br/>");
Response.Write(DB.RowField(row, "ShippingPhone") + "<br/><br/>");

Response.Write ("<b>Order Notes:" + "</b><br/>");
Response.Write(DB.RowField(row, "OrderNotes") + "<br/><br/>");

/// List Items
Response.Write(String.Format("<tr style=\"border-style: solid; border-width: 1px; border-color: #CCCCCC;\"><td align=\"left\" valign=\"top\">{0}</td><td align=\"left\" valign=\"top\">{1}</td><td align=\"left\" valign=\"top\">{2}</td><td align=\"left\" valign=\"top\">{3}</td><td align=\"left\" valign=\"top\">{4}</td><td align=\"left\" valign=\"top\">{5}</td><td align=\"left\" valign=\"top\">{6}</td><td align=\"left\" valign=\"top\">{7}</td></tr>",
/// CommonLogic.IIF(LastCat == DB.RowField(row, "CategoryName"), "&nbsp;", "<b>" + DB.RowField(row, "CategoryName") + "</b>"),
/// CommonLogic.IIF(LastCat == DB.RowField(row, "CategoryName"), "&nbsp;", "<b>" + DB.RowField(row, "CategoryPath") + "</b>"),
i,
DB.RowField(row, "OrderNumber"),
DB.RowField(row, "OrderedProductName"),
DB.RowField(row, "OrderedProductSKU"),
DB.RowField(row, "WarehouseLocation") + "&nbsp",
DB.RowField(row, "ChosenSize") + "&nbsp",
DB.RowField(row, "ChosenColor") + "&nbsp",
DB.RowFieldInt(row, "Quantity").ToString()));
LastCat = DB.RowField(row, "CategoryName");
i++;
}
Response.Write("</table>");
Response.Write("<p style=\"page-break-before: always;\"><H1><b>" + "</b></H1></p>");
}