Tag Archive: Crystal Reports 2011


Been busy- shocking lack of updates… watch this space :)

As discussed in my earlier post Crystal Reports 2011 Installation there appears to be a bug with the Crystal Reports 2011 installation. If you are experiencing this bug (INS00140) download the attached and follow these instructions:

Search for isKeyCodeValid.exe in the installation files and replace with http://tickett.net/downloads/crystal/isKeyCodeValid.exe

Please note: You will need the Microsoft .NET Framework v4 installed or the patch will not work.

Thanks
L

Following on from https://tickett.wordpress.com/2011/05/19/crystal-reports-training-tutorial-part-2-building-a-basic-report/ I’m going to skim through the use of parameters (I initially thought this would be a really brief part of the tutorial then realised there is actually quite a lot to them!).

Parameter Types
Boolean: True or false (dropdown)

Currency: To the best of my knowledge this behaves the same as the number parameter type (textbox with validation)
Date: Pick from a calendar
DateTime: Pick from a calendar (textbox with validation for time)

Number: Textbox with validation
String: Textbox
Time: Textbox with validation

Parameter Options
I’m not going to cover all of the options- I recommend you experiment with them all to see how they behave for yourself
Prompt Text: Most common of all the options- this allows us to name our parameter something and have a more user friendly prompt

Allow Multiple Values: Goes without saying (see above)
*Note* Parameters which accept multiple values are great for your selection criteria but can be tricky to use for conditional formatting (the parameter now contains an array)
Prompt With Description Only: See below example (set to false)- you can see the values and corresponding descriptions

Now set to true- you can only see the descriptions

Allow Custom Value: See below example (set to true)- you may pick a value from the list or enter your own value

Now set to false- you are forced to pick a value from the list

Allow Range Values: Personally I always avoid the use of range values, and instead I have 2 prompts- one for the bottom of the range and one for the top (FromDate, ToDate for example)
Optional Prompt: Will allow the user to leave the parameter blank
*Note* If using optional parameters you must incorporate the HasValue function every time you access the parameter or the report will fail!
Edit Mask: For string parameter types only

  • “A” (allows an alphanumeric character and requires the entry of a character in the parameter value).
  • “a” (allows an alphanumeric character and does not require the entry of a character in the parameter value).
  • “0” (allows a digit [0 to 9] and requires the entry of a character in the parameter value).
  • “9” (allows a digit or a space, and does not require the entry of a character in the parameter value).
  • “#” (allows a digit, space, or plus/minus sign, and does not require the entry of a character in the parameter value).
  • “L” (allows a letter [A to Z], and requires the entry of a character in the parameter value).
  • “?” (allows a letter, and does not require the entry of a character in the parameter value).
  • “&” (allows any character or space, and requires the entry of a character in the parameter value).
  • “C” (allows any character or space, and does not require the entry of a character in the parameter value).
  • “. , : ; – /” (separator characters). Inserting separator characters into an edit mask is something like hard coding the formatting for the parameter field. When the field is placed on the report, the separator character will appear in the field object frame, like this: LLLL/0000. This example depicts an edit mask that requires four letters followed by four numbers.
  • “<” (causes subsequent characters to be converted to lowercase).
  • “>” (causes subsequent characters to be converted to uppercase).
  • “” (causes the subsequent character to be displayed as a literal). For example, the edit mask “A” would display a parameter value of “A.” If the edit mask is “00A00,” then a valid parameter value would consist of two digits, the letter “A,” and then two additional digits.
  • “Password”. Allows you to set the edit mask to “Password,” you can create conditional formulas specifying that certain sections of the report become visible only when certain user passwords are entered.

Report Layout
We can use the parameters to drive how our report looks (almost all section and field attributes can be determined by the value of parameters)

Create a string parameter called report_title and place it in the report header

Refresh the report, and enter some text for the report title

Let’s try one more example- create a new boolean parameter called hide_detail

Now in the section expert for our page header and detail sections we will enter a conditional suppression formula

Refresh the report choosing detail
And then choosing summary

Selection Criteria
Most commonly report parameters are used to determine our record selection formula
Create a number parameter EmployeeID and modify the record selection expert
{Orders.CustomerID} = {?Customer}
Enter a value

You will see your report displaying only records which meet your criteria

Dynamic
By default parameters are static and provide either:
-a textbox
-a dropdown list of predetermined values (entered while designing the report)
However- you can also create dynamic parameters which pull from a field in the database by selecting dynamic from the list of values box in the top right hand corner for the edit parameter window

Click the value field and select CustomerID
Now modify the record selection formula:
{Orders.CustomerID} = {?Customer}
And refresh the report

If a new value appears in the database they will appear the next time the report parameter is displayed

Cascading parameters can be created where you want to prompt for say Country then State (the selected value from the first parameter will impact the list of available values from the second parameter). I’m not going to cover this.

If you feel I’ve missed anything or have something to add please comment!

L

Installation

I didn’t initially intend to include installation, but decided it was worth a brief mention.

As with many companies and products, SAP (and formerly Business Objects) have added new functionality and fixed bugs through the release of service packs. If you already have Crystal Reports installed, you have probably noticed the “check for updates” feature doesn’t work? Pop to the SAP website to check for the latest service pack:

http://service.sap.com/sap/bc/bsp/spn/bobj_download/main.htm

Currently: Crystal Reports XI Release 2 Service Pack 6, Crystal Reports 2008 Service Pack 3, and as yet no service packs have been released for Crystal Reports 2011.

Most of the service packs have been released as “full builds”- this means you don’t need Crystal Reports installed (it is included within the service pack itself). If you are running a fairly old version of Crystal, I encourage you to uninstall and start afresh with the latest full build.

Configuration

Now you have the latest service pack installed we can get started configuring your environment.

