Lost my reference to Microsoft.InteropFormTools in a VB.NET 2008 project - vb.net

I've got an older VB.NET 2008 project, which uses Crystal Reports. In order to access the .rpt files I used Microsoft.InteropFormTools assembly. This has worked OK for a number of years. What this does is allows the user to specify what amounts to parameters to the reports in the Crystal Reports, and then click a button and out prints the report. (The user is not interested in previewing the report, so it prints directly to the printer, using Crystal.) The one problem, which I've never been able to figure out, is that sometimes (how, and under what circumstances I don't know, because I can reliably reproduce the error) loading the Crystal Report will cause an error flag to come up. Next Crystal will insist that the user enter parameters to the report before it previews them. OF course the users don't know what's going on, so what we've done in the past is just have the user start it over again, and Crystal normally is happy and sends the report to the printer.
However, we've got new users coming on board to do this, and they're not as forgiving. When I wrote this app 4 years ago, I let the CPU be “Any CPU”. I'm wondering if that could be the root of my problems with these Crystal reports not coming out. So, I've gotten into the project, and changed it from “Any CPU” to “x86”, which really is more appropriate, especially since our old version of Crystal is 32-bit. However, now that I've done that I've got a new error message popping up. Visual Studio 2008 is telling me that, “The system cannot find the reference specified”. In this case the missing reference is Microsoft.InteropFormTools. No other changes have happened to this application in 3 years, besides my changing the project configuration from “Any CPU” to “x86”. Could that be what's causing it to not be able to find the path to Microsoft.InteropFormTools?

Related

Compiled Access Program Runs Fine on 7 Computers but Crashes on 3 others

I have written a rather complex application in Microsoft Access. It is split into front end and back end files. To protect my code, I have compiled it and saved it as a runtime .accde file, which I then changed to an .accdr file to ensure it operated as a runtime. I have created two versions of the application: one for those with 32-bit Office installed and one for those with 64-bit office. I have used Inno Setup to package the application, the data file, and other files such as the icon file, the license file, etc., into an installable package, which works just fine.
Among my team of 27 beta testers of this application, so far 6 have downloaded it, and I have tested it on four of my own computers. On seven of these computers, the installation works perfectly and the application runs with no problems.
On the computers of three of my testers, when they try to run it, they get this error message:
The expression On Open you entered as the event property setting produced the following error: Bad file name or number.
* The expression may not result in the name of a macro, the name of a user-defined function, or [Event Procedure].
I'm pretty sure I know where the code is that's causing the problem, but cannot for the life of me figure out why the application crashes on those 2 computers but not on others.
The On Open event I suspect of causing the problem checks the linked tables, gets their connect string, then looks at the path for that string for the back end database. If it does not find it there, the procedure pops up a file selector dialog and instructs the user to find the data file, then it relinks all the tables.
If anyone could point me in the right direction to fixing this problem, I would be extremely grateful.
This is typically caused by a reference labelled as MISSING.
You have two (three) options:
Run the application on the offending machines with a full version of Access that lets you debug the code
Create a small test application that lists and verifies the references you use, and run this on the offending machines
Remove those two customers
Thanks to all the contributors here. Because of these folks and additional online research, the latest answer I can find is this:
This error occurs on a small percentage of computers on which the app is installed, and no one has yet figured out why, what causes it, or how to fix it. The workaround is to install the 2013 version of the Access runtime, as later versions will still cause the problem.
At least one of the offending computers is running the Click-to-Run version of Office. Still gathering information, but that's the status as of now.

Report doesn't open up in Pentaho BI Server

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.

VBA app throwing error in Windows 7 , office 2010 but not in Win XP

I have an app in VBA consisting of many reports, queries, forms and tables. This .mdb file is linked to another .mdb file (the actual database for the app). This app was originally developed in Windows XP. But I have to move this app to run from a machine which has Windows 7. Now when I run a particular report in win 7 machine it throws an error.
The expression On Deactivate you entered as the event property setting produced the following error : A problem occurred while application was communicating with the OLE server or Active X component
When I comment out the Deactivate event from that particular report, the error is no more. But the interesting point is, when I use the same .mdb file to run from a XP machine, it works just fine.
I am very much confused. Any help will be highly appreciated.
Create a new report and, one by one, copy the controls from the previous report till the moment you get the error. The moment you got the error, discard that very control and recreate that very control again in the new report. After that copy the other remaining controls.
The idea is to pinpoint the control or controls which are causing the pain and then to discard those controls and recreate them again.

Run and Print Crystal Report from VBA

I want to automate CR report printing from VB/VBA.
I have Crystal Reports XI Developer installed and .rpt files (some requiring parameters) to run and send to a printer, without requiring any user intervention.
Now, I stuck at the very first step, adding the correct libraries. There are probably about 50 libraries or so that start with Crystal Reports or Business Objects, and I have no idea which ones I need.
Any pointers to get me started would be appreciated.
Thanks
Martin
Ok, I solved my problem.
CRAXDRT.dll aka Crystal Reports ActiveX Designer Run Time Library is the correct library.
Here is some sample code:
Dim CR As New CRAXDRT.Application
Dim rep As CRAXDRT.Report
Set rep = CR.OpenReport(Range("CRpath"))
rep.ParameterFields(1).AddCurrentValue "Boston"
rep.ParameterFields(2).AddCurrentValue "Cars"
rep.Database.Tables(1).ConnectionProperties("Password").Value = "pw12345"
rep.ReadRecords
rep.PrintOut promptUser:=False, numberOfCopy:=1 ' promptUser:=True doesn't work
It depends on your budget, but I recommend a 3rd party program called Visual Cut (http://www.milletsoftware.com/Visual_CUT.htm). Using either a command line or the built-in GUI, you can process Crystal Report files pretty much any way you want, including PDFing, emailing, and even printing directly to a printer. So you can skip the VBA entirely if you want.
It's been around since 2002 and the developer has been continuously adding custom features to it by customer request, so it suffers a little from 'feature creep'. However, the manual (downloadable for free from the website) does a good job of keeping it all in perspective. Also, if you get the maintenance agreement, the developer is very responsive. In my case, he usually returns my calls within the day.
*(This isn't the developer talking, just a satisfied customer)

Intermittent Crystal Reports error "The request could not be submitted for background processing."

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.