Variable Changes from Legacy Crystal versions

Hi,

I have just published a bunch of reports from a legacy version of Crystal to XI and there are a few reports with a formula that uses “StoreStringVar” in them. I’m not sure of how this syntax is supposed to be and the formula does not work in XI. We do most of our report develpoment in Webi and I’m not an expert in Crystal.

if anyone could help me with the syntax of the folowing formula sample it would be fantastic.

formula “INI”

If OnFirstRecord then StoreStringVar (‘01c’, ‘initialised’);
If OnFirstRecord then StoreStringVar (‘01t’, Space(0));

01c & 01t are other formulas

Formula “01c”
EvaluateAfter({@INI});
EvaluateAfter({@SET});
FetchStringVar (‘01c’)

the “Set” formula
EvaluateAfter ({@INI});
NumberVar setcol := 0;

if (OnFirstRecord or Previous({HRTCODE4.SY_CODE_FOUR}) <> {HRTCODE4.SY_CODE_FOUR})
and {HRTCODE4.SY_CODE_FOUR} <> ’ ’
then
if FetchStringVar (‘01c’) = ‘initialised’ then NumberVar setcol := 1

if setcol = 1 then StoreStringVar (‘01c’, {HRTCODE4.SY_CODE_FOUR})

if setcol = 1 then StoreStringVar (‘01t’, {HRTCODE4.SY_CODE_ABBR})

setcol

I hope that this explains enough.

Cheers Dave


david.ginnane (BOB member since 2007-03-22)

Hi, Dave.

That’s too bad you don’t have experience with Crystal… seems like you’re dealing with some of the more advanced Crystal topics!

Your best bet will be to open and save these legacy reports with Crystal XI. New performance and processing enhancements will make them work a lot faster than their originals (and hopefully will fix your formulas, too). If it’s not possible to go through to open and save each one, and to answer your question: the StoreStringVar and FetchStringVar were the old methods of sharing variables to/from the subreport and the main report. Anywhere you see:
StoreStringVar(‘var_name’,‘var_value’) becomes
shared stringvar var_name := “var_value” ;

So in your case:

StoreStringVar ('01c', 'initialised')

becomes

Shared StringVar 01c := "initialised" ;

Similarly, wherever you see FetchStringVar(‘var_name’) becomes
Shared StringVar var_name ;

And assuming they used these correctly in the legacy reports, you’ll have to go through the main report and the subreports to fix these formulas.

Good luck!


lgonzalez (BOB member since 2002-07-17)

Luis,

thanks for your reply. Looking at getting Crystal full client licenses for our environment, but in the meantime.

Do I need to declare the variable(s) such as the “01c” and/or set a default value before I use them in the fomula?

thanks again,
Dave


david.ginnane (BOB member since 2007-03-22)

If you want to continue using Store and Fetch functions, I do not think you can obtain the uf5store.exe from the Business Objects support site any longer do yoour only option is to find it on the Crystal Reports version 7 CD.

  1. From the CD: Insert the Crystal Reports CD into your CD ROM drive.

  2. From the CD: In Windows Explorer, go to the CD drive, open the UFL folder, then open the Uf5store folder.

  3. Run the self-extracting executable Uf5store.exe, accepting the defaults. This copies 3 files to the C:\Seagate\UFLS folder:

· Uf5store.dll - use with 16-bit Crystal Reports
· U25store.dll - use with 32-bit Crystal Reports
· Readme.txt - explains how to install the files and use the functions they include.

  1. In Windows NT: Copy the appropriate DLL (either 16 or 32-bit) to the C:\Winnt\Crystal directory.

These dll’s will have to be copied to the same folder on your XI server.


blair :canada: (BOB member since 2006-11-17)

Hi, Dave.

Sometimes you can take shortcuts with the variable assignments, but it’s best to declare it first:

Shared StringVar 01c ;
If OnFirstRecord then 01c := "initialised" ;

lgonzalez (BOB member since 2002-07-17)

Thanks for that Luis,

I just managed to get the crystal license and client installed, “super” appears that you can’t have formula starting with a number. Good to know…

cheers, Dave.


david.ginnane (BOB member since 2007-03-22)

Sorry, Dave, missed that…

Good thing you can do search and replace in the formula!
(Do Ctrl-F and pick the Edit Text option to enable the Replace field)


lgonzalez (BOB member since 2002-07-17)

What is the exact path that the UFL’s need to be copied for XI 3.1 CR 2008 on Windows Server 2003 x64 Enterprise?


mcliffordgoo :us: (BOB member since 2003-02-13)