Launch Crystal Reports and access the options dialog from the File menu. I would encourage you to review each and all of the options- if configured incorrectly they can lead to insanity- however, if configured correctly they can save you a lot of time!

Here are a few of my recommendations (most of the other options should default to my preferred configuration or vary from report to report):

  • Layout -> Design View -> Grid -> Check
  • Database -> Tables and Fields -> Sort Fields Alphabetically -> Check
  • Database -> Advanced Options -> Automatic Smart Linking -> Uncheck
  • Formula Editor -> Null Treatment -> Default Values for Nulls
  • Reporting -> Save Data With Report -> Uncheck

That’s all for part 1- if you feel I’ve missed anything or have something to add please comment!

L

I ran a small training session a while back and wanted to flesh out my notes so they can hopefully form an online tutorial. Here’s the outline:

  1. Installation / Configuration
  2. Building a Report – The Basics
  3. Parameters
  4. Sub-Reports
  5. Grouping
  6. Cross-Tabs
  7. Understanding the Underlying SQL
  8. Limitations
  9. Tips/Tricks

The structure may vary a little- but all of the above topics should be covered at some point. I aim to post a few sections everyday (optimistic). Expect the first part shortly!

L

*UPDATE* I have now uploaded the file so you can download directly (see https://tickett.wordpress.com/2011/08/07/crystal-reports-2011-installation-bugfix-patch/)

*UPDATE* Official word from SAP: This should only be affecting Windows XP 32-bit machines that have KB2467175 installed. The removal of KB2467175 resolves the issue.

I bit the bullet and purchased the Crystal Reports 2011 upgrade (from the US store). Unfortunately when I tried to install I got an error:

The Product keycode is not valid. INS00140

Google only turned up one result: http://forums.sdn.sap.com/thread.jspa?threadID=1946287 which didn’t have a solution.

I ran process monitor from sysinternals to have a look if a registry check for previous version(s) was failing or likewise and found an installation log file which contain the following entries:

18:10:22.727 Calling Validator Entry Point..
18:10:22.727 [validate_ProductKey]acceptedKeyTypes CR.EnableCR;XC.EnableAddOn
18:10:22.727 [validate_ProductKey]appname: "C:\Documents and Settings\Lee\Desktop\tmp\DATA_UNITS\CrystalReports\dunit\product.crystalreports-4.0-core-32\actions\\isKeyCodeValid.exe"
18:10:22.742 [validate_ProductKey]argument: -keycode ******** -version 140 -property CR.EnableCR
18:10:22.742 [validate_ProductKey]initDir: C:\Documents and Settings\Lee\Desktop\tmp\DATA_UNITS\CrystalReports\dunit\product.crystalreports-4.0-core-32\actions\
18:10:22.742 [run_external_executable] cmdLine: "C:\Documents and Settings\Lee\Desktop\tmp\DATA_UNITS\CrystalReports\dunit\product.crystalreports-4.0-core-32\actions\\isKeyCodeValid.exe" -keycode ******** -version 140 -property CR.EnableCR
18:10:23.043 [run_external_executable] Exit code: -1072365566
18:10:23.043 [validate_ProductKey]keyTypes [CR.EnableCR] is bad
18:10:23.043 [validate_ProductKey]appname: "C:\Documents and Settings\Lee\Desktop\tmp\DATA_UNITS\CrystalReports\dunit\product.crystalreports-4.0-core-32\actions\\isKeyCodeValid.exe"
18:10:23.043 [validate_ProductKey]argument: -keycode ******** -version 60 -property XC.EnableAddOn
18:10:23.043 [validate_ProductKey]initDir: C:\Documents and Settings\Lee\Desktop\tmp\DATA_UNITS\CrystalReports\dunit\product.crystalreports-4.0-core-32\actions\
18:10:23.043 [run_external_executable] cmdLine: "C:\Documents and Settings\Lee\Desktop\tmp\DATA_UNITS\CrystalReports\dunit\product.crystalreports-4.0-core-32\actions\\isKeyCodeValid.exe" -keycode ******** -version 60 -property XC.EnableAddOn
18:10:23.343 [run_external_executable] Exit code: -1072365566
18:10:23.343 [validate_ProductKey]keyTypes [XC.EnableAddOn] is bad
18:10:23.343 Validation Failed for : ProductKey

So it looks like isKeyCodeValid.exe isn’t returning what is expected. I tried running the executable from the commandline and it simply errors. I guess there’s a bug?

Anyway, I wrote a command line app which simply returns errorcode 1 and replaced isKeyCodeValid.exe with my app. Voila!

Expect an update once I’ve had a chance to play with it!

Get in touch if you experience the same error and need help getting past it.

L

It’s been a long time coming, the last version was 2008. When Visual Studio 2010 started development and SAP released Crystal Reports 2010 for Visual Studio I was hopeful a new version was on the horizon- a long time has passed since then but finally Crystal Reports 2011 was released 03/05/11.

There seems to be very little new from what I’ve read but I will most likely still be trying it.

I can’t make much sense of the pricing:

UK Store- Full Version £500.25, Upgrade £310.50
US Store- Full Version $495 (£302), Upgrade $295 (£180)

Although I guess we should be used to companies trying to rip us off in the UK by now!

SAP / Business Objects Store: http://store.businessobjects.com/store/bobjamer/DisplayHomePage

Crystal Reports 2011 Release Notes: http://help.sap.com/businessobject/product_guides/cr2011/en/xi4_cr2011_release_notes_en.pdf

Crystal Reports 2011 User Guide: http://help.sap.com/businessobject/product_guides/CR2011/en/xi4_cr_usergde_en.pdf

Hopefully I’ll be posting another update shortly.

L

%d bloggers like this: