Empty 'Invoice Date' error on Checks and Payments - acumatica

I am getting error when trying to save Checks and Payments record.
The process is when I click on 'Pay Bill/Apply Adjustments' (AP301000) under 'Actions', I am redirected to the Checks and Payments (AP302000) screen. And when I try to save the record, I get the below stack trace.
Error: Inserting 'Payment' record raised at least one error. Please review the errors.
Error: 'Invoice Date' cannot be empty.
at PX.Data.PXUIFieldAttribute.CommandPreparing(PXCache sender, PXCommandPreparingEventArgs e) in C:\Bld\AC-FULL2019R18-JOB1\Sources\NetTools\PX.Data\Descriptor\Attribute.cs:line 3684
at PX.Data.PXCache.OnCommandPreparing(String name, Object row, Object value, PXDBOperation operation, Type table, FieldDescription& description) in C:\Bld\AC-FULL2019R18-JOB1\Sources\NetTools\PX.Data\Cache\ModelEventHandling.cs:line 146
at PX.Data.PXTableAttribute.PrepareParametersForInsert(PXCache sender, Object row, Type[] tables, ISqlDialect dialect, Boolean audit, List`1[] pars) in C:\Bld\AC-FULL2019R18-JOB1\Sources\NetTools\PX.Data\Descriptor\Attributebase.cs:line 1123
at PX.Data.PXTableAttribute.PersistInserted(PXCache sender, Object row) in C:\Bld\AC-FULL2019R18-JOB1\Sources\NetTools\PX.Data\Descriptor\Attributebase.cs:line 990
at PX.Data.PXCache`1.PersistInserted(Object row, Boolean bypassInterceptor) in C:\Bld\AC-FULL2019R18-JOB1\Sources\NetTools\PX.Data\Cache\Model.cs:line 6550
at PX.Data.PXCache`1.Persist(PXDBOperation operation) in C:\Bld\AC-FULL2019R18-JOB1\Sources\NetTools\PX.Data\Cache\Model.cs:line 6090
at PX.Data.PXGraph.Persist(Type cacheType, PXDBOperation operation) in C:\Bld\AC-FULL2019R18-JOB1\Sources\NetTools\PX.Data\Graph\Graph.cs:line 4402
at PX.Data.PXGraph.Persist() in C:\Bld\AC-FULL2019R18-JOB1\Sources\NetTools\PX.Data\Graph\Graph.cs:line 4322
at PX.Objects.AP.APPaymentEntry.Persist() in C:\Bld\AC-FULL2019R18-JOB1\Sources\WebSites\Pure\PX.Objects\AP\APPaymentEntry.cs:line 1468
at PX.Data.PXSave`1.d__2.MoveNext() in C:\Bld\AC-FULL2019R18-JOB1\Sources\NetTools\PX.Data\Descriptor\Action\CommonActions.cs:line 73
at PX.Data.PXAction`1.d__32.MoveNext() in C:\Bld\AC-FULL2019R18-JOB1\Sources\NetTools\PX.Data\Descriptor\Action\PXAction.cs:line 954
at PX.Data.PXAction`1.d__32.MoveNext() in C:\Bld\AC-FULL2019R18-JOB1\Sources\NetTools\PX.Data\Descriptor\Action\PXAction.cs:line 896
at PX.Web.UI.PXBaseDataSource.tryExecutePendingCommand(String viewName, String[] sortcolumns, Boolean[] descendings, Object[] searches, Object[] parameters, PXFilterRow[] filters, DataSourceSelectArguments arguments, Boolean& closeWindowRequired, Int32& adapterStartRow, Int32& adapterTotalRows) in C:\Bld\AC-FULL2019R18-JOB1\Sources\NetTools\PX.Web.UI\Controls\Data\DataSource.cs:line 2592
at PX.Web.UI.PXBaseDataSource.ExecuteSelect(String viewName, DataSourceSelectArguments arguments, PXDSSelectArguments pxarguments) in C:\Bld\AC-FULL2019R18-JOB1\Sources\NetTools\PX.Web.UI\Controls\Data\DataSource.cs:line 1983
The coincidence is I have the customization that has a custom field the Display Text 'Invoice Date'. So, the first thing I did was I put the PersistingCheck to nothing in PXDefault attribute.
[PXDefault(PersistingCheck = PXPersistingCheck.Nothing)]
But that still didn't solve the problem.
So, I unpublish the customization and the issue was still there. Then finally I even removed the custom field (NB: The field is nullable) from database to make sure that my customization isn't causing the issue. But that also didn't work.
Upon trying to find DAC fields with the particular display text I find some fields but that doesn't seem to be associated with the graph for those screens.
Thank you.

It looks strange, I don't see any related fields with "Invoice Date" display name, which may cause an issue. I faced similar strange issues due to IIS data caching.
I would recommend do the following:
Restart IIS
Remove temp ASP.NET files which are located somewhere here C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files
Remove temp Customization files
Then to be sure the problem is not in your customization
Rename your custom field from "Invoice Date" to "Invoice Date 1" for example
Publish your customization again
Try your steps again and verify an error message if it still exists - which display name do you see, "Invoice Date" or "Invoice Date 1"?

Related

Adding Vendor lookup to custom field

I added a custom field for vendorid on the SO Line. (Yes, I know there is one there, but we are building some new logic). I've added the integer field and it appears on the grid fine. I'm trying to get a lookup of vendors. I started with this
Where<AP.Vendor.type, NotEqual<BAccountType.employeeType>>>))]
and then tried
Where<BAccountR.type, Equal<BAccountType.companyType>,
Or<AP.Vendor.type, NotEqual<BAccountType.employeeType>>>>),
Visibility = PXUIVisibility.SelectorVisible, CacheGlobal = true, Filterable = true)]
It got me a lookup on new records, but then when I save and try to open any sales order, I get an error that says "Error: An error occurred during the processing of the field InventoryID: Specified cast is not valid.." which makes no sense to me. But if I remove the above it works, so seems like that must be the issue.
Stack Trace as requested:
Error: Error: An error occurred during processing of the field InventoryID: Specified cast is not valid..
Raised At: 2/24/2020 6:47:58 PM Screen: SO.30.10.00
Details:
2/24/2020 6:47:58 PM Error:
Error: An error occurred during processing of the field InventoryID: Specified cast is not valid..
System.InvalidCastException: Specified cast is not valid.
at System.Data.SqlClient.SqlBuffer.get_Int32()
at PX.Data.PXDataRecord.GetInt32(Int32 i)
at PX.Data.PXDBIntAttribute.RowSelecting(PXCache sender, PXRowSelectingEventArgs e)
at PX.Data.PXCache.OnRowSelecting(Object item, PXDataRecord record, Int32& position, Boolean isReadOnly)
at PX.Data.PXCache.OnRowSelecting(Object item, PXDataRecord record, Int32& position, Boolean isReadOnly)
at PX.Data.PXCache`1.Select(PXDataRecord record, Int32& position, Boolean isReadOnly, Boolean& wasUpdated)
at PX.Data.PXView.GetResult(Object[] parameters, PXFilterRow[] filters, Boolean reverseOrder, Int32 topCount, PXSearchColumn[] sorts, Boolean& overrideSort, Boolean& extFilter)
at PX.Data.PXView.Select(Object[] currents, Object[] parameters, Object[] searches, String[] sortcolumns, Boolean[] descendings, PXFilterRow[] filters, Int32& startRow, Int32 maximumRows, Int32& totalRows)
at PX.Objects.SO.SOOrderEntry.transactions()
at _CustomMethod(Object , Object[] )
at PX.Data.PXView.InvokeDelegate(Object[] parameters)
at PX.Data.PXView.Select(Object[] currents, Object[] parameters, Object[] searches, String[] sortcolumns, Boolean[] descendings, PXFilterRow[] filters, Int32& startRow, Int32 maximumRows, Int32& totalRows)
at PX.Data.PXGraph.ExecuteSelect(String viewName, Object[] currents, Object[] parameters, Object[] searches, String[] sortcolumns, Boolean[] descendings, PXFilterRow[] filters, Int32& startRow, Int32 maximumRows, Int32& totalRows)
Anyone have any thoughts?
TL;DR;
Remove PXDBInt attribute from the field.
The issue here is not with Where condition but with attributes definition for the field.
[PXDBInt]
[PXUIField(DisplayName="Vendor ID")]
[AP.Vendor(typeof(Search<BAccountR.bAccountID, Where<AP.Vendor.type,
NotEqual<BAccountType.employeeType>>>))]
Actually, here you have DBField attribute twice. You have PXDBIntAttribute and Vendor attribute that contains PXDBIntAttribute inside.
Because of that the framework has the wrong fields to db columns mapping resulting in that strange error.
If you use Visual studio, I recommend you to try Acuminator extension https://marketplace.visualstudio.com/items?itemName=Acumatica.Acuminator
It highlights that type of errors
Too long for a comment, but more of a suggestion than an "answer". Try building your own PXSelector. I have a custom DAC that needs to store two vendors, and I had to abandon the AP.Vendor attribute for a custom PXSelector for mine to work. This is one of mine. In my case, I need to be able to see which one is defined as the Preferred Vendor for the warehouse, and I only want to see vendors associated with my InventoryID. SSINItemBranch is a custom DAC that is also available in the scope of this DAC's usage. The point is, use this as an example if you need one to try creating your own from scratch. If this isn't how you want to accomplish the task, at least you might isolate if the problem is a use case of the AP.Vendor attribute or something else.
[PXSelector(
typeof(Search2<
Vendor.bAccountID,
InnerJoin<POVendorInventory,
On<POVendorInventory.vendorID, Equal<Vendor.bAccountID>,
And<POVendorInventory.inventoryID, Equal<Current<SSINItemBranch.inventoryID>>>>,
LeftJoin<INItemSite, On<INItemSite.inventoryID, Equal<POVendorInventory.inventoryID>,
And<INItemSite.preferredVendorID, Equal<POVendorInventory.vendorID>,
And<INItemSite.preferredVendorLocationID, Equal<POVendorInventory.vendorLocationID>,
And<INItemSite.preferredVendorOverride, Equal<True>>>>>>>,
Where<Vendor.type, Equal<BAccountType.vendorType>>>),
typeof(Vendor.acctCD),
typeof(Vendor.acctName),
typeof(POVendorInventory.vendorLocationID),
typeof(INItemSite.preferredVendorOverride),
typeof(POVendorInventory.vendorInventoryID),
typeof(POVendorInventory.vLeadTime),
SubstituteKey = typeof(Vendor.acctCD),
DescriptionField = typeof(Vendor.acctName),
Filterable = true
)]

Can not select value in a combo box in coded UI test using coded UI test builder

I am working on a WPF application which has several custom controls. I am using coded UI test builder to create a script for my application testing. When I run the test, it gives me an exception and the exception occurs at the line shown below.
uIRadComboBoxComboBox.SelectedItem = this.SelectingWeddingParams.UIRadComboBoxComboBoxSelectedItem;
I have tried using mouse clicks and changing the coordinates but that does not work as well.
The code for the function is
region Variable Declarations
WpfCustom uIItemCustom = this.UIIntelliClientWindow.UIItemCustom;
WpfComboBox uIRadComboBoxComboBox = this.UIIntelliClientWindow.UIEventInfoRegionCustom1.UIPleasewaitProgressBar.UIRadComboBoxComboBox;
#endregion
// Click custom control
Mouse.Click(uIItemCustom, new Point(448, 307));
// Select 'Wedding' in 'RadComboBox' combo box
uIRadComboBoxComboBox.SelectedItem = this.SelectingWeddingParams.UIRadComboBoxComboBoxSelectedItem;
The exception is pasted below.
Result StackTrace:
at Microsoft.VisualStudio.TestTools.UITest.Playback.Engine.IScreenElement.FindAllDescendants(String bstrQueryId, Object& pvarResKeys, Int32 cResKeys, Int32 nMaxDepth)
at Microsoft.VisualStudio.TestTools.UITest.Playback.ScreenElement.FindAllScreenElement(String queryId, Int32 depth, Boolean singleQueryId, Boolean throwException, Boolean resetSkipStep)
at Microsoft.VisualStudio.TestTools.UITest.Playback.ScreenElement.FindScreenElement(String queryId, Int32 depth, Boolean resetSkipStep)
at Microsoft.VisualStudio.TestTools.UITesting.UITestControl.FindFirstDescendant(String queryId, Int32 maxDepth, Int32& timeLeft)
--- End of inner exception stack trace ---
at Microsoft.VisualStudio.TestTools.UITesting.Playback.MapControlNotFoundException(COMException ex, IPlaybackContext context)
at Microsoft.VisualStudio.TestTools.UITesting.Playback.MapAndThrowComException(COMException innerException, IPlaybackContext context)
at Microsoft.VisualStudio.TestTools.UITesting.Playback.MapAndThrowException(Exception exception, IPlaybackContext context)
at Microsoft.VisualStudio.TestTools.UITesting.Playback.MapAndThrowException(Exception exception, String queryId)
at Microsoft.VisualStudio.TestTools.UITesting.UITestControl.FindFirstDescendant(String queryId, Int32 maxDepth, Int32& timeLeft)
at Microsoft.VisualStudio.TestTools.UITesting.SearchHelper.GetElement(Boolean useCache, ISearchArgument searchArg)
at Microsoft.VisualStudio.TestTools.UITesting.SearchHelper.Search(ISearchArgument searchArg)
at Microsoft.VisualStudio.TestTools.UITesting.UITestControl.FindInternal()
at Microsoft.VisualStudio.TestTools.UITesting.UITestControl.FindControlIfNecessary()
at Microsoft.VisualStudio.TestTools.UITesting.UITestControl.SetPropertyPrivate(String propertyName, Object value)
at Microsoft.VisualStudio.TestTools.UITesting.UITestControl.<>c__DisplayClass180_0.b__0()
at Microsoft.VisualStudio.TestTools.UITesting.CodedUITestMethodInvoker.InvokeMethod[T](Func`1 function, UITestControl control, Boolean firePlaybackErrorEvent, Boolean logAsAction)
at Microsoft.VisualStudio.TestTools.UITesting.UITestControl.SetProperty(String propertyName, Object value)
at Microsoft.VisualStudio.TestTools.UITesting.WpfControls.WpfComboBox.set_SelectedItem(String value)
at AddingEventUsingDataDrivenTesting.UIMap.SelectingWedding() in C:\Users\Dev2\source\repos\AddingEventUsingDataDrivenTesting\AddingEventUsingDataDrivenTesting\UIMap.Designer.cs:line 166
at AddingEventUsingDataDrivenTesting.CodedUITest1.CodedUITestMethod1() in C:\Users\Dev2\source\repos\AddingEventUsingDataDrivenTesting\AddingEventUsingDataDrivenTesting\CodedUITest1.cs:line 30
Result Message:
Test method AddingEventUsingDataDrivenTesting.CodedUITest1.CodedUITestMethod1 threw exception:
Microsoft.VisualStudio.TestTools.UITest.Extension.UITestControlNotFoundException: The playback failed to find the control with the given search properties. Additional Details:
TechnologyName: 'UIA'
FrameworkId: 'Wpf'
ControlType: 'ComboBox'
HelpText: 'RadComboBox'
Instance: '2'
Search may have failed at '' TabList as it may have virtualized children. If the control being searched is descendant of '' TabList then including it as the parent container may solve the problem. ---> System.Runtime.InteropServices.COMException: Error HRESULT E_FAIL has been returned from a call to a COM component.
I face the same issue when I try to automate the wpf controls with coded UI.
The best solution I would like to suggest is to use Appium WinAppDriver(If it is possible for you) as it supports the wpf controls as mentioned my Microsoft team.
here is the guide to : How to use WinAppDriver
CodedUI will be deprecated after Visual studio 2019(mentioned by one of the member of microsoft team in a video) although support will be there.
And for the work around I would suggest you to use the Keyboard.Sendkeys() to set the combobox.
for exmaple :-
UITestControl combobox = new UITestControl();
//add properties of combobox
WinEdit textboxOfCombobox = new WinEdit(comboBox);
textboxOfCombobox.SendKeys("value to enter");
// Add code to verify if the combobox has the correct value selected.
This workaround I use personally and it works for me.
I hope this helps.

