An error occurred during local report processing. ---> Microsoft.Reporting.DefinitionInvalidException: The definition of the report 'xxx' is invalid - vb.net

I've a VB application which will use .rdl to generate reports in PDF format by using Microsoft.ReportViewer.WinForms.
There is an features which we allow the application to run without showing any UI to generate certain reports based on the setting in database. And we use task scheduler to run the application daily in the morning to generate some daily reports.
We have few client is using the same application with same rdl reports. But 1 of the client is keep getting the issue when task scheduler trigger the application while others is working fine.
The application will basically generate 11 reports everyday in the morning, but 1 of the report is keep throwing the exception whenever the task scheduler trigger it in the morning.
Microsoft.Reporting.WinForms.LocalProcessingException:
An error occurred during local report processing. Microsoft.Reporting.DefinitionInvalidException: The definition of the report 'xxx.rdl' is invalid.
But when we could not replicate the issue when we trigger the task scheduler or run the program manually afterwards.
Full error stack:
Error Message : Microsoft.Reporting.WinForms.LocalProcessingException: An error occurred during local report processing. ---> Microsoft.Reporting.DefinitionInvalidException: The definition of the report 'D:\EASI\AutoReport\SSRSReport\Report\1tic_movie_tax_report.rdl' is invalid. ---> Microsoft.ReportingServices.ReportProcessing.ReportProcessingException: An unexpected error occurred in Report Processing. ---> System.Runtime.InteropServices.COMException: Catastrophic failure (Exception from HRESULT: 0x8000FFFF (E_UNEXPECTED))
at System.Security.Policy.PEFileEvidenceFactory.GetLocationEvidence(SafePEFileHandle peFile, SecurityZone& zone, StringHandleOnStack retUrl)
at System.Security.Policy.PEFileEvidenceFactory.GenerateLocationEvidence()
at System.Security.Policy.PEFileEvidenceFactory.GenerateEvidence(Type evidenceType)
at System.Security.Policy.AssemblyEvidenceFactory.GenerateEvidence(Type evidenceType)
at System.Security.Policy.Evidence.GetHostEvidenceNoLock(Type type)
at System.Security.Policy.Evidence.GetHostEvidence(Type type, Boolean markDelayEvaluatedEvidenceUsed)
at System.Security.Policy.AppDomainEvidenceFactory.GenerateEvidence(Type evidenceType)
at System.Security.Policy.Evidence.GetHostEvidenceNoLock(Type type)
at System.Security.Policy.Evidence.RawEvidenceEnumerator.MoveNext()
at System.Security.Policy.Evidence.EvidenceEnumerator.MoveNext()
at System.Configuration.ClientConfigPaths.GetEvidenceInfo(AppDomain appDomain, String exePath, String& typeName)
at System.Configuration.ClientConfigPaths.GetTypeAndHashSuffix(AppDomain appDomain, String exePath)
at System.Configuration.ClientConfigPaths..ctor(String exePath, Boolean includeUserConfig)
at System.Configuration.ClientConfigPaths.GetPaths(String exePath, Boolean includeUserConfig)
at System.Configuration.ClientConfigurationHost.RequireCompleteInit(IInternalConfigRecord record)
at System.Configuration.BaseConfigurationRecord.GetSectionRecursive(String configKey, Boolean getLkg, Boolean checkPermission, Boolean getRuntimeObject, Boolean requestIsHere, Object& result, Object& resultRuntimeObject)
at System.Configuration.BaseConfigurationRecord.GetSection(String configKey)
at System.Configuration.ConfigurationManager.GetSection(String sectionName)
at System.Xml.Schema.Parser..ctor(SchemaType schemaType, XmlNameTable nameTable, SchemaNames schemaNames, ValidationEventHandler eventHandler)
at System.Xml.Schema.XmlSchema.Read(XmlReader reader, ValidationEventHandler validationEventHandler)
at Microsoft.ReportingServices.RdlObjectModel2005.Upgrade.UpgradeSerializerSettings2005.CreateReaderSettings()
at Microsoft.ReportingServices.RdlObjectModel2005.Upgrade.UpgradeImpl2005.CreateReaderSettings()
at Microsoft.ReportingServices.ReportProcessing.RDLUpgrader.RdlUpgrader.UpgradeFrom200501(XmlReader xmlReader, Boolean throwUpgradeException, Boolean upgradeDundasCRIToNative, Boolean renameInvalidDataSources, RDLUpgradeResult& upgradeResults)
at Microsoft.ReportingServices.ReportProcessing.RDLUpgrader.RdlUpgrader.UpgradeUnified(Stream stream, XmlReader xmlReader, String namespaceURI, Boolean throwUpgradeException, Boolean upgradeDundasCRIToNative, Boolean renameInvalidDataSources, RDLUpgradeResult& upgradeResults)
at Microsoft.ReportingServices.ReportProcessing.RDLUpgrader.RdlUpgrader.Upgrade(Stream stream, Boolean throwUpgradeException, Boolean upgradeDundasCRIToNative, Boolean renameInvalidDataSources, RDLUpgradeResult& upgradeResults)
at Microsoft.ReportingServices.ReportProcessing.RDLUpgrader.UpgradeToCurrent(Stream stream, Boolean throwUpgradeException, Boolean renameInvalidDataSources, RDLUpgradeResult& upgradeResults)
at Microsoft.ReportingServices.ReportPublishing.RdlObjectModelUpgradeStrategy.Upgrade(Stream definitionStream)
at Microsoft.ReportingServices.ReportPublishing.ReportPublishing.Phase1(Stream definitionStream, String& description, String& language, DataSourceInfoCollection& dataSources, DataSetInfoCollection& sharedDataSetReferences, Boolean& hasExternalImages, Boolean& hasHyperlinks)
at Microsoft.ReportingServices.ReportPublishing.ReportPublishing.InternalCreateIntermediateFormat(Stream definitionStream, String& description, String& language, ParameterInfoCollection& parameters, DataSourceInfoCollection& dataSources, DataSetInfoCollection& sharedDataSetReferences, UserLocationFlags& userReferenceLocation, ArrayList& dataSetsName, Boolean& hasExternalImages, Boolean& hasHyperlinks, Byte[]& dataSetsHash)
at Microsoft.ReportingServices.ReportProcessing.ReportProcessing.CompileOdpReport(PublishingContext reportPublishingContext, IDataProtection dataProtection, PublishingErrorContext errorContext, String& reportDescription, String& reportLanguage, ParameterInfoCollection& parameters, DataSourceInfoCollection& dataSources, DataSetInfoCollection& sharedDataSetReferences, UserLocationFlags& userReferenceLocation, ArrayList& dataSetsName, Boolean& hasExternalImages, Boolean& hasHyperlinks, Byte[]& dataSetsHash)
at Microsoft.ReportingServices.ReportProcessing.ReportProcessing.CreateIntermediateFormat(PublishingContext reportPublishingContext, IDataProtection dataProtection)
--- End of inner exception stack trace ---
at Microsoft.ReportingServices.ReportProcessing.ReportProcessing.CreateIntermediateFormat(PublishingContext reportPublishingContext, IDataProtection dataProtection)
at Microsoft.Reporting.ReportCompiler.CompileReport(ICatalogItemContext context, Byte[] reportDefinition, Boolean generateExpressionHostWithRefusedPermissions, ControlSnapshot& snapshot)
--- End of inner exception stack trace ---
at Microsoft.Reporting.ReportCompiler.CompileReport(ICatalogItemContext context, Byte[] reportDefinition, Boolean generateExpressionHostWithRefusedPermissions, ControlSnapshot& snapshot)
at Microsoft.Reporting.LocalService.GetCompiledReport(PreviewItemContext itemContext, Boolean rebuild, ControlSnapshot& snapshot)
at Microsoft.Reporting.LocalService.CompileReport()
at Microsoft.Reporting.WinForms.LocalReport.EnsureExecutionSession()
--- End of inner exception stack trace ---
at Microsoft.Reporting.WinForms.LocalReport.EnsureExecutionSession()
at Microsoft.Reporting.WinForms.LocalReport.GetParameters()
at SSRSReport.frmSsrsReport.SetReportParameter(String ReportTitle)
at SSRSReport.frmSsrsReport.ViewReport(Boolean showSplash)
at SSRSReport.frmMain.GenerateAutoReports(DateTime selectedDate)
Code:
1. rptViewer.LocalReport.ReportPath = fileName : executed on function [SSRSReport.frmSsrsReport.ViewReport]
2. rptViewer.LocalReport.GetParameters() : executed on function [SSRSReport.frmSsrsReport.SetReportParameter]

