Serialization error inside the TemplateReport activity
Hi all I am getting the following error it seems to be a serialization error inside the TemplateReport activity
Workflow 'Sale Report' failed. Cause: Geocortex.Workflow.WorkflowException: Aborted exception: 'There was an error generating the XML document.'. ---> System.InvalidOperationException: There was an error generating the XML document. ---> System.ArgumentException: Parameter is not valid.
at System.Drawing.Image._GetColorPalette()
at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationWriterBitmap.Write5_Bitmap(String n, String ns, Bitmap o, Boolean isNullable, Boolean needType)
at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationWriterBitmap.Write6_myFeatureMap(Object o)
at System.Xml.Serialization.XmlSerializer.Serialize(XmlWriter xmlWriter, Object o, XmlSerializerNamespaces namespaces, String encodingStyle, String id)
basically the workflow follows the below outline
QueryTask1 <return geometry true and SaleID>
SetMapExtent <SaleID_featureSet.Features(0).Geometry.Extent.Expand(1.5))>
ExportMap
QueryTask2 <no geometry all data for "SaleID = "+SaleID_featureSet.Features(0).Attributes("OBJECTID").ToString>
FeatureSetToDataTable <from QueryTask2 to datatable1 and set the tablename>
AddDataTableColumn <type system.drawing.bitmap>
- Query other featuresets and related tables
- AddDataTableColumn
- Assign < SaleDataTable.Rows(0).item("PID_Town") = ParcelFeatureSet.Features(0).Attributes("PID_Town").ToString>
Assign < SaleDataTable.Rows(0).item( "myMap" ) = new Bitmap( new System.IO.MemoryStream(SaleByteArray)) >
NewDataSet
AddToDataSet
AddToDataSet related tables
InvokeMethod < reportData.Relations Add >
{Alert works here}
TemplateReport
{Workflow fails before here}
CreateTempFile
DisplayHyperlink
Any Ides or input would be appreciated.
0
-
Hi Chris,
Are you writing any script in the Report Template?
Regards,
Mohammad Ashraf0 -
Was this issue ever resolved? I am experiencing the same error while working with bitmaps and template reports. 0 -
Hi all,
I would try to avoid sending bitmap and report data between the server and client. It often causes serialization errors, but even it didn't, there's usually no need for the user to interact with that data at that point. Normally the user needs access to the download link for the completed report, but not the report data itself. So sending the data back and forth would slow the workflow down anyways.
The solution is usually to use variable scoping.- Move all activities that generate bitmaps, datatables, datasets (and anything that belongs in between them) together inside a ServerScope activity. Typically the last two activities inside ServerScope will be TemplateReport and CreateTempFile.
- Then select the ServerScope activity, and open the Variables pane. Change the Scope property of any bitmap, datatable, or dataset type variables to the ServerScope. Make sure you don't change the scope of the variable that holds the url string for the report
- All client-side activities should go either before or after this ServerScope sequence. "Client-side activities" are ones usually found in the "Common Client" and "Common Viewer" sections of your toolbox, and they usually have a "debug" checkbox in their properties panel. The ServerScope activity will show you a warning icon if you try to put client-side activities in it, which will help you maintain this rule.
0
Bitte melden Sie sich an, um einen Kommentar zu hinterlassen.
Kommentare
3 Kommentare