Font error when clicking Attribute Relationships tab in Dimension Designer in SSDT

I am new to SSDT and I'm following the Analysis Services Tutorial called Multidimensional Modeling (Adventure Works Tutorial). And I'm currently on Lesson 3, on the step Modifying the Customer Dimensions under the heading "Modifying Attribute Relationships".
When I open the Dimension Designer window for my Customer Dimension, if I click on the attribute tab, I receive a long error message. I've been searching online and found nothing about this error. does anyone know what is the cause of this error? I've checked my font folder and I have Arial font already.
===================================
An error prevented the view from loading. (Microsoft Visual Studio)
===================================
Exception has been thrown by the target of an invocation. (mscorlib)
------------------------------
Program Location:
at System.RuntimeMethodHandle.SerializationInvoke(IRuntimeMethodInfo method, Object target, SerializationInfo info, StreamingContext& context)
at System.Runtime.Serialization.ObjectManager.CompleteISerializableObject(Object obj, SerializationInfo info, StreamingContext context)
at System.Runtime.Serialization.ObjectManager.FixupSpecialObject(ObjectHolder holder)
at System.Runtime.Serialization.ObjectManager.DoFixups()
at System.Runtime.Serialization.Formatters.Binary.ObjectReader.Deserialize(HeaderHandler handler, __BinaryParser serParser, Boolean fCheck, Boolean isCrossAppDomain, IMethodCallMessage methodCallMessage)
at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize(Stream serializationStream, HeaderHandler handler, Boolean fCheck, Boolean isCrossAppDomain, IMethodCallMessage methodCallMessage)
at System.Resources.ResourceReader.DeserializeObject(Int32 typeIndex)
at System.Resources.ResourceReader._LoadObjectV2(Int32 pos, ResourceTypeCode& typeCode)
at System.Resources.ResourceReader.LoadObjectV2(Int32 pos, ResourceTypeCode& typeCode)
at System.Resources.ResourceReader.ResourceEnumerator.get_Entry()
at System.Resources.ResourceReader.ResourceEnumerator.get_Current()
at System.ComponentModel.ComponentResourceManager.FillResources(CultureInfo culture, ResourceSet& resourceSet)
at System.ComponentModel.ComponentResourceManager.ApplyResources(Object value, String objectName, CultureInfo culture)
at Microsoft.AnalysisServices.Graphing.GraphCtrl.InitializeComponent()
at Microsoft.AnalysisServices.Graphing.GraphCtrl..ctor()
at Microsoft.AnalysisServices.Design.AR.ARDiagram..ctor()
at Microsoft.AnalysisServices.Design.AR.AREditor..ctor()
at Microsoft.AnalysisServices.Design.DimensionDesigner.CreateAREditor(VsStyleToolBar pageViewToolBar)
at Microsoft.DataWarehouse.Design.EditorWindow.EnsureViewIsLoaded(EditorView view)
===================================
Font 'Arial' does not support style 'Regular'. (System.Drawing)
------------------------------
Program Location:
at System.Drawing.Font.CreateNativeFont()
at System.Drawing.Font.Initialize(FontFamily family, Single emSize, FontStyle style, GraphicsUnit unit, Byte gdiCharSet, Boolean gdiVerticalFont)
at System.Drawing.Font.Initialize(String familyName, Single emSize, FontStyle style, GraphicsUnit unit, Byte gdiCharSet, Boolean gdiVerticalFont)
at System.Drawing.Font..ctor(SerializationInfo info, StreamingContext context)

