By Bill Cunnien - 5/29/2008
I am using DevExpress to create an invoice. I have done this similar procedure several times now in SF (sales orders, acknowledgements, packing lists, etc.). Today I have been unable to resolve an error. Here it is:========== Message: Object does not match target type./r/nSource: mscorlib/r/nInner Exception: /r/nStack Trace: at System.Reflection.RuntimeMethodInfo.CheckConsistency(Object target) at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks) at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) at System.Reflection.RuntimePropertyInfo.GetValue(Object obj, BindingFlags invokeAttr, Binder binder, Object[] index, CultureInfo culture) at System.Reflection.RuntimePropertyInfo.GetValue(Object obj, Object[] index) at MicroFour.StrataFrame.Business.ReflectionPropertyDescriptor.GetValue(Object component) at DevExpress.XtraReports.UI.XRBinding.GetImmediateColumnValue(XRDataContext dataContext, ImagesContainer images) at DevExpress.XtraReports.UI.XRBinding.GetColumnValue(XRDataContext dataContext, ImagesContainer images) at DevExpress.XtraReports.UI.XRBinding.UpdatePropertyValue(XRDataContext dataContext, ImagesContainer images) at DevExpress.XtraReports.UI.XRControl.UpdateBindingCore(XRDataContext dataContext, ImagesContainer images) at DevExpress.XtraReports.UI.XRFieldEmbeddableControl.UpdateBindingCore(XRDataContext dataContext, ImagesContainer images) at DevExpress.XtraReports.UI.XRControl.UpdateBinding(XRDataContext dataContext, ImagesContainer images) at DevExpress.XtraReports.UI.Band.GenerateContent(DocumentBand docBand, Int32 rowIndex, Boolean fireBeforePrint) at DevExpress.XtraReports.UI.Band.GenerateWithSubreports(DocumentBand docBand, Int32 rowIndex, Boolean fireBeforePrint) at DevExpress.XtraReports.Native.SelfGeneratedDocumentBand..ctor(RootDocumentBand root, DocumentBandKind kind, Band band, Int32 rowIndex, Boolean fireBeforePrint) at DevExpress.XtraReports.UI.Band.CreateDocumentBand(Int32 rowIndex, RootDocumentBand rootDocBand) at DevExpress.XtraReports.UI.Band.CreateDocumentBand(Band band, Int32 rowIndex, BandKind bandKind, RootDocumentBand rootDocBand) at DevExpress.XtraReports.Native.Printing.DocumentBuilder.CreateDocumentBand(BandKind bandKind, Int32 rowIndex) at DevExpress.XtraReports.Native.Printing.DocumentBuilder.CreateDocumentBand(BandKind bandKind) at DevExpress.XtraReports.Native.Printing.DocumentBuilder.Build() at DevExpress.XtraReports.Native.Printing.RootReportBuilder.Build() at DevExpress.XtraReports.UI.XtraReportBase.BuildDocument(DocumentBuilder builder) at DevExpress.XtraReports.UI.XtraReport.CreateDocument(PrintingSystem ps, Single progressRange) at DevExpress.XtraReports.UI.XtraReport.CreateDocument(Single progressRange) at DevExpress.XtraReports.UI.XtraReport.CreateDocument() at Aspire.Accounting.Invoicing.PrintInvoicesTSB_Click(Object sender, EventArgs e) in C:\Aspire Projects\AspireSF\Aspire.Accounting\Invoicingcs:line 239 at System.Windows.Forms.ToolStripItem.RaiseEvent(Object key, EventArgs e) at System.Windows.Forms.ToolStripButton.OnClick(EventArgs e) at System.Windows.Forms.ToolStripItem.HandleClick(EventArgs e) at System.Windows.Forms.ToolStripItem.HandleMouseUp(MouseEventArgs e) at System.Windows.Forms.ToolStripItem.FireEventInteractive(EventArgs e, ToolStripItemEventType met) at System.Windows.Forms.ToolStripItem.FireEvent(EventArgs e, ToolStripItemEventType met) at System.Windows.Forms.ToolStrip.OnMouseUp(MouseEventArgs mea) at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks) at System.Windows.Forms.Control.WndProc(Message& m) at System.Windows.Forms.ScrollableControl.WndProc(Message& m) at System.Windows.Forms.ToolStrip.WndProc(Message& m) at System.Windows.Forms.Control.ControlNativewindow.OnMessage(Message& m) at System.Windows.Forms.Control.ControlNativewindow.WndProc(Message& m) at System.Windows.Forms.Nativewindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam) ============== I have agonizingly walked a trace through every step. When it reaches the very last field in the very last BO (extprice), the process aborts and displays the above error. I have been really struggling with this for two full days. Can anyone give me some pointers on this? I do not think it is the DevEx report...I think it has to do with the BO, BBS or Datasource somewhere along the line. Thanks, Bill
|
By Bill Cunnien - 5/29/2008
I have worked around the error by replacing all calculated fields on the report with custom BO properties. For some reason, the report will not calculate simple things. Oh, well, it is better to have these kinds of things in the business object, anyway.Thanks, Bill
|
By Trent L. Taylor - 5/29/2008
Glad you got it going...we do not use XtraReports but rather Report Sharp-Shooter....we haven't had any issues on this side...however, we too generate custom properties many times...or, calculate this via the sproc or method that generates the results set depending on what we are trying to accomplish.
|
By Bill Cunnien - 5/29/2008
Yup...get it into the BO...experience is often a harsh, strict, but effective, teacher. Thanks.
|
By Trent L. Taylor - 5/29/2008
Exactly
|
|