Archive for the 'Bugs and Errors' Category



Fields that change format when moved to a different environment

Monday 21 September 2020 @ 8:52 pm

I recently had complaint from a customer that a numeric field was changing format when moved from one PC to another. The format was fine when run on the developers PC but on the user’s PCs the format would change. I have seen this happen with both numeric and date fields.

The source of the problem is the format option at the top of the list called “System Default”.  If you leave a field formatted with this choice the report will use whatever format is set in the regional setting of the PC where the report is being run. Of course this means that a report might look different when run on another PC. If you don’t want the format to change from one PC to another then you should identify the specific format you want for numeric, currency, date and datetime fields.

Using a specific format should solve this 99% of the time. I have only seen a few instances where a report moved to another environment would have formatting changes despite the format being specified in the report. In those cases the final workaround is to write a formula to display the value. You can use Totext() to convert the field into text that is formatted the way you want. You use the text version for display purposes while using the original field for other functions like sorting and totaling.

Here are some examples:
Totext ({Date.Field}, 'yyyy-MM-dd') //converts a date into a string like 2020-09-21
Totext ({Number.field}, 0,"") // converts a number into a string with no decimals or commas




Page Header plus Page Footer is too large for the page

Sunday 17 May 2020 @ 10:06 pm

I had a customer call me recently about this error. Usually this error is quick to resolve.  It is almost always caused by a an object that “Can Grow” (e.g. subreport, memo field) in the Page Header. The customer sent the report to me with saved data and it opened fine on my PC. Both sections were empty and both sections were also suppressed. That made no sense to me. I assumed they had sent me a different report by mistake.

So we did a remote session and I confirmed it was the same report. When it opened on their PC the error appeared. After some poking around I went into “Page Setup” to check the page size and noticed that the bottom margin was set to 11 inches. The error message about the PH/PF turned out to be a red herring. The real issue was a combination of the margin setting and the selected printer. Once we entered a reasonable margin setting, the report behaved normally in their environment.

So if you get this error and can’t find anything that would cause it, you have one more place to check.




A way to speed up repeated Crystal Reports installations

Sunday 19 April 2020 @ 8:56 pm

Last month I wrote about a difficult time I had installing Crystal Reports. One of my complaints was that if the install fails, you have to start over – including waiting 5-7 minutes while the setup ‘unpacks’ all the files. It seems like there should be a way to keep the files unpacked when an install has to be repeated.

Well SAP doesn’t provide an official way to do that but one of my readers (who apparently does lots of CR installs) shared his method. Here are his steps:

1. Run the install .exe.

2. Wait until everything has been unpacked. If you aren’t sure, wait until it asks for the license key. Then go to this folder, substituting your user name in the path:

C:\users\<username>\AppData\Local\Temp

Look for a folder in Temp that starts with “RARSFX”.

NOTE: AppData is a hidden folder, so you’ll have to set Explorer to view hidden items.

3. If there’s more than one “RARSFX” folder, delete all of them except the most recent one. These are failed installs that didn’t get deleted correctly.

4. Copy the remaining folder somewhere else. You cannot cut and paste because the installer has those files open. You might want to give the folder copy a more meaningful name.

5. For subsequent installs, go to this new folder and run setup.exe.

So if you are troubleshooting a balky install, or if you have to install CR on several different workstations, the steps above will speed up the iterations. And, thanks to Dell Stinnett-Christy, a senior manager at Protiviti, for sharing this method.




Trouble installing CR 2016

Monday 16 March 2020 @ 12:20 am

I worked with a frustrated customer last Friday. He was having trouble installing Crystal Reports 2016 on a new PC. He wanted me to give it a try.

The first challenge was the error messages, which give no help. The main two are:

Failed to update setup engine executables
Failed to update cache for execution

After some web searching we found we could check the install log.  These errors happened when Crystal tried to move or rename a folder. We found lots of people asking about these same errors going back several years. We even found SAP’s official response. The solutions that worked for some people were:

1) Turning off all firewalls and AV programs **
2) Running the install as an Administrator
3) Changing the permissions on several folders to allow full control.

We tried all of these things and a few others which leads to the second challenge. The download from the SAP web site is an EXE. Before it can do the actual install it has to unpack all the files. This takes about 5-7 minutes which isn’t in itself a problem. But when the install fails you can’t just run setup again because most of the unpacked files are deleted after the failure. Your only option is to run the EXE again and let it unpack all the files … again … every time.  This makes troubleshooting very time consuming***.

I never got to see the last hurdle. My customer said that one time he got further but hit an error that mentioned a blocked port.  Another search  turned up that Crystal 2016 needs to communicate on a specific port to complete the installation. If this port is blocked you slide down the chute back to square one. We never got that far.

I had to punt and give him a link to buy a tech support incident from SAP. He will have to pay to get the product installed. Maybe SAP will be embarrassed enough to refund the incident charge.

