Operation Not Implemented Exporting Excel (Data Only) Crystal Reports 2008 - c#

I'm trying to deploy an application to a client's server, but export to Excel (Data Only) is not working, giving me the "Operation Not Implemented" error. It isn't a problem with the report, because I have over 50 reports with standard fonts, some of them very simple, and the export fails for all of them.
I have the feeling the incorrect version of exportmodeller.dll and crtslv.dll are being used, because the client seems to have some sort of logon script which appears to copy a CR8.5 version of the crystal reports libraries and register them with COM.
I attempted to automatically make a manifest file for my main executable to force it to use the correct version, but this didn't change anything.
Might I have missed something, or do you think I'm completely on the wrong track?

I narrowed the problem down to being related to a format issue with the report. It just happens to not affect my Windows 7 dev machine.
On the Windows Server 2003 R2 (x64) machine, if I remove the Print Date and Print Time special fields, it will export to xls (Data Only) successfully.
I did also notice that the process loads ATL.DLL on the Windows 7 box, but not the Windows Server box. I gather that could somehow be related.
So, a solution to my problem is to remove those fields. Full points if anyone can offer some advice which would prevent me from having to edit all of my reports.
Update: If I use a specific date/time format in my reports instead of "System Default Format" it also works.

Related

Crystal Reports won't log into mssql-Database in Windows 10 64 Bit System from installed Visual .net-project

