Creating a dynamic Crytsal Report

  • Thread starter Thread starter puunda
  • Start date Start date
P

puunda

Hi,

Hope I've posted to the right groups.

I'm trying create a Crystal Report for the first time using C# (novice
at that as well). The CR I can handel. What I want to do is to have a
whole bunch of fields in my application (winforms) which the user can
select to include in the report or not.

I believe I can use the CR Engine to change the report at runtime. Here
is my problem. If there's 20 items the user can select to include in
the report, for argument sake, in the report header. You would need to
put all 20 items in the report header section. Even though you could at
runtime show/hide what is displayed, the space each one takes is the
same, and so if the user selects 1 or 2 items, then they will display,
but the other 18 or 19 items would simply be blank spaces.

I want to allow the user be able to select data, and charts/graphs, so
they fully customize the report, but can't think of a way around the
spacing issue. Can this be done in the built in version of CR? Is there
another reporting package which is better suited to what I want to do?

I would've thought that this would be quite a common request. Allowing
the user to customize the report before generating it.

Thanks in advanced.

Puunda
 
There are always other options. But lets answer the question at hand, and
make no mistake I am not a CR expert and I don't like CR.

You would like to allow the user to specify 1:20 data elements to be
displayed. That tells me you will need 40 formula fields, and 20 paramater
fields.

20 Paramater fields state what data elements are turned on, simple a
boolean.
20 for the headers, 20 for the data. Conditionally, these will look at the
paramaters and display the appropriate values or blanks. This allows you to
be dynamic.

I hope that was clear.


As to other solutions. The simplest would be HTML output using XML and CSS
stylesheets, this would allow for totals and such, barring that, CSV files
that populate excel or 123 would work as well. Of course if you have it
available, I would say that Access make an excellent reporting tool.
 
You can embed multiple data items in a text field in CR. CR will then
format the text field appropriately: if some items "disappear" then the
other items will flow leftward to take up the space. As AMDRIT points
out, the best way is to use boolean parameters and formulae within
Crystal: each formula returns the desired data item plus any desired
padding space if the parameter says to turn it "on", and returns an
empty string if the parameter says to turn that data item "off".

The other possibility, for larger data items, is to each one in its own
section, and instruct Crystal to suppress the section if it's blank (in
section options).

Yes, this does limit what you can do in your reports, but then Crystal
isn't really designed to dynamically "flow" report items very well.
 
Some things which I had forgot to mention were that this report is
designed to be either printed or saved as a pdf then emailed. It also
includes a lot of graphs/chart etc, the the user would also want to be
able to select on creation. Is there a way of accomindating this
feature using CR?

Thanks again,

Puunda
 
Back
Top