I appreciate that installs are complex and that PCs can have infinite variations – but these errors have been around for years. By now they should have made it into the prerequisite test that runs before the install starts. If CR needs port X to be open then the routine should check to make sure that port is open before starting. If you need admin privileges or folder permissions, then it should check to see if it has them.

**Update 3/17:  The customer checked with his IT department and found a layer of AV/Firewall protection that was still active.  Once that was disabled the install went smoothly.   I still think the install routine could be improved, but I can’t blame the mess above on SAP.

***Update 4/26: See this post for a way to get around the need to unpack each time you repeat an install.




Script errors on the Crystal Reports start page and how to customize the start page

Saturday 11 January 2020 @ 5:48 pm

It has been 5 years since I first wrote about the script errors that affect the Crystal Reports start page. This issue comes up again periodically and several customers have had these issues recently. So if you are having issues with the start page here are the articles that should help:

https://kenhamady.com/cru/archives/2615
https://kenhamady.com/cru/archives/147

The fix is pretty simple and involves renaming two HTML pages in one of Crystal’s application folders. This prevents Crystal start page from trying to access the web.

Since the start page is  written in HTML I decided to have a look at how it worked. I was hoping to modify the page to show links to my most frequently used reports. After much experimenting I found a way to create hyperlinks that would open reports based on specified path and file name. The key was to ‘borrow’ the custom javascript function that is used to open your most recently used reports. The function is called fncrOpenReport.

So I edited the HTML in the start page and put in a few lines like this:

<A href="javascript:fncrOpenReport('C:/sample.rpt')">Sample Rpt</A>

The next time I started Crystal the start page included a section of new hyperlinks. The one above appears as the words “Sample Rpt”. When I click that hyperlink it opens the RPT specified in the fncrOpenReport function. This section works much like the “My Recent Reports” section but these reports won’t roll off the page as other reports are opened.

The only odd part about using this function is that reports opened this way cannot use “save as” until after you click “save”.  If you click “save as” without having clicked “save” the dialogue just doesn’t open.




PDF problems with Viewpoint’s Spectrum Software

Wednesday 18 December 2019 @ 10:28 pm

Any time Crystal Reports exports to PDF there is a slight reduction in font size. So when a customer complained that their fonts were exporting inconsistently to PDF, I figured it would center around this topic.  But, what I found was something different. The report was being run from within Viewpoint’s Spectrum Software for construction. The report looked fine if we exported it to RPT format and opened it in the Crystal Reports designer, but the PDF version had inconsistent font sizes.

One example was a large block of text with four paragraphs. It was all formatted with the same font and the same size in Crystal. In PDF format the first paragraph was in one size and all the other paragraphs were in a different size. I cut the first paragraph out to make it a separate text object and left the remaining three paragraphs in one text object.  But the font change just moved down to the next paragraph break.  I had to make each paragraph it’s own text object to avoid font changes.

A second problem was that text objects and field objects would end up being reduced by different amounts, even though they started out the same size. For example, just before the text objects was a database memo field that was supposed be the same font size. If I started them both at font size 9.5 in the report, the memo field would end up at 8.5 while the text object would end up at 8.  If reduced the memo field to 9 the font would end up as 7.5. I tried several other combinations and couldn’t find one where the text objects and fields would end up the same size in the PDF.

The odd part was that I couldn’t replicate any of these problems in my local environment.  I opened their rpt file saved with their data in my Crystal Reports designer and it exported just fine. I even tried it in Crystal v10 which is 15 years old and uses Adobe 4.0 format.  It still exported here with consistent font  sizes. So it sounds like this might have something to do with the runtime environment associated with Spectrum.

Conclusion: If you are using Viewpoint’s Spectrum Software, watch out for PDF font sizes.  If you need help with these issues, give me a call.




Sage 50 GetPeach() functions in Windows 10

Monday 9 December 2019 @ 7:38 pm

For some reason the combination of Sage 50 (PeachTree) and Windows 10 generated many calls from customers.  Most of these calls were for reports that used the special GetPeach() functions and that stopped working.  These functions have come with Sage/PeachTree for years. I was told by several Sage consultants that these functions would no longer work in the current versions of Sage 50.  But one of my customers ended up solving the problem on his own and has allowed me to share what he found (he didn’t want to be cited).

So here is how he got these functions working again:

  1. A system PATH variable must be assigned to C:\Program Files (x86)\Sage\Peachtree. This folder contains the DDFs (data dictionary files) for the interface between Peachtree and Crystal Reports and other special functions. Without these DDFs, any effort to run a report containing GetPeach() functions will fail with the error message “The Specified Module Could Not Be Found”.
  2. In a single user environment U2LPeach.dll and the associated .ini file (U2LPeach.ini) must be included in the folder C:\Windows\Crystal. This is the default location the files are placed by Sage 50 when data functions are updated.
  3. If operating in a terminal services environment, U2LPeach.dll and the associated .ini file (U2LPeach.ini) must be included in C:\Users\\Windows\Crystal.
  4. When U2LPeach.dll is loaded correctly, the .dll will appear in the list of dlls loaded by Crystal Reports. This list can be found by going to “Help > About Crystal Reports” and clicking “more information”. Alternately you can edit any formula and look in the additional functions node for the GetPeach functions.