Orchard CMS Duplicate Content Error

We have a web site built with Orchard CMS v1.8. We have had a couple of instances where the person that manages content has not been able to save changes to a Page. They receive the following error.
An unhandled exception has occurred and the request was terminated. Please refresh the page. If the error persists, go back
Sequence contains more than one matching element
System.InvalidOperationException: Sequence contains more than one matching element at System.Linq.Enumerable.SingleOrDefault[TSource](IEnumerable1 source, Func2 predicate) at Orchard.ContentManagement.DefaultContentManager.BuildNewVersion(ContentItem existingContentItem) in c:\Orchard\src\Orchard\ContentManagement\DefaultContentManager.cs:line 450 at Orchard.ContentManagement.DefaultContentManager.Get(Int32 id, VersionOptions options, QueryHints hints) in c:\Orchard\src\Orchard\ContentManagement\DefaultContentManager.cs:line 234 at Orchard.Core.Contents.Controllers.AdminController.EditPOST(Int32 id, String returnUrl, Action1 conditionallyPublish) in c:\Orchard\src\Orchard.Web\Core\Contents\Controllers\AdminController.cs:line 308 at lambda_method(Closure , ControllerBase , Object[] ) at System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary2 parameters) at System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary2 parameters) at System.Web.Mvc.Async.AsyncControllerActionInvoker.<BeginInvokeSynchronousActionMethod>b__39(IAsyncResult asyncResult, ActionInvocation innerInvokeState) at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResult2.CallEndDelegate(IAsyncResult asyncResult) at System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethod(IAsyncResult asyncResult) at System.Web.Mvc.Async.AsyncControllerActionInvoker.AsyncInvocationWithFilters.b__3f() at System.Web.Mvc.Async.AsyncControllerActionInvoker.AsyncInvocationWithFilters.<>c__DisplayClass48.b__41() at System.Web.Mvc.Async.AsyncControllerActionInvoker.AsyncInvocationWithFilters.<>c__DisplayClass48.b__41() at System.Web.Mvc.Async.AsyncControllerActionInvoker.AsyncInvocationWithFilters.<>c__DisplayClass48.b__41()
What can I do to elimiate the extra record(s) returned in the SingleOrDefault() call? I don't know the database structure behind Orchard enough to find the "content records" but if I was able to find them I could delete the extra record(s).
Thanks!
The cause for this error that you have more than one version of the same content item with value Latest = 1 (orchard use this value to determine the latest version for content item), to solve it you can run the following query to find the duplicate versions:
SELECT *
FROM Orchard_Framework_ContentItemVersionRecord
WHERE ContentItemRecord_id = #Id
then be sure that there is only one record with value Latest = 1, published = 1, and Number is in sequence without duplicates.
FYI, in query use value Id for content item which has the error.