The main message error is same with my problem, but the details are little bit different.
At my case, I need to install MICROSOFT® REPORT VIEWER 2015 RUNTIME then the problem gone.
HTH

Same Error today:
Microsoft.Reporting.WebForms.LocalProcessingException: An error occurred during local report processing. ---> Microsoft.Reporting.DefinitionInvalidException: The definition of the report 'fileName.rdlc' is invalid. --->
The Case is when I develop using old VS2015, and now trying to use VS2019 with the RDLC tool..
The designer is upgrading rdlc file.
I must restore my rdlc file and back to old VS2015, and re-publish it..

Related

SharePoint 2019 - Stop Inheriting Permissions results in System.Web.HttpUnhandledException (0x80004005) error

After finishing up the installation of SharePoint 2019, I wanted to create a new document library. As I didn't want the library to inherit permissions from the root site, I clicked "Stop Inheriting Permissions". Unexpectedly, this resulted in an "Exception from HRESULT: 0x80131904" error. The ULS logs show the following:
05/10/2022 14:38:01.48 w3wp.exe (0x25F4) 0x41F0 SharePoint Foundation General ajlz0 High Getting Error Message for Exception System.Web.HttpUnhandledException (0x80004005): Exception of type 'System.Web.HttpUnhandledException' was thrown. ---> Microsoft.SharePoint.SPException: Exception from HRESULT: 0x80131904 ---> System.Runtime.InteropServices.COMException: Exception from HRESULT: 0x80131904 at Microsoft.SharePoint.Library.SPRequestInternalClass.ResetSecurityScope(String bstrUrl, UInt32 dwObjectType, String bstrObjUrl, Guid guidDoc, Boolean bUnique, Boolean bCopyRoleAssignments, Boolean bClearSubScopes, Guid& pguidScopeId, Int32& piError, Boolean bDontCopyLimitedPerms, Boolean bDontCopyLimitedPermsV2) at Microsoft.SharePoint.Library.SPRequest.ResetSecurityScope(String bstrUrl, UInt32 dwObjectType, String bstrObjUrl, Guid guidDoc, Boolean bUnique, Boolean bCopyRoleAssignments, Boolean bClearSubScopes, Guid& pguidScopeId, Int32& piError, Boolean bDontCopyLimitedPerms, Boolean bDontCopyLimitedPermsV2) --- End of inner exception stack trace --- at Microsoft.SharePoint.SPGlobal.HandleComException(COMException comEx) at Microsoft.SharePoint.Library.SPRequest.ResetSecurityScope(String bstrUrl, UInt32 dwObjectType, String bstrObjUrl, Guid guidDoc, Boolean bUnique, Boolean bCopyRoleAssignments, Boolean bClearSubScopes, Guid& pguidScopeId, Int32& piError, Boolean bDontCopyLimitedPerms, Boolean bDontCopyLimitedPermsV2) at Microsoft.SharePoint.SPSecurableObjectImpl.RevertRoleInheritance(Boolean copyRoleAssignments, Boolean clearSubScopes, Boolean dontCopyLimitedPerms, Boolean dontCopyLimitedPermsV2) at Microsoft.SharePoint.SPSecurableObjectImpl.BreakRoleInheritance(Boolean copyRoleAssignments, Boolean clearSubscopes, Boolean dontCopyLimitedPerms) at Microsoft.SharePoint.SPList.BreakRoleInheritance(Boolean copyRoleAssignments, Boolean clearSubscopes) at Microsoft.SharePoint.ApplicationPages.UserRoles.InitPage() at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint... 6c023ca0-3adc-207d-eeb2-d87973e802f3
After some research, I thought it would be a database-related issue, so I checked the parametrization. It was set to simple for every database, like the forums told me to do, so that didn't help either.
I also installed SharePoint 2019 on another server, the problem exists there as well.
Does anyone have a clue on this?
Thanks in advance.

