I get following error on subreport "data retrieval failed for the subreport please check the log files". When I run separate reports it works fine but when I include as subreport it gives the above error. Pleas help me thanks.
The actual text is down to when you don't call this in the SubreportProcessing event handler of the ReportViewer.LocalReport object.
Dim tbl As DataTable = GetDataForYourSubReport()
Dim rptDataSource As New ReportDataSource("DataSet1", tbl)
e.DataSources.Add(rptDataSource)
The error message from the report viewer component is particularly unhelpful though, there are no log files, it's talking about log files from the application that may or may not exist!!
I had the same error mesage where on some machines you got the error you describe but on some you don't.
It was due to the fact that the e.ReportPath was null where it should have contained the report name.
This lack of ReportPath Was a bug in an older version of the Report Viewer DLL that was installed in the GAC on the machines where it breaks (The one that ships with SQL Server 2012 has a bug where the e.ReportPath parameter is passed in as null)
If you do have code in the SubreportProcessing event handler get the "machine specific" behaviour then try downloading and installing the latest "Microsoft Report Viewer 2012 runtime" on the machines where it breaks.
https://www.microsoft.com/en-us/download/details.aspx?id=35747
Related
I’m suffering a frustrating error for the last two weeks in a vb.net application developed for my company.
The application consists of a basic interface (Windows Form Application) to get some data (file paths and coordinates) and then processes a lot of information coming from a steel structure modelled in an external application called Staad.Pro (very common in the Oil & Gas sector) and from several Excel files.
So it gets external information from two sources:
A Staad.Pro file, through the library openstaad.dll,distributed with
Staad.Pro.
Some Excel files, through the ADO Connection and Recordset objects.
The application has been used satisfactorily for three years. I recently made some changes to introduce the background process of the data and the definition of the configuration for every project company using an external Excel file, which was previously defined at code level.
This configuration file is read directly in Excel opening an application instance (Excel), while the others Excel files are opened using ADO as I said previously. At the same time, the configuration file path is defined in a single text file, that it is always used by the application to read that path, which content can be modified using the application through an OpenFileDialog object.
I specify in particular those points because they are the changes I made before the error occurrence. There have been also two weeks of inactivity because of my holidays, during which some Windows updates have been released (I suppose some of them are related to the popular ransomware Wannacry and Petya).
So the error message I get running the application in VS Community 2015 is the following:
An unhandled exception of type 'System.AccessViolationException'
occurred in mscorlib.dll.
Additional information: Attempted to read or
write protected memory. This is often an indication that other memory
is corrupt.
It appears when the application opens the second ADO connectionn to an Excel file with the following code:
cnn1.Open("Provider=Microsoft.ace.OLEDB.12.0;" &
"Data Source=" & rutaarchivo & ";" &
"Extended Properties=""Excel 12.0;HDR=Yes"";")
The first connection is closed and the corresponding object is set to Nothing. I changed the way of access to this file trying to understand the error, avoiding ADO, but the error arises again in a later connection to another Excel file with ADO, that is again the second ADO connection after the changes.
The error arises randomly, in such a way that when the project is just opened in VS Community 2015 and then it is run for the first time, no error appears (usually), but it does after a second execution.
Other times the error arises at the call to the subroutine that makes the ADO connection to the Excel file, not at the code of the subroutine itself, with a different message:
Managed Debugging Assistant 'FatalExecutionEngineError' has detected a
problem in (path).
Additional Information: The runtime has encountered
a fatal error. The address of the error was at 0x79f387d1, on thread
0x168c. The error code is 0xc0000005. This error may be a bug in the
CLR or in the unsafe or non-verifiable portions of user code. Common
sources of this bug include user marshaling errors for COM-interop or
PInvoke, which may corrupt the stack.
When looking for an error pattern I found another error that appears when I use for the second time the same type of object of the library openstaad.dll, with the following message:
An exception of type 'System.Runtime.InteropServices.COMException'
occurred in Microsoft.VisualBasic.dll but was not handled in user code
Additional information: La memoria está bloqueada. (Excepción de
HRESULT: 0x8002000D (DISP_E_ARRAYISLOCKED))
I’ve found two main articles on the internet about this error (System.AccessViolationException):
Programs randomly getting System.AccessViolationException
https://www.codeproject.com/Questions/106826/OpenFileDialog-OleDbConnection-AccessViolationExce
I’ve tried to reinstall Access Database Engine, to define the environment variable that is mentioned and to change the .NET Framework version. Nothing works.
Any help to solve this problem will be appreciated.
Alberto Ruiz
I experienced the same error recently after the second use of an Microsoft.ACE.OLEDB.12.0 connection, to MS Access in this case.
What helped for me was wrapping the connection in a new Thread.
For example: if your problematic code that opens the connection is in method OpenExcel you could do the following:
(new Thread(() => OpenExcel())).Start();
Hope this helps.
I've created a report in Pentaho Report Designer 6.0.1 with dependent parameters. Published the same to Pentaho BI Server 6.1. The report runs perfectly in the PRD in Preview and i'm able to see the data. Also, there are no errors thrown during publishing the report as well. But after publishing, when i try to launch the report, the link opens up blank with the loading spinner just rotating forever. I checked the logs in the biserver as well (catalina.out and pentaho.log), apart from 1 error during launch (java.io.UTFDataFormatException: encoded string too long: 78805 bytes), there is no other error seen. Not even during the report load.
Can someone please tell me what is going wrong here?
Check your SQL behind the report. I've had some similar problems whilst trying to run some reports from the server on 6.0.
The problem I faced had to do with me not manually typing the correct typecasts. e.g. active = 1 instead of active = TRUE (basically I was creating "bad" SQL's). After I made those changes they launched correctly again.
I've had my PC since Sept 2014 and really want to use Power Pivot in Excel. I have Windows 8.1 64bit running stand alone Excel 2013 32bit (purchased Sept 2014)
I have never been able to get Power Pivot to load, the Add-in appears on the ribbon but only produces the errors described below.
I have MySQL installed, Visual Studio 2010 for Office Runtime (x64), Open Office with text only enabled.
I've run the Configuration Analyzer Tool (OffCAT) which only showed a problem with Outlook which is fine ( I think! ) as I don't use it and reinstalled both Excel and the add-in.
If anyone can shed some light on or solve this problem it would be greatly appreciated. I've read somewhere (forgot to bookmark) about editing script in one of the config files as there could be an accidental 'space' in the code, if I could find where I read that maybe that would help or solve this. I see somebody posted the exact same error elsewhere a few months back but received no answer so maybe this can't be rectified.
Here are the errors I recieve:
"We couldn't get data from the Data Model. Here's the error message we got:
The type initializer for 'Microsoft.Analysis.Services.XmlaClient' threw an exception.
Configuration system failed to initialize.
Root element is missing. (C\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine\config)
Root element is missing."
When I close this error another box appears:
Sorry, PowerPivot can't openthe Data Model because there was a COM exceptionwhile opening.
You might be opening a workbook on a corrupt installation of excel. Click Details for more information.
When I click 'Details' this appears:
============================
Error Message:
============================
Object reference not set to an instance of an object.
============================
Call Stack:
============================
at Microsoft.Office.PowerPivot.ExcelAddIn.InProcServer.CannotUpgrade(GeminiWorkbook geminiWb, WorkbookConnection wbConn, String& message)
at Microsoft.Office.PowerPivot.ExcelAddIn.InProcServer.LoadSandboxAfterConnection(String errorCache)
at Microsoft.Office.PowerPivot.ExcelAddIn.InProcServer.LoadSafeSandboxAfterConnection(String errorCache)
at Microsoft.Office.PowerPivot.ExcelAddIn.InProcServer.LoadOLEDBConnection(Boolean raiseCompleteEvent, String errorCache)
============================
I received a pointer from someone called 'scottsen' over at Mr.Excel who suggested I re-installed Microsoft.Net 4 framework.
So that's what I did and now it works just fine (til I find a way to break it!).
Case solved.
i have a solution developed in VS 2008 and 3.5 in VB with almost 38 projects (class libraries) in it. This whole thing is big project with almost 140 reports (crystal reports) in it.
now i install Visual Studio 2012 Ultimate with Crystal Report (CRforVS_13_0_7)
and upgraded my solution to .net 4.5 everything works fine.
some of my reports uses a library written in VB.net CRUFL for InWord support in indian rupee format
now i am facing problem with upgrading reports to new crystal report format.
when i open any report file and verify and save it asks me to save in new crystal report format if i choose yes to upgrade i get error from crystal code generator
Custom tool error: "Code generator 'ReportCodeGenerator' failed. Exception stack = CrystalDecisions.Shared.CrystalReportsException: Load report failed. ---> System.Runtime.InteropServices.COMException: UFL 'u212com.dll' that implements this function is missing.
Error in File repAbstract {B0F50159-6708-4E3E-A668-899D0616325C}.rpt:
Error in formula drInWord:
'UniSuiteReportingEXReportingEXToWords (ABS(Sum ({#drAmount})))'
UFL 'u212com.dll' that implements this function is missing.
at CrystalDecisions.ReportAppServer.ClientDoc.ReportClientDocumentClass.Open(Object& DocumentPath, Int32 Options)
at CrystalDecisions.ReportAppServer.ReportClientDocumentWrapper.Open(Object& DocumentPath, Int32 Options)
at CrystalDecisions.ReportAppServer.ReportClientDocumentWrapper.EnsureDocumentIsOpened()
--- End of inner exception stack trace ---
at CrystalDecisions.ReportAppServer.ReportClientDocumentWrapper.EnsureDocumentIsOpened()
at CrystalDecisions.CrystalReports.Engine.ReportDocument.Load(String filename, OpenReportMethod openMethod, Int16 parentJob)
at CrystalDecisions.CrystalReports.Engine.ReportDocument.Load(String filename)
at CrystalDecisions.VSDesigner.CodeGen.ReportClassWriter..ctor(String filePath)
at CrystalDecisions.VSDesigner.CodeGen.ReportClassWriter..ctor(String filePath, String resourceNamespace)
at CrystalDecisions.VSDesigner.CodeGen.ReportCodeGenerator.GenerateCode(String inputFileName, String inputFileContent)" Z:\World Of Programming\Product\VS .Net\Products\Uni Suite\Uni Suite 2.0\Uni_Suite.Reports\repAbstract.rpt 1 1 Uni_Suite.Reports
What I figured out that the problem is with CRUFL function,
If I comment function in formula and just return normal string in it
and flow the process report upgrades and works fine.
If I add new report and use this function is formula that also works
fine.
I created completely new library written in 4.5 for any upgrading
wizard errors but the behavior is same.
This is clear I cannot create all these reports again in new version, count is huge and some of them are very complex.
Am I missing something of is there anything I have to study first before upgrading my project
Please suggest
one more thing OS is windows 8.1 Pro
Found a temporary solution for it. This seems to be a bug in crystal designer in visual studio on windows 8.1
Temporary solution is:
Right click on report file and select properties
Remove “CrystalDecisions.VSDesigner.CodeGen.ReportCodeGenerator” from
Custom Tool.
Now report designer will not raise any error for any changes or
testing, do updates or changes and save report.
Close designer of report
Now open properties and past
“CrystalDecisions.VSDesigner.CodeGen.ReportCodeGenerator” in custom
tool and press enter. This will generate code for report without any
error and report will also work fine
This will generate code for report without any error and report will also work fine
This definitely a bug in crystal report for visual studio I don’t know how to submit this bug to SAP but I will search and submit this to crystal report to help them improve this. Meanwhile this is a solution worked for me.
you can find communication regarding this here http://scn.sap.com/thread/3452634
EDIT
but now new issue after using above method report is not accepting any select filter and showing all data from database with select statement.
working on it... any help please
EDIT
Found solution for this also amazing, this is happening only with reports with UFL in same viewer OK
found solution here http://scn.sap.com/message/8179989#8179989
what you have to do is to remove following two lines from from designer where your viewer control is.
crystalReportViewer.SelectionFormula = ""
crystalReportViewer.ViewTimeSelectionFormula = ""
EDIT
now i updated my crystal report to service pack 8 (v. 13.0.8.1216)
Link http://scn.sap.com/docs/DOC-7824
But no luck still using method mentioned above
EDIT
i updated to crystal report service pack 10 (v.13.0.10.1385) & VS 2013 (64Bit windows 8.1 update 1)
but still no luck, using above method
I received a similar error code in C# VS2010. I got it when adding Parameter fields to SubReports. It seems to happen before I link a field to the Parameter from the Main report. Just setting the links after creating the parameter seems to make the error go away again.
I know this is an old post but I got this error and my fix was different...
Basically the error is responding to an out of date EF formula. I got the following answer through Viewpoint support..
OLD func. syntax throwing error: EFCityStateZip ({APPB.City},{APPB.State}, {APPB.Zip})
New func. syntax that works: ({APPB.City}&', '&{APPB.State}&' '& {APPB.Zip})
We are running Crystal Reports on a Windows Server 2008 with .NET framework 3.5 SP1.
I have seen many causes of the general error "The request could not be submitted for background processing." on other forums, however they tend to be persistent and repeatable affecting just a single report due to a specific formatting issue with a specific report.
We are seeing this error with the below stack trace, intermittently.
It affects multiple different reports we have.
It affects one particular report more frequently than other reports.
Once a report is affected the same error will often appear in multiple reports at approximately the same time eg. for the next 10 minutes.
The same report run with the same parameters may work when run again (soon after) or the application may need restarting before the report can be successfully re run.
These reports all worked previously without issue. No change in server or code seems apparent which would have precipitated this error. All code behind for this is VB.NET
We have had difficulty reproducing it in test environments and upgrading to the latest version of Crystal has not helped at all.
Any help or suggestions that you might be able to make to resolve this issue would be appreciated.
"The request could not be submitted for background processing."
at CrystalDecisions.ReportAppServer.Controllers.DatabaseControllerClass.ReplaceConnection(Object oldConnection, Object newConnection, Object parameterFields, Object crDBOptionUseDefault)
at CrystalDecisions.CrystalReports.Engine.Table.SetDataSource(Object val, Type type)
at CrystalDecisions.CrystalReports.Engine.ReportDocument.SetDataSourceInternal(Object val, Type type)
--- End of inner exception stack trace ---
at CrystalDecisions.ReportAppServer.ConvertDotNetToErom.ThrowDotNetException(Exception e)
at CrystalDecisions.CrystalReports.Engine.ReportDocument.SetDataSourceInternal(Object val, Type type)
at CrystalDecisions.CrystalReports.Engine.ReportDocument.SetDataSource(DataSet dataSet)
at "USER CODE"
After many days, finally I discovered what is the root of problem, in case you are including jpg images in your report.
The thing is that CR for VS2008 or later versions, can’t handle jpg files in CMYK mode. CR only can handle jpg files in RGB mode.
It’s funny that lower versions of CR (the one that came with VS2003) could handle any kind of jpg files. Thanks, Crystal.
For me the issue was with the Temporary Crystal Report that gets generated in the TEMP folder in Windows. There is a limit to the number of Temporary Crystal Reports that can be generated by Crystal report engine while processing it in a loop. Either the space in Temp folder runs out due to low memory in C drive or the limit of reports is reached after which in one single run crystal report cannot export further. It will give the error mentioned in question.
For me this issue was recurring at every 500 reports that were processed (I was generating the reports say, for a year and exporting them to a system folder one by one using my application)
The solution is simple. Always close and dispose the temporary .rpt Crystal Report file after exporting it .
for i as integer=0 to reportcount -1
Dim rpt as New MyCrystalReport
Dim filename as String = "MyReport" & i & ".Pdf"
//Query the DB obtain the dataset then set the datasource to the report
...
//Export the report
rpt.ExportToDiskCrystalDecisions.Shared.ExportFormatType.PortableDocFormat,fileName)
rpt.Close()
rpt.Dispose()
next
Isolate the report generation code.
Our final resolution was to take the code that was generating the report and move it into its own isolated service. Our original service then calls our new Crystal service with the relevant parameters and Crystal RPT file. This is obviously a costly solution as it involves modifying all report generation code to call the Crystal service instead. The Crystal service does not exhibit the error. The code had not changed besides that, so we can only presume the cause of the error was some interaction of the Crystal reports engine and the environment within our application.
Is there a chance the report object is leaked in the server's memory? I ran into a similar case where the report object was being stored into a Session object, so the report didn't need to get reloaded as the user navigated between pages. However, when the user was done with the report, the object remained in the Session, and wasn't cleaned up properly when the Session was destroyed by the server. I had to add a bit of code in the Session_End event in global.asax to find the report object and call the dispose method on it.
The fact that this appears intermittently but then affects all reports for a matter of 10 minutes makes me think it could be session-related. In my situation the server reached a limit on the number of reports that could be created on the server (in memory) because they weren't being released. The symptoms were similar to yours.
Hope this helps!
Try this: If you left any blank space at crystal report(header,footer or any sections) suppress it. that's all. I had this problem and i fixed this way.
I too have come across such issue, where I figured out the Column having Photographs was creating the issue. The way out was to convert the photograph (Datatype Image in SQL Server) from .NET Data set to byte and then save it as Bitmap. After , that this same BMP file can be converted to bytes and replaced to appropriate column of the identified row. By this the space reduced to a great extend and then after exporting the Report document and Datatable was disposed properly.