RESOLVED: Pull Sheet to have Model Number

For general questions and discussions specific to the AbleCommerce 7.0 Asp.Net product.
Post Reply
vhemlani
Lieutenant, Jr. Grade (LT JG)
Lieutenant, Jr. Grade (LT JG)
Posts: 30
Joined: Wed May 25, 2011 7:58 pm

RESOLVED: Pull Sheet to have Model Number

Post by vhemlani » Tue Jun 14, 2011 11:49 pm

I need to have ModelNumber as a column on the pull sheet because for products without variants, that's where I store my UPC.

How do I do this? I've played around with PullSheet.aspx and PullSheet.aspx.cs with no success.

So in logic I need: IF the product does not have a variant, DISPLAY ModelNumber(or Manufacturer's Part Number).

Thanks!
Last edited by vhemlani on Fri Aug 12, 2011 4:08 pm, edited 1 time in total.

vhemlani
Lieutenant, Jr. Grade (LT JG)
Lieutenant, Jr. Grade (LT JG)
Posts: 30
Joined: Wed May 25, 2011 7:58 pm

Re: Pull Sheet to have Model Number

Post by vhemlani » Wed Jun 22, 2011 9:45 pm

Any ideas?
I'm happy to get this working without the if then logic too.

I just need ModelNumber to appear on the pull sheet.

SQL wise, it's quite simple, but i have no idea how to add it into the pullsheet.aspx(.cs)

User avatar
mazhar
Master Yoda
Master Yoda
Posts: 5084
Joined: Wed Jul 09, 2008 8:21 am
Contact:

Re: Pull Sheet to have Model Number

Post by mazhar » Thu Jun 23, 2011 2:58 am

Have a look at following thread viewtopic.php?f=42&t=15140
Something similar is happening in that post where pull sheet is modified to show thumbnail. In your case you need modal number. So first rename GetImage method to GetModelNumber then make it look like this

Code: Select all

    public string GetModelNumber(Object dataItem)
        {
            OrderPullItem item = (OrderPullItem)dataItem;
            string sku = item.Sku;
            if (string.IsNullOrEmpty(sku))
                return string.Empty;
            ProductCollection products = ProductDataSource.LoadForCriteria(string.Format("Sku = '{0}'", sku));
            if (products == null && products.Count == 0)
                return string.Empty;
            Product product = products[0];
            return product.ModelNumber;
        }

vhemlani
Lieutenant, Jr. Grade (LT JG)
Lieutenant, Jr. Grade (LT JG)
Posts: 30
Joined: Wed May 25, 2011 7:58 pm

Re: Pull Sheet to have Model Number

Post by vhemlani » Thu Jun 23, 2011 11:38 pm

I have both my files attached. I'm not sure why it crashes for me.

I tried the image thumbnail implementation as well, but that didn't work for me either.

I dunno what I'm doing wrong.

Thanks,
Vishal

vhemlani
Lieutenant, Jr. Grade (LT JG)
Lieutenant, Jr. Grade (LT JG)
Posts: 30
Joined: Wed May 25, 2011 7:58 pm

Re: Pull Sheet to have Model Number

Post by vhemlani » Thu Jun 23, 2011 11:41 pm

My attachments:

User avatar
mazhar
Master Yoda
Master Yoda
Posts: 5084
Joined: Wed Jul 09, 2008 8:21 am
Contact:

Re: Pull Sheet to have Model Number

Post by mazhar » Fri Jun 24, 2011 6:02 am

Following files are working for me. Unzip and replace yours with them. See if it works. If it don't can you please post the error message then.

dnachef
Ensign (ENS)
Ensign (ENS)
Posts: 1
Joined: Mon Jun 27, 2011 4:40 pm

Re: Pull Sheet to have Model Number

Post by dnachef » Mon Jun 27, 2011 4:44 pm

Hi Mazhar, I'm working with Vhemlani to solve this problem.

seems it is crashing on the line
Product product = products[0];

below is the error message:
Server Error in '/' Application.

Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index

Source Error:


Line 86: return string.Empty;
Line 87: Trace.Write("Inside GetUPCFrOmModelNumber", "sku");
Line 88: Product product = products[0];
Line 89: return product.ModelNumber;
Line 90: }

Source File: c:\inetpub\wwwroot\Admin\Orders\Print\PullSheet.aspx.cs Line: 88

Stack Trace:


[ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index]
System.Collections.CollectionBase.System.Collections.IList.get_Item(Int32 index) +10228964
CommerceBuilder.Common.SortableCollection`1.get_Item(Int32 index) +43
Admin_Orders_Print_PullSheet.GetUPCFromModelNumber(Object dataItem) in c:\inetpub\wwwroot\Admin\Orders\Print\PullSheet.aspx.cs:88
ASP.admin_orders_print_pullsheet_aspx.__DataBind__control7(Object sender, EventArgs e) in c:\inetpub\wwwroot\Admin\Orders\Print\PullSheet.aspx:25
System.Web.UI.Control.OnDataBinding(EventArgs e) +132
System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding) +170
System.Web.UI.Control.DataBindChildren() +11045679
System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding) +182
System.Web.UI.Control.DataBindChildren() +11045679
System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding) +182
System.Web.UI.WebControls.GridView.CreateRow(Int32 rowIndex, Int32 dataSourceIndex, DataControlRowType rowType, DataControlRowState rowState, Boolean dataBind, Object dataItem, DataControlField[] fields, TableRowCollection rows, PagedDataSource pagedDataSource) +267
System.Web.UI.WebControls.GridView.CreateChildControls(IEnumerable dataSource, Boolean dataBinding) +3340
System.Web.UI.WebControls.CompositeDataBoundControl.PerformDataBinding(IEnumerable data) +72
System.Web.UI.WebControls.GridView.PerformDataBinding(IEnumerable data) +18
System.Web.UI.WebControls.DataBoundControl.OnDataSourceViewSelectCallback(IEnumerable data) +147
System.Web.UI.WebControls.DataBoundControl.PerformSelect() +261
Admin_Orders_Print_PullSheet.Page_Load(Object sender, EventArgs e) in c:\inetpub\wwwroot\Admin\Orders\Print\PullSheet.aspx.cs:59
System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +25
System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +42
System.EventHandler.Invoke(Object sender, EventArgs e) +0
System.Web.UI.Control.OnLoad(EventArgs e) +132
System.Web.UI.Control.LoadRecursive() +66
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2428

vhemlani
Lieutenant, Jr. Grade (LT JG)
Lieutenant, Jr. Grade (LT JG)
Posts: 30
Joined: Wed May 25, 2011 7:58 pm

Re: Pull Sheet to have Model Number

Post by vhemlani » Tue Jun 28, 2011 9:25 pm

Let me know if you have any solutions Mazhar.

Thanks,
Vishal

vhemlani
Lieutenant, Jr. Grade (LT JG)
Lieutenant, Jr. Grade (LT JG)
Posts: 30
Joined: Wed May 25, 2011 7:58 pm

Re: Pull Sheet to have Model Number

Post by vhemlani » Wed Jun 29, 2011 10:02 pm

Any suggestions from anybody?

vhemlani
Lieutenant, Jr. Grade (LT JG)
Lieutenant, Jr. Grade (LT JG)
Posts: 30
Joined: Wed May 25, 2011 7:58 pm

Re: Pull Sheet to have Model Number

Post by vhemlani » Mon Jul 11, 2011 6:02 pm

I guess there's no solution.

I am trying this as an alternative:
I created a view on the SQL end to display the orders with my preferred status. I'm currently in the process of printing that to some page. It's a work around I guess.

vhemlani
Lieutenant, Jr. Grade (LT JG)
Lieutenant, Jr. Grade (LT JG)
Posts: 30
Joined: Wed May 25, 2011 7:58 pm

RESOLVED: Pull Sheet to have Model Number

Post by vhemlani » Fri Aug 12, 2011 4:07 pm

This is somewhat resolved.

My custom view pulls all the order item information I need for orders within a specific status. My pullsheet displays everything within that view using the listview control.

User avatar
Mizmo67
Commander (CMDR)
Commander (CMDR)
Posts: 155
Joined: Wed Mar 16, 2005 5:35 pm
Location: NJ
Contact:

Re: RESOLVED: Pull Sheet to have Model Number

Post by Mizmo67 » Wed Jul 25, 2012 4:35 pm

Hi Vhemlani,

Any chance you can post the resolution you worked out with the custom view here?
I'm trying to set up a custom view so that I can add model number to the pullsheet as well, but I'm getting a ton of runtime errors, so I have to be missing something.

Thanks,
~Mo
~Mo

Maureen Albertson
Scott's Bait & Tackle / Mystic Reel Parts LLC
Contact Me Via Store Website
Image
Ablecommerce Gold R11 Catalog LIVE

User avatar
Mizmo67
Commander (CMDR)
Commander (CMDR)
Posts: 155
Joined: Wed Mar 16, 2005 5:35 pm
Location: NJ
Contact:

Re: RESOLVED: Pull Sheet to have Model Number

Post by Mizmo67 » Fri Aug 24, 2012 1:11 pm

For anyone else looking at this thread, see solution in another thread.

It's posted for packing list but it works on the pullsheet as well.

viewtopic.php?f=44&t=16307&p=69670
~Mo

Maureen Albertson
Scott's Bait & Tackle / Mystic Reel Parts LLC
Contact Me Via Store Website
Image
Ablecommerce Gold R11 Catalog LIVE

Post Reply