Sitecore 7 ContentSearch crawling failure: "Crawler : AddRecursive DoItemAdd failed"

When we try to rebuild our Lucene (ContentSearch) indexes, our CrawlingLog is filled up with these exceptions:
7052 15:08:21 WARN Crawler : AddRecursive DoItemAdd failed - {5A1E50E4-46B9-42D5-B743-1ED10D15D47E}
Exception: System.AggregateException
Message: One or more errors occurred.
Source: mscorlib
at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
at System.Threading.Tasks.Task.Wait()
at System.Threading.Tasks.Parallel.PartitionerForEachWorker[TSource,TLocal](Partitioner`1 source, ParallelOptions parallelOptions, Action`1 simpleBody, Action`2 bodyWithState, Action`3 bodyWithStateAndIndex, Func`4 bodyWithStateAndLocal, Func`5 bodyWithEverything, Func`1 localInit, Action`1 localFinally)
at System.Threading.Tasks.Parallel.ForEachWorker[TSource,TLocal](IEnumerable`1 source, ParallelOptions parallelOptions, Action`1 body, Action`2 bodyWithState, Action`3 bodyWithStateAndIndex, Func`4 bodyWithStateAndLocal, Func`5 bodyWithEverything, Func`1 localInit, Action`1 localFinally)
at System.Threading.Tasks.Parallel.ForEach[TSource](IEnumerable`1 source, ParallelOptions parallelOptions, Action`1 body)
at Sitecore.ContentSearch.AbstractDocumentBuilder`1.AddItemFields()
at Sitecore.ContentSearch.LuceneProvider.CrawlerLuceneIndexOperations.GetIndexData(IIndexable indexable, IProviderUpdateContext context)
at Sitecore.ContentSearch.LuceneProvider.CrawlerLuceneIndexOperations.BuildDataToIndex(IProviderUpdateContext context, IIndexable version)
at Sitecore.ContentSearch.LuceneProvider.CrawlerLuceneIndexOperations.Add(IIndexable indexable, IProviderUpdateContext context, ProviderIndexConfiguration indexConfiguration)
at Sitecore.ContentSearch.SitecoreItemCrawler.DoAdd(IProviderUpdateContext context, SitecoreIndexableItem indexable)
at Sitecore.ContentSearch.HierarchicalDataCrawler`1.CrawlItem(Tuple`3 tuple)
Nested Exception
Exception: System.ArgumentOutOfRangeException
Message: Index and length must refer to a location within the string.
Parameter name: length
Source: mscorlib
at System.String.InternalSubStringWithChecks(Int32 startIndex, Int32 length, Boolean fAlwaysCopy)
at Sitecore.Data.ShortID.Encode(String guid)
at Sitecore.ContentSearch.FieldReaders.MultiListFieldReader.GetFieldValue(IIndexableDataField indexableField)
at Sitecore.ContentSearch.FieldReaders.FieldReaderMap.GetFieldValue(IIndexableDataField field)
at Sitecore.ContentSearch.LuceneProvider.LuceneDocumentBuilder.AddField(IIndexableDataField field)
at System.Threading.Tasks.Parallel.<>c__DisplayClass32`2.<PartitionerForEachWorker>b__30()
at System.Threading.Tasks.Task.InnerInvokeWithArg(Task childTask)
at System.Threading.Tasks.Task.<>c__DisplayClass11.<ExecuteSelfReplicating>b__10(Object param0)
This appears to be caused by the ShortID.Encode(string) method expecting the GUID in the string parameter to have brackets (" { " and " } ") around it. Some of our multilist field relationships were associated programmatically using Guid.ToString(), which does not include the brackets. Unfortunately, these values cause the ShortID.Encode() method to choke.
First things first: find all the places you call MultiListField.Add(string) and change Guid.ToString() to Guid.ToString("B"). This will resolve the issue for all new relationships.
Create a custom FieldReader class to replace the standard MultiListFieldReader (we called ours CustomMultiListFieldReader).
Set your custom class to inherit from Sitecore.ContentSearch.FieldReaders.FieldReader.
Decompile the Sitecore.ContentSearch.FieldReaders.MultiListFieldReader.GetFieldValue(IIndexableDataField) method into your custom class.
Before the if (ID.IsID(id)) line, add the following code:
if (!str.StartsWith("{") && !str.EndsWith("}"))
id = String.Format("{{{0}}}", str);
In your index configuration (we added ours to the default, Sitecore.ContentSearch.DefaultIndexConfiguration.config) change the fieldReaderType for the MultiList fields to your custom type. (This can be found in your config at sitecore/contentSearch/configuration/defaultIndexConfiguration/fieldReaders/mapFieldByTypeName/fieldReader.)
Full disclosure: I don't love this approach because if the default implementation of the MultiListFieldReader ever changed, we'd be without those changes. But this allows the items to be included in the index without reformatting all of the GUIDs in every multilist field.

Program Does Not Run On Win XP But Will Run On Win7

So I designed a program using Visual Studio 2010 on a Win7 box. For the sake of this the program is called Test.exe
When another user, using Win XP tries to open this program, it pops up a Just In Time Debugger window and never runs. I can open the program on my Win7 box and additional Win7 boxes and each time the program opens.
I'm not exactly sure where to begin to figure out why Win XP machines fail to run this program.
Any suggestions?
EDIT
Here is the exception error we got but running the debugger on the XP machine.
System.InvalidOperationException was unhandled
Message=An error occurred creating the form. See Exception.InnerException for details. The error is: Exception has been thrown by the target of an invocation.
Source=WinApp
StackTrace:
at WinApp.My.MyProject.MyForms.Create_Instance_[T](T Instance)
at WinApp.My.MyProject.MyForms.get_Form1()
at WinApp.My.MyApplication.OnCreateMainForm()
at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun()
at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationModel()
at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(String[] commandLine)
at WinApp.My.MyApplication.Main(String[] Args)
InnerException: System.Reflection.TargetInvocationException
Message=Exception has been thrown by the target of an invocation.
Source=mscorlib
StackTrace:
at System.RuntimeMethodHandle._SerializationInvoke(IRuntimeMethodInfo method, Object target, SignatureStruct& declaringTypeSig, 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.LoadObject(Int32 pos, ResourceTypeCode& typeCode)
at System.Resources.RuntimeResourceSet.GetObject(String key, Boolean ignoreCase, Boolean isString)
at System.Resources.RuntimeResourceSet.GetObject(String key, Boolean ignoreCase)
at System.Resources.ResourceManager.GetObject(String name, CultureInfo culture, Boolean wrapUnmanagedMemStream)
at System.Resources.ResourceManager.GetObject(String name)
at WinApp.Form1.InitializeComponent()
at WinApp.Form1..ctor()
InnerException: System.ComponentModel.Win32Exception
Message=The parameter is incorrect
Source=System.Drawing
ErrorCode=-2147467259
NativeErrorCode=87
StackTrace:
at System.Drawing.Icon.Initialize(Int32 width, Int32 height)
at System.Drawing.Icon..ctor(SerializationInfo info, StreamingContext context)
InnerException:
You'll need to make sure that the Windows XP system has the appropriate version of the .NET Framework installed.
Also, there are many types that will not work on XP within .NET framework 4. For example, if you use the MD5Cng class, you'll see (in the "Platforms" section of the docs) that it's only supported on Vista+, not on XP. Using this class in a program will cause an exception if it's run on XP.
Edit:
From your stack trace, it looks like your Form (WinApp.Form1) is using an Icon (.ico) which is a format that is unsupported by Windows XP. For example, if you use a full color icon, this can raise an exception on XP. Make sure it's a 256 color icon file to work properly on XP.

Updating/Inserting is not supported by data source

I've been making my first ASP.NET Visual Studio website and I have just started working with databases, I've made a table and a backoffice page for me to control the content of my table.
This page follows the following rules:
-> I've added the SQLDataSource and configured.
-> I've added a gridview to see my content and configured it to my SQLDataSource, here I've added the Edit/Delete options.
-> I've added a DetailsView configured to my SWLDataSource, here I've added New option (to create new entries in my table)
My database has the id column set as primary key (data type=int; allow nulls=not checked)
Every time I try to update my data base through this backoffice page I get the following error:
Updating is not supported by data
source 'SqlDataSource1' unless
UpdateCommand is specified.
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.NotSupportedException: Updating
is not supported by data source
'SqlDataSource1' unless UpdateCommand
is specified.
Source Error:
An unhandled exception was generated
during the execution of the current
web request. Information regarding the
origin and location of the exception
can be identified using the exception
stack trace below.
Stack Trace:
[NotSupportedException: Updating is
not supported by data source
'SqlDataSource1' unless UpdateCommand
is specified.]
System.Web.UI.WebControls.SqlDataSourceView.ExecuteUpdate(IDictionary
keys, IDictionary values, IDictionary
oldValues) +1644420
System.Web.UI.DataSourceView.Update(IDictionary
keys, IDictionary values, IDictionary
oldValues,
DataSourceViewOperationCallback
callback) +92
System.Web.UI.WebControls.GridView.HandleUpdate(GridViewRow
row, Int32 rowIndex, Boolean
causesValidation) +907
System.Web.UI.WebControls.GridView.HandleEvent(EventArgs
e, Boolean causesValidation, String
validationGroup) +704
System.Web.UI.WebControls.GridView.OnBubbleEvent(Object
source, EventArgs e) +95
System.Web.UI.Control.RaiseBubbleEvent(Object
source, EventArgs args) +37
System.Web.UI.WebControls.GridViewRow.OnBubbleEvent(Object
source, EventArgs e) +123
System.Web.UI.Control.RaiseBubbleEvent(Object
source, EventArgs args) +37
System.Web.UI.WebControls.LinkButton.OnCommand(CommandEventArgs
e) +118
System.Web.UI.WebControls.LinkButton.RaisePostBackEvent(String
eventArgument) +135
System.Web.UI.WebControls.LinkButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String
eventArgument) +10
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler
sourceControl, String eventArgument)
+13 System.Web.UI.Page.RaisePostBackEvent(NameValueCollection
postData) +175
System.Web.UI.Page.ProcessRequestMain(Boolean
includeStagesBeforeAsyncPoint, Boolean
includeStagesAfterAsyncPoint) +1565
I could really use some help here!
The errormessage says it all : 'Updating is not supported by data source 'SqlDataSource1' unless UpdateCommand is specified.'. You have to assign sql code or the name of a stored procedure to the property UpdateCommand so that the SqlDataSource knows how to handle your update.

