locked
Lightswitch - Office integration pack: Mappingcolumns not match the the table name RRS feed

  • Question

  • Hi,

    I am using office integration pack for lightswitch to create a word document. i run into problem that i do the columnmapping( officecolumn, tablecolumn) but when i excute the code it just generate table in .add(columnmappin..) order, not actually map between exitsing table header and field name I specific in the mapping.

    here is my mapping code.

               

                Dim mapTable As New List(Of OfficeIntegration.ColumnMapping)
                mapTable.Add(New OfficeIntegration.ColumnMapping("Item", "Product"))
                mapTable.Add(New OfficeIntegration.ColumnMapping("Quantity", "Quantity"))
                mapTable.Add(New OfficeIntegration.ColumnMapping("Price", "Price"))
                mapTable.Add(New OfficeIntegration.ColumnMapping("SalesOrderHeader", "SalesOrderHeader"))
                mapTable.Add(New OfficeIntegration.ColumnMapping("SalesReceipt", "SalesReceipt"))
                mapTable.Add(New OfficeIntegration.ColumnMapping("SalesTaxInvoice", "SalesTaxInvoice"))
                mapTable.Add(New OfficeIntegration.ColumnMapping("VATCode", "VATCode"))
                mapTable.Add(New OfficeIntegration.ColumnMapping("BaseAmount", "BaseAmount"))
                mapTable.Add(New OfficeIntegration.ColumnMapping("VATAmount", "VATAmount"))
                mapTable.Add(New OfficeIntegration.ColumnMapping("TotalAmount", "TotalAmount"))
    
              
                Word.Export(Environment.GetFolderPath(Environment.SpecialFolder.Desktop) & "\SalesInvoice.docx", "Lines", 3, False, Me.SalesInvoices.SelectedItem.SalesOrderLines, mapTable)

    In word, i prepared template like following:

    No     Item     Quantity      Price      BaseAmount

    ZM01     50       120         IV001       RE001            < Result i got

    (blank)   ZM01    50           120         6000             < What i expected.

    is this what this extension does normally or i did something wrong?

    Tuesday, March 3, 2015 2:37 AM

Answers

  • HI Buncha,

    By using the Office Integration Pack, you can more easily automate Word 2010, Excel 2010, and Outlook 2010. According to your description above, you need check whether use the Office Integration Pack properly first.

    Creating a Report

    Please let me know if there is anything that I can do to help.

    Best regards,

    Angie


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.


    • Edited by Angie Xu Tuesday, March 3, 2015 1:06 PM
    • Marked as answer by Angie Xu Monday, March 16, 2015 6:09 AM
    Tuesday, March 3, 2015 1:06 PM