Passing parameters between subreports in Crystal Reports

February 6, 2010 rimio Leave a comment

One problem I stumbled upon while breaking up a report into several subreports was passing parameters. Trough the designer, the communication is one way only, from the main report to the subreport. This is useful when the same parameter is to be used by two or more subreports. However, a problem arises when we want to extract data from one subreport and use it in the main report or in another. As far as I know, there is no way to do this other than using shared variables. First, create a new formula field like:

WhilePrintingRecords;
shared NumberVar myValue := {?factor} * {DB.field}

The first line makes sure the value is evaluated without missing any records. The second declares a shared variable and assigns a value. From now on, you can use it wherever you want by writing it’s definition in a formula, like this:

shared NumberVar myValue;
CStr(MyValue) + " EUR"

It’s generally a Bad Idea™ to assign a variable multiple times unless you understand the report workflow well enough. Other types you might use are CurrencyVar, StringVar, BooleanVar, DateVar, TimeVar and DateTimeVar.

This being said, there are rumors of SAP releasing a 2010 version and finally integrating it in Business One 8.8 (goodbye crappy layout editor :D ).

Categories: Work

Technical problems

November 7, 2009 rimio Leave a comment

The GoDaddy hosting bit the dust again because I forgot to pay for it. Basically, I’ve lost everything form my last website; not that I had a lot to lose but it’s still annoying. I’ll have to repack binaries and sources, redo the about page etc.

Quick update: I’ll teach a weekend class on “3D Graphics Programming” (not a great title, I know) starting next weekend, with a duration of four weekends. The good part is that I like the topic. The bad part is that I don’t have a classroom. Nor a projector. Nor a laptop. Nor any finished slides. To be frank, I ain’t got shit, which means going overdrive for the next week.

Categories: Life