Intermitant DefinitionInvalidException with windows forms ReportViewer 2008

I've got some RDL using it in a (windows forms) .net 2.0 app.
When user clicks around in app, rdl is reloaded into report viewer.
For the same RDL I sometimes get the error, sometimes not.
When I run my app debugging in Visual Studio it never gets the error.
Immediately after running, I launch the exe from the bin folder and now I get errors (but only 50% of the time the report gets refreshed)
The Exception occurs when I call ReportViewer.RefreshReport
I've looked through the RDL at every place where there is a minOccurs and they are all either "0" or "1".
Interestingly if I call Application.DoEvents() immediately before I call RefreshReport I can but the amount of time the error happens down to 5%... but it still occasionally happens!
The definition of the report 'Main Report' is invalid.
, An unexpected error occurred in Report Processing.
, The value for the 'minOccurs' attribute is invalid - The value for the 'minOccurs' attribute must be xsd:nonNegativeInteger..
(DefinitionInvalidException)
Stack Trace:
Microsoft.Reporting.DefinitionInvalidException: The definition of the report 'Main Report' is invalid. ---> Microsoft.ReportingServices.ReportProcessing.ReportProcessingException: An unexpected error occurred in Report Processing. ---> System.Xml.Schema.XmlSchemaException: The value for the 'minOccurs' attribute is invalid - The value for the 'minOccurs' attribute must be xsd:nonNegativeInteger..
at System.Xml.Schema.XmlSchema.Read(XmlReader reader, ValidationEventHandler validationEventHandler)
at System.Xml.Schema.XmlSchema.Read(Stream stream, ValidationEventHandler validationEventHandler)
at Microsoft.ReportingServices.ReportProcessing.ReportPublishing.RmlValidatingReader..ctor(XmlTextReader textReader, PublishingErrorContext errorContext, String targetRDLNamespace)
at Microsoft.ReportingServices.ReportProcessing.ReportPublishing.RmlValidatingReader.CreateReader(XmlTextReader upgradedRDLReader, PublishingErrorContext errorContext, String targetRDLNamespace)
at Microsoft.ReportingServices.ReportProcessing.ReportPublishing.Phase1(CatalogItemContext reportContext, Byte[] definition, CreateReportChunk createChunkCallback, CheckSharedDataSource checkDataSourceCallback, String& description, String& language, DataSourceInfoCollection& dataSources, UserLocationFlags& userReferenceLocation, Boolean& hasExternalImages, Boolean& hasHyperlinks)
at Microsoft.ReportingServices.ReportProcessing.ReportPublishing.CreateIntermediateFormat(CatalogItemContext reportContext, Byte[] definition, CreateReportChunk createChunkCallback, CheckSharedDataSource checkDataSourceCallback, PublishingErrorContext errorContext, AppDomain compilationTempAppDomain, Boolean generateExpressionHostWithRefusedPermissions, String& description, String& language, ParameterInfoCollection& parameters, DataSourceInfoCollection& dataSources, UserLocationFlags& userReferenceLocation, ArrayList& dataSetsName, Boolean& hasExternalImages, Boolean& hasHyperlinks)
at Microsoft.ReportingServices.ReportProcessing.ReportProcessing.CompileReport(CatalogItemContext reportContext, Byte[] reportDefinition, CreateReportChunk createChunkCallback, CheckSharedDataSource checkDataSourceCallback, PublishingErrorContext errorContext, AppDomain compilationTempAppDomain, Boolean generateExpressionHostWithRefusedPermissions, String& reportDescription, String& reportLanguage, ParameterInfoCollection& parameters, DataSourceInfoCollection& dataSources, UserLocationFlags& userReferenceLocation, ArrayList& dataSetsName, Boolean& hasExternalImages, Boolean& hasHyperlinks)
at Microsoft.ReportingServices.ReportProcessing.ReportProcessing.CreateIntermediateFormat(CatalogItemContext reportContext, Byte[] reportDefinition, CreateReportChunk createChunkCallback, CheckSharedDataSource checkDataSourceCallback, AppDomain compilationTempAppDomain, Boolean generateExpressionHostWithRefusedPermissions)
--- End of inner exception stack trace ---
at Microsoft.ReportingServices.ReportProcessing.ReportProcessing.CreateIntermediateFormat(CatalogItemContext reportContext, Byte[] reportDefinition, CreateReportChunk createChunkCallback, CheckSharedDataSource checkDataSourceCallback, AppDomain compilationTempAppDomain, Boolean generateExpressionHostWithRefusedPermissions)
at Microsoft.Reporting.ReportCompiler.CompileReport(CatalogItemContext context, Byte[] reportDefinition, Boolean generateExpressionHostWithRefusedPermissions, ReportSnapshotBase& snapshot)
--- End of inner exception stack trace ---
at Microsoft.Reporting.ReportCompiler.CompileReport(CatalogItemContext context, Byte[] reportDefinition, Boolean generateExpressionHostWithRefusedPermissions, ReportSnapshotBase& snapshot)
at Microsoft.Reporting.StandalonePreviewStore.StoredReport.CompileReport()
at Microsoft.Reporting.StandalonePreviewStore.StoredReport.get_Snapshot()
at Microsoft.Reporting.StandalonePreviewStore.GetCompiledReport(CatalogItemContext context, Boolean rebuild, ReportSnapshotBase& snapshot)
at Microsoft.Reporting.LocalService.GetCompiledReport(CatalogItemContext itemContext, Boolean rebuild, ReportSnapshotBase& snapshot)
at Microsoft.Reporting.LocalService.CompileReport(CatalogItemContext itemContext, Boolean rebuild)
at Microsoft.Reporting.WinForms.LocalReport.CompileReport()
Instead of
ReportViewer.RefreshReport
Doing this seemed to fix it.
Application.DoEvents()
ReportViewer.LocalReport.ExecuteReportInCurrentAppDomain(Reflection.Assembly.GetExecutingAssembly().Evidence)