The Problem:
We have a software-project coded in C#/.Net with report functions builded on Crystal Reports. This project worked for years with this functions until someday it came to a strange error. If the project was installed on a 64-Bit Windows System Crystal Reports won't log in into the Report-Viewer. This means, before the report was shown to the user, there will be a window, in which you have to insert your credentials of your Database. Sadly after giving the credentials, no login will be performed, instead there will be a message telling the user that the login failed. And after that the login box returns. It doesn't matter, what you insert into the password or user field, there won't be a login.
Login Screen Image
Login Issue Image
Well, this error could be solved by installing the 32-Bit version of the sql-native Client from 2005 or 2008 instead of the 64-Bit version. But now Windows 10 64 Bit doesn't allow to install a 32-Bit version of this native sql clients. Therefore the old fix doesn't work anymore and the problem returned.
This question is discussing the same problem (like many other threads), without a solution.
Stackoverflow Question asking kind of the same question
We have two computers with windows 10 64 bit on which the problem occurs. On one of them, the login window has no database selected (visible in the database-field). On the other computer, this field is correctly filled with the database. We found no difference in the behavior of both issues, except from the empty field. We tested, if the database wasn't correctly given to Crystal Report. It was, but the field still remained empty on one of the computers. This issue is also discussed on the internet without a solution (at least I couldn't find some). As an example, in the following link the problem with the empty Database-field is discussed.
Example with a question about the empty database field.
The "best" solution in the thread above is "There is no solution to this problem. Regards [...]", wich is not a good solution.
There is another oberservation. The problem doesn't occure, if the windows 10 System is an upgrade from a lower system, on which the 32-bit version of the Sql-Native-Clients was installed. Therefore, Crystal Report can run indeed on windows 10 64 bit, if the correct environment could be installed. But we can't install the needed clients on the freshly installed 64-bit systems.
What was done until this question:
Cause the Code does work on every other system, except from a freshly installed Windows 10 64-bit one, we haven't looked into the Code deeply for the fixing. Instead we concentrated firstly on internet research and secondly on trying to get the sql native clients 32-bit on the new systems (or at least the needed dlls). Therefore we tested:
Registry Solution
Cause a research-founding, we tried to add the registry entries under "SAP BusinessObjects" into the "WOW6432Node", if it wasn't there. This didn't fix anything at all.
DLL Copies
We tried to determine the dll-files installed by the sql-native Clients 32-bit and manually copy them into the folders. But all the systems already had them.
We unziped the msi for the native clients and tested for the dlls in the msi directly. Also we searched for the files, that will be copied into the System32 folder directly and found them.
(German) Microsoft site with information about dlls
"Die SQL Server Native Client-Dateien (sqlncli11.dll, sqlnclir11.rll und s11ch_sqlncli.chm) werden in folgendem Verzeichnis installiert:
%SYSTEMROOT%\system32\"
Meaning: The SQL Server Native Client-files (sqlncli11.dll, sqlnclir11.rll and s11ch_sqlncli.chm) will be installed in the following folder:
%SYSTEMROOT%\system32\
So we checked for this files and also for the sqlncli...dll files with lower version (10). They were in the system folders.
Cause the dlls may not be compiled in the GAC folder, this may not be the solution at all (cause we can't write them into the folder without installing the 32-bit versions).
Installing all the avaiable sql-native clients for 64 bit
Hoping, that one of the versions had the needed files in them, we installed all the version for the 64-bit version, but without success.
Clearing the Connection for Crystal Report in Code
Following a solution from the internet, we tried to clear the DataSourceConnections before setting the new one. Just for testing purpose, if this may help (which it didn't).
Some Solutions for the Problem, that didn't work for us
Debugging and Research
As said in the text above, we tested the Information in Code and found no problem with the connections. We could connect with the same information in the database from every other tool of the programm. The issue only occurs with Crystal Report. Also researching the issue showed only "open" questions withouth answers, or without answers that worked for us.
The Question
What to do, to get into the CrystalReport-Viewer without the login-window failing to login?
As solutions there may be two ways to fix this. One within the code, and one with the needed files from the sql native clients, or other environmental changes.
Both solutions are welcome. Of course we will further search for solutions ourself, but in the moment, we are a little clueless (which explains this question).
So any help is welcome.
And at last a little Code:
repdoc.FileName = _pfad;
if ([...]Configuration.ServerType == [...].DB.Utils.ServerTypeMSSQL)
{
if (repdoc.DataSourceConnections.Count > 0)
repdoc.DataSourceConnections[0].SetConnection([...]Configuration.Server, [...]Configuration.Database, DatenbankAdministration.DefaultUser, DatenbankAdministration.DefaultPassword);
repdoc.SetDatabaseLogon([...]Configuration.User, [...]Configuration.Password, [...]Configuration.Server, [...]Configuration.Database);
}
repdoc.Load(_pfad);
In this code example, we set the filepath towards the report and the connection towards the database. Everything is correctly filled on the systems with issues. But if there are some configurations to be done, feel free to comment them.
If you are interested to look into the issues, but need some further information, that we can provide, I will happily provide them.

Crystal Reports in Visual Studio 2010 dao error

I had an image, but I don't have enough reputation to post it. The error is as follows:
Database Connector Error: 'DAO Error Code: 0xbe4
Source: DAO.Fields
Description: 'P:\db\Name.mdb' is not a valid path. Make sure that the
path name is spelled correctly and that you are connected to the server
on which the file resides
I have been tasked with converting a good many Crystal Reports to SSRS. Unfortunately, I can not get the path of my first report to change to where it is now located on my computer. I have been trying to get into the code, but this error pops up when I try to look at the SQL, when I try to preview the main report, and when I try to verify the database.
We have copied this .rpt and the access database file directly from the company we are doing this for, but it will not work. I can't even find this path ANYWHERE I've looked or with the find function, and when I look at the properties the correct path is there. I don't understand what is wrong.
I do know that CR has a lot of issues, especially moving around on machines, but I've never dealt with anything like this before.
Any help to resolve this error so I can begin working on these reports would be greatly appreciated.
Just Google "Crystal Reports to SSRS" and you will find solution to convert Crystal to SSRS automatically.
If you like to have a try, you may send your report to support#crystalmigration.com
Most Crystal Reports can be perfectly automatically converted to SSRS.

C# Excel 2010 Workbook Open error

We recently upgraded from Excel 2007 to Excel 2010, and we have found that existing code started failing.
Exception Message:
Office has detected a problem with this file. To help protect your
computer this file cannot be opened.
We have traced this to the line where we open the file
excelApp.Workbooks.Open
Even when opening the file manually, the Protected View Messagebox comes up.
How can we work arround this using C#.
Have a look at using Application.FileValidation Property (Excel) before your Open statement.
Returns or sets how Excel will validate files before opening them.
Read/write
Files that do not pass validation will be opened in a Protected View
window. If you set the FileValidation property, that setting will
remain in effect for the entire session the application is open.
You can set it to one of the enum values in MsoFileValidationMode Enumeration
msoFileValidationDefault
msoFileValidationSkip
if you set it to msoFileValidationSkip before the Open statement, it should bypass the check.
Something like
excelApp.FileValidation = MsoFileValidationMode.msoFileValidationSkip;
before the open statement.
Late to the game here, but this is a common annoyance: you need to define a 'Trusted Location'.
You're not the only developers encountering this problem when your code tries to open a spreadsheet file, and "Office has detected a problem with this file. To help protect your computer this file cannot be opened." is an extremely unhelpful error message.
Look up the Trusted Location code published by Daniel Pineault on DevHut.net in 2010:
DevHut code example: Trusted Location using VBScript
I'll get downvoted to hellandgone for posting VBA in a C# forum, so I'd better not post my implementation of Daniel's code (yes, I'm a VBA developer, bashing out VBA macros all day, not a real coder working with pointy things and curly braces). If you really want to see the VBA, it's in a reply to another post:
https://stackoverflow.com/questions/2962728/office-trusted-locations/28115700#28115700
I believe the proper salutation is 'Share and Enjoy'.
Do, please, put an acknowledgement of the original author, Daniel Pineault, if you reuse the code: it's been widely published without attribution on 'Expert' sites, and that's rather rude.
We had the same issue. Our SSIS package at SQL server uses Excel.Interop to parse files. One day we installed Office 2010 x64 on new server and for some files started getting error:
Office has detected a problem with this file. To help protect your computer this file cannot be opened.
At the same time, other servers work good. We found distinguish in versions of Excel: 14.04763.1000 doesn't work, but 14.0.7015.1000 works for us. The last version number belong to Office 2010 SP2. Eventually we downloaded SP2 and installed it,as result, the error has gone.

Crystal Reports 2011 .Net 4.0 OS Installed on E: gives error when running report

I have one PC whereby the OS has been installed on E: and it has no C: drive. Onto this I have installed my .Net 4.0 WPF Application which runs fine.
However, when I try to access a crystal report it gives the exception below. This user is able to access the report from its network location in windows explorer so I assume the act of asking Crystal to copy it locally is causing a problem?
Therefore, can anyone advise where the local copy will be created and/or how I can control this.
Thanks
Code to open report:
oReportDocument.Load(oSystemData.ReportPath + StandardReport.RPTFile, CrystalDecisions.[Shared].OpenReportMethod.OpenReportByTempCopy)
Extract of call stack:
CrystalDecisions.CrystalReports.Engine.LoadSaveReportException: Invalid report file path.
at CrystalDecisions.CrystalReports.Engine.EngineExceptionUtils.DoThrowException(String message, EngineExceptionErrorID id)
at CrystalDecisions.CrystalReports.Engine.ExceptionThrower.ThrowEngineException(String messageID, EngineExceptionErrorID id)
at CrystalDecisions.CrystalReports.Engine.ReportDocument.Load(String filename, OpenReportMethod openMethod, Int16 parentJob)
at CrystalDecisions.CrystalReports.Engine.ReportDocument.EnsureLoadReport()
at CrystalDecisions.CrystalReports.Engine.ReportDocument.get_Subreports()
It makes a local temp copy of the report when you load it. Find out what the temp environment variable is on that system. If it was e:\temp then I suspect you don't have the permissions necessary to write files to that folder.
That said, since it sounds like you are building a Windows WPF application it could be as you suggest and is actually trying an invalid directory like "c:\anything".
To know exactly what is going wrong, I recommend running Process Monitor which you can download here: http://technet.microsoft.com/en-us/sysinternals/bb896645
It's easy to use, the only annoying thing is the HUGE number of things it observes on your system. To deal with that, right click on the 'cluttering' entries (in the capture window) and choose to filter them out. It allows filters to be on the process (i.e. myWPFapp.exe) or on the TYPE of activity, in this case you want to monitor the file system (obviously).
Once you have it capturing events, and you've filtered it down so it's not rapidly filling up the window, just run your application. You'll see any failed accesses to the harddrive AND the folder it attempted to use.
Good luck.

Crystal Report Viewer crashing an application when trying to export the report source to disk as a PDF .Net

I'm trying to export the reportsource of a crystal report viewer in .Net 1.1 onto disk as a PDF using
CrystalDecisions.CrystalReports.Engine.ReportDocument cr = (CrystalDecisions.CrystalReports.Engine.ReportDocument)crvView.ReportSource;
cr.ExportToDisk(CrystalDecisions.[Shared].ExportFormatType.PortableDocFormat, #"C:\Temp\Temp.pdf");
I know it's the "cr.ExportToDisk..." line thats failing, but dont know why.
Ive checked to make sure the Crystal Report versions are the same on the client machines and they are.
Sometime i get the message "Memory could not be read at source...." and the application completely crashes, and other times the app crashes without the message.
Any ideas on why this happens and how to fix it would be greatly appreciated.
Cheers
You may check to make sure that the security permissions are the same for the locations that you are trying to export to.
Are you able to print these "faulty" reports? If so, have you tried printing to CutePdf which might allow you to at least work around the issue temporarily.

Categories

Resources