ArgumentOutOfRangeException while using XlsIO with Excel template

I am using SyncFusion XlsIo for exporting data to excel sheet. I am having some problems while exporting data to excel. I think I have problems in excel template. So first of all I want to know how can I create template for excel, so I can place values there ? I want to do similar thing which is in sample app provided by SyncFusion SDK. I tried to replicate that excel template but it didn't work and threw exception. Exception details are given below.
Exception : System.ArgumentOutOfRangeException was unhandled by user
code HResult=-2146233086 Message=Can't find property Parameter
name: strText Source=Syncfusion.XlsIO.WinRT ParamName=strText
StackTrace:
at Syncfusion.XlsIO.Implementation.TemplateMarkers.TemplateMarkersImpl.GetNextValue(Object
value, String& strText, String& newNumberFormat,
Type& newType)
at Syncfusion.XlsIO.Implementation.TemplateMarkers.TemplateMarkersImpl.SetSimpleValue(Object
value, String strText, IWorksheet sheet,
IMigrantRange migrantRange, IList`1 arrMarkerCells, IList
lstArguments, MarkerOptionsImpl options, RangeBuilder builder,
UnknownVariableAction
action, String numberFormat, Type valueType)
at Syncfusion.XlsIO.Implementation.TemplateMarkers.TemplateMarkersImpl.SetArrayValue(IList
value, String strText, IWorksheet sheet,
IMigrantRange migrantRange, IList`1 arrMarkerCells, IList
lstArguments, MarkerOptionsImpl options, RangeBuilder builder,
UnknownVariableAction
action, VariableTypeAction variableTypeAction)
at Syncfusion.XlsIO.Implementation.TemplateMarkers.TemplateMarkersImpl.SetUnknownVariable(Object
value, String strText, IWorksheet sheet,
IMigrantRange migrantRange, IList`1 arrMarkerCells, IList
lstArguments, MarkerOptionsImpl options, RangeBuilder builder,
UnknownVariableAction
action, VariableTypeAction variableTypeAction)
at Syncfusion.XlsIO.Implementation.TemplateMarkers.TemplateMarkersImpl.SetVariable(String
strVariable, String strText, IWorksheet sheet,
IMigrantRange migrantRange, IList`1 arrMarkerCells, IList
lstArguments, MarkerOptionsImpl options, RangeBuilder builder,
UnknownVariableAction
action)
at Syncfusion.XlsIO.Implementation.TemplateMarkers.TemplateMarkersImpl.ApplyMarker(IWorksheet
sheet, IList`1 arrCells, Int32 i, IMigrantRange
migrantRange, UnknownVariableAction action)
at Syncfusion.XlsIO.Implementation.TemplateMarkers.TemplateMarkersImpl.ApplyMarkers(IWorksheet
sheet, List`1 arrLabels, UnknownVariableAction
action)
at Syncfusion.XlsIO.Implementation.TemplateMarkers.TemplateMarkersImpl.ApplyMarkers(IWorkbook
book, UnknownVariableAction action)
at Syncfusion.XlsIO.Implementation.TemplateMarkers.TemplateMarkersImpl.ApplyMarkers(UnknownVariableAction
action)
at InvoiceExportDemo.ExportToExcel.d__0.MoveNext() in
d:\Projects\InvoiceExportDemo\InvoiceExportDemo\HelperClass
\ExportToExcel.cs:line 29
line : marker.ApplyMarkers(UnknownVariableAction.Skip);
This exception is raised due to the usage issue. Custom class property name and marker in the input template should match. Use the following procedure to create input template with marker and refer the sample provided.
Create input template with template marker:
Syntax :
%classname.PropertyName
Example :
%InvoiceItem.ItemName
Represents the above string in the excel file then in the sample use the below code snippet.
List<InvoiceItem> items = new List<InvoiceItem>();
items.Add(new InvoiceItem("Essential Studio WinRT", 1, 399, 50));
items.Add(new InvoiceItem("Essential ASP.NET ", 1, 995, 70));
//Create Template Marker Processor
ITemplateMarkersProcessor marker = book.CreateTemplateMarkersProcessor();
//Binding the business object with the marker.
marker.AddVariable("InvoiceItem", items);
//Applies the marker.
marker.ApplyMarkers(UnknownVariableAction.Skip);
Sample : Template_Marker_Sample.zip
Regards,
Johnson

Resources