August 5, 2008 by Ryan
I help support an app written in VB6 that uses Crystal Reports 8. Recently we started seeing some very weird behavior where when printing a bunch of documents in a row, at some point in the process Crystal would freeze on the “Printing Records” window and just give us a nice white screen. At this point the only thing to do is kill the process and start over. Considering the number of documents being printed could range up to 150 or so, and it would freeze after anywhere from 1 to 50 documents, it was rather annoying to kill the program, load it back up, continue printing, repeat ad nauseam.
I dove into the problem and read a lot on how this version of Crystal could give you white screens while in the Visual Studio IDE due to some circular dependencies in the dlls. I found no problem with that, but kept poking along that line. We started to realize the problem was only happening on newer machines. So we had the thought that maybe if we just slowed the processing down it would relieve whatever tensions existed. So I put in a little sleep time between each document. That just made the whole thing much slower to get through, and didn’t help the freezing problem at all.
After some recoding and improvement of the process, with no real gains on the freezing front, I was searching for possible differences in the machines that froze versus those that didn’t. Somehow between the number of articles I’ve read recently on concurrency and threading and the old machines vs. new machines ideas bouncing around in my head, I decided to check how many processors each machine had. It seemed to me that the problem computers were all newer, dual core processors, while the funcitoning ones (my ancient laptop included) were single core. There was even an older ex-server unit functioning as someone’s desktop that had two separate processors in it and that one froze up on us too. So I thought maybe Crystal didn’t handle two processors well. I tried to set affinity for our application to just a single processor. That didn’t fix the issue unfortunately. I was set to take this thing all the way though, so I grabbed one of our test machines and disabled the second core in the BIOS. I ran the printing process and sure enough, it made it all the way through without freezing once.
Now, this isn’t the best way to get around this problem I’m sure, since who really wants to lose half (or some percentage at least) of their processing power? But, this problem has really taken it out of me, so searching for a better solution just isn’t in me right now. For now, it’s disable one core and let them print to their hearts desire. Any better ideas?
Tags: CrystalReports, VB6
Posted in Reporting | 1 Comment »
June 9, 2008 by Ryan
Anyone out there still suffering with Crystal Reports 8 or 8.5? Anyone still using the ocx to generate a report for a client? What? I’m the only one. Damn. Well, I’ve finally gotten sick of some of the limitations of using an ocx to access reports through an ODBC connection with static DB links inside the report files. So any time they move, we get to open up every single one and change the location of them. No longer I say!
With a bunch of digging through files so old no one should need to remember them, I found the solution to migrating away from the ocx/odbc solution and instead accessing the report application class and doing run-time setting of the database links for each report file. Here are the tricky steps I had to take to make this work.
First I had to change the code to reference the Report Designer Component instead of the Crystal ocx. Only a decade after this upgrade first happened in the offices of Seagate I might add. This is explained in the Crystal Reports 8 Developer’s Guide which you may find as a pdf if you look for it. Then, after digging around in a couple of troubleshooting articles on Business Object’s website, I got the feeling that this version of Crystal didn’t play too well with the native MS SQL driver. This was one of the two sticking points for me, as I kept trying to use it and kept getting errors when setting the location of the reports in the code. I switched my test report to using an OLE DB connection and that helped me open connections after setting the location at run time. The other sticking point was that the Location field of the reports had been populated with a “database”.”owner”.”table” syntax, which works fine, but will prevent you from modifying the location at run time. If you just remove the database and owner parts of that in the Set Location dialog within the report, you’ll be able to make the changes and connect to your database at run time with no problem.
Posted in Reporting | Leave a Comment »
May 29, 2008 by Ryan
The machine running my Subversion server picked a good day to brick. After spending a couple hours fixing some permission problems in the domain, I found my SVN server non-responsive. Hooking up a monitor showed it not even POSTing. So the hardware is hosed and the backup is out of date. Thank goodness for SVN.
I took the hard drive out of the machine, popped it into another one and copied it all up to a storage volume on the network. I installed Subversion on a new machine, set up empty replacement repositories, and copied over the files from the dead machine.
Luckily for me it was all as easy as:
svnadmin dump /path/to/oldfiles > dumpfile
svnadmin load /path/to/newrepository < dumpfile
I can’t believe it was that easy. I deleted the scm server’s A record in DNS, added a CNAME record for the old name pointing to the new server and everything is working again. Thank you Subversion for being smart about recovery.
Posted in Source Control | Leave a Comment »
January 7, 2008 by Ryan
I had a need to unmap and remap drives to various UNC paths in a utility I’m writing. Using the IWshRuntimeLibrary.WshNetwork gave me the RemoveNetworkDrive function, which I happily used. Well, happy until it gave me this error:
The local device name has a remembered connection to another network resource. (Exception from HRESULT: 0×800704B2)
Looking at the documentation showed me the third parameter:
bUpdateProfile Optional. If bUpdateProfile is supplied and its value is TRUE, this mapping is removed from the user profile.
Setting this to True ensures the mapping is removed from the user’s profile and allows you to map that device name to a new path right after removing it without getting an error.
Posted in Uncategorized | Leave a Comment »
February 2, 2007 by Ryan
Well, we’re sure not going to move our whole code base to .NET any time soon, but I figure it’s about time to start trying at least. In fact I’ve played around with it and created some interesting little test projects, but nothing too useful for my full time project. But as time goes on, I’m going to need to steal a little time here and a little time there to start paving the way for .NET in my company.
The one thing that doesn’t need to change is my source control. Subversion has made me very happy so far and I’ll be sticking with it. I don’t have a great build process but there’s something there involving NAnt, so I’ll just have to update that for my .NET projects. There is no automated testing to speak of, so I’ll hopefully be able to adopt NUnit or another testing tool shortly. The first thing that I’ll have to do though I think is to get an OR/M tool working. That also involves throwing some code generation into the mix, as I don’t feel like manually building NHibernate mapping files. However I’ve already used MyGeneration for a couple of scripts for SQL Server 2000, so I’ll stick with that one. I know it has it’s own OR/M tool, but I’d like to give NHibernate a try. So, along with migrating from SQL Server 2000 to SQL Server 2005 (of which only replication is giving me trouble), this is what I will be dedicating my life to as much as possible for the time being. I know I’ll struggle, but hopefully I’ll end up in a much happier place.
Posted in VB.NET | Leave a Comment »
October 12, 2006 by Ryan
Welcome to WordPress.com. This is your first post. Edit or delete it and start blogging!
Whee! I’m on WordPress!
Posted in Uncategorized | Leave a Comment »