Archive for August, 2010

Mixing single values and ranges in the select expert

Friday 27 August 2010 @ 10:37 pm

There is a trick I teach my students to help them remember Boolean (true/false) syntax.  I have them enter criteria into the select expert and then click the “Show Formula”  button to see the same criteria written in Crystal formula syntax.  So if you forget how to write a formula that does “between”, “is one of” or “not equal to” just put that into the select expert and copy the formula that it generates.

And just last week I learned something new.  The Select Expert will let you mix ranges and single values when using the “is one of” comparison.   So say I want to return 62 specific order numbers.  I want all orders numbered from 1001 to 1030, all orders numbered from 2001 to 2030 and two other individual orders numbered 2035 and 2037.  In the select expert you can put all of this in one rule by Continue Reading »
Mixing single values and ranges in the select expert

Setting the RGB color of multiple fields at the same time

Tuesday 17 August 2010 @ 11:14 pm

One of my customers had a dozen or so formula fields used as headings throughout a long report.  He wanted to be able to adjust the color of the font assigned to all of these objects in one place.  So we created a formula that stored three numeric values like this and put it into the report header (suppressed):

NumberVar RGB1 := 0;
NumberVar RGB2 := 64;
NumberVar RGB3 := 128;

Then we used the following as the condition formula for the font color Continue Reading »
Setting the RGB color of multiple fields at the same time

Embedding an XSD into an XML file

Sunday 8 August 2010 @ 9:43 pm

This is a follow-up to an earlier post about reading XML File with Crystal Reports.  One of the main things I mentioned at the time was the lack of documentation.  I have since found the following articles that have helped a great deal:

Structuring XML Data for the Crystal Reports XI Native XML Driver

Using ODBC XML Data with Crystal Reports (version 10 and prior)

These articles have moved but you can search the SAP Support site and it should bring them up:

Another thing I mentioned was that out of three XML connection methods offered by CR, only one could read both the XML and XSD files.  If you don’t have both the XML and the XSD then you get either:

1) the data types but no data, or

2) the data with all fields being character data.

But what I missed is that instead of a separate XSD file you can embed the entire XSD schema inside the XML file.  One of my readers, Guy Francoeur, was nice enough to point this out and even sent me an example.  I have since found that this is called an “Inline” schema.  So I used Guy’s example to create my own example which you can view or download if needed.  Crystal can connect to this XML file using either the “ADO.NET (XML)” connection method or the “Database Files” connection method.  And either way you get both the records and the defined data type of each field.

Recrystallize Pro