Archive for December, 2019



Column breaks in a multi-column report

Monday 30 December 2019 @ 11:12 pm

Crystal allows you to have multiple columns on a page. This is handy when you have a narrow list or a label and you want to pack more data on each page. To set up multiple columns you go to the section expert, highlight the ‘details’ section and check the option to ‘format groups with multiple columns’. This exposes a tab on the right that is labeled “Layout”. Here you can set the width of the column, the space between columns, and if the columns should go across then down (filling the top of the page first) or go down then across (filling the left side first).

Here you can also determine if the group headers and footers are part of the columns or if they go across the entire page and are separate. Usually, you want the groups to be included when you are using “down then across” and not when you are using “across then down”.

If you are using “down then across” and your groups are part of the columns you might want to have each group start in a new column. Crystal has a specific feature when you want a page break after a group, but not when you want a column break after a group. My workaround is to create a very thin group footer and then set it to “print at bottom of page”. This will force the next group to be at the top of a column.

Since long groups might start on one page and continue on the next, you should probably also set the group option to “repeat group header on each page”. This way the group spilling on to the next page has a label to identify the group.

This method isn’t perfect. You might occasionally get an empty column if the records fill the column exactly. Or you might want to line up the top of each group’s second column with the top of its first column, or maybe even repeat the headings with each column. For help with these issues see Expert Techniques Volume 2.




Deleting fields without losing (linked) column headings

Tuesday 24 December 2019 @ 5:14 pm

Whenever you drag a new database or formula field onto the details band, Crystal will add a column heading for you, automatically. This heading is just a text object but it will stay internally linked to that field. If you move the field horizontally, or change its width, the heading will adjust to match.  If you delete the field, the heading disappears as well.

This can sometimes present a challenge. For example, when you have formatted and aligned column headings and you need to replace the fields below them. When you delete the original fields the headings will also be deleted and then you have to recreate them and reformat them.  I was in this situation twice in the past few days. In one case I had to replace a group of tables with a SQL command, in the other I replaced a SQL command with a subreport. In both cases the database fields on the report had to be replaced. And as soon as I deleted the original fields I saw that the headings also went away. I didn’t want to recreate the headings to match the old ones, so I hit undo and did some experimenting.  I learned two things that allowed me to keep my original headings in place even after the original fields are deleted:

  1. If you copy the headings and paste a second copy of them somewhere else on the report, Crystal will only delete one set.
  2. If the new headings are in a separate section Crystal will delete the headings in the higher section.

So my new approach for this scenario is to:

  • Split the section that contains the headings to create a new temporary subsection.
  • Drag the new subsection to be above the original section.
  • Copy the headings and paste the copies into the new blank section.
  • Insert the new fields into the new subsection (so they won’t create new headings)
  • Use the format painter to format the new fields based on the format of the originals.
  • Use the menu (format > make same size) to size the new fields to match the originals.
  • Delete the original fields, which should delete the new headings in the higher section.
  • Move the new fields to the original section and align them with the original headings.
  • Delete the temporary subsection.

This process adds a few extra steps, but it keeps your original headings exactly as they were and allows the new fields to look exactly like the ones that they replaced.




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.





Recrystallize Pro