If you are having problems with Sage 50, and the above doesn’t help you, let me know. I have several colleagues who are Sage 50 specialists so we should be able to resolve it for you.




Correction to “elapsed time string” formula

Saturday 9 November 2019 @ 11:54 pm

My web site has a page for commonly used formulas.  Many have been there for years.  Formula page 9 has two versions of a formula that will convert a number of seconds into an elapsed time string. The long version has days, hours, minutes and seconds.  The shorter version is just hours and minutes.

I was using the short version in a customer’s report and we noticed that the minutes value was sometimes off by one.  After some testing we found that if the remaining seconds were between 30 and 60 the formula would always round down because the formula used a Truncate() function. The Truncate() works correctly in the long version of the formula, because you truncate down to the whole minutes and then display any remaining seconds. But since the shorter version doesn’t display seconds it is more accurate to Round () the seconds to the nearest minute.  So I have updated the short version formula on my site to use the Round () function for minutes.

So those of you who have used that formula should update your reports by changing the last Truncate to a Round, or just taking the updated formula from page 9.




Literal values that include quotes

Saturday 26 October 2019 @ 12:25 am

I was recently working on a formula that had the crystal syntax for “is one of”.  It looked something like this:

{LastName} in [ "Smith","Jones","Thompson","Rutledge","Harris" ]

Each value goes in quotes (single or double). You separate the values with a comma and you put square brackets around the list. So I was surprised today when I saw that the formula was actually like this:

{LastName} in [ "Smith""Jones","Thompson","Rutledge","Harris" ]

Notice the comma missing between the first two values.  The report had been running for months without error messages which I didn’t understand, so I started testing.  My experiments pointed me to a syntax rule that I had read about but never used. It is for when your formula includes a literal string that you surround with double quotes, and when the literal string itself contains double quotes.  Crystal would assume the first quote is the ‘open’ and the second one is the close, even when you want the second one to be part of the visible output.   One solution is to use two consecutive double quotes within the literal. Whenever Crystal finds two consecutive double quotes within a literal surrounded by a pair of double quotes, Crystal will interpret the consecutive quotes as one literal quote and not as a closing quote.  This is much easier to explain with an example.  So if I wanted a formula to output this string:

The syntax for "is one of" uses brackets

I could write it like this inside the Crystal formula:

"The syntax for ""is one of"" uses square brackets"

The formula engine would only display one of the two consecutive double quotes in each pair.  That explains why my formula with the missing comma doesn’t generate an error.  Crystal treated the consecutive double quotes as a single literal and then combined the first two elements in the list as being the single value:

Smith"Jones

There was no error message, but the results would not have been correct.

BTW, the same principle applies to single quotes. If you put two consecutive single quotes in a string surrounded by single quotes, Crystal will ignore the first and treat the second as a literal quote.

The reason I didn’t think of this right away is that I have never used consecutive quotes in a formula. If I have a string that needs to contain single quotes I surround it with double quotes. And if the string needs to contain double quotes I surround it with single quotes. In the rare case that a string needs both I would split it into separate pieces and combine them. I find that using consecutive quote pairs makes the formula harder to follow.




Crystal crashes with no error message

Sunday 13 October 2019 @ 9:09 pm

MDB is the original Microsoft Access database format. It was replaced by the ACCDB format in 2007, but there still applications that use MDB files. For instance I have a handful of customers using Raiser’s Edge software for donor tracking, and this application still creates export files in MDB format.

One Raiser’s Edge customer recently contacted me about a report that kept crashing. There was no error message – Crystal would just shut down. The report had 32 tables and 31 joins. If he deleted one of the tables the report ran fine. As soon as he added the last table the report would crash.

In my testing I found that it didn’t matter which table was dropped. So it became apparent that the issue was a limit, somewhere on the number of tables or joins. But it was hard to determine where the problem lay without any error messages.

First I checked the SQL generated by Crystal Reports and that looked normal. I copied the SQL into a new SQL command but that had the same exact limit.

Next I tried the same report using different connection methods. Both OLEDB and ODBC failed in the same way as DAO.

Then I decided to see if the problem was in the MS Access engine so I copied the SQL From the report and pasted it into a new MS Access query. (I am one of those people who still use MS Access 2002.) The query would run fine in MS Access as long as I dropped one of the tables. If I added that last table the MS Access query would generate an error that said:

“Query is too complex”

I couldn’t find the official limits for MDB files but I did find a page that showed the limits for ACCDB files and it says that the number of tables in a query is limited to 32, which in some cases can be reduced even lower.  So apparently we hit the limit. And worse, when you exceed the limits for MS Access, the report can’t survive to give you an error message.  It just dies.




«« Previous Posts
Jeff-Net

Recrystallize Pro

Crystal Reports Server