Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

To difficult for Crystal

Status
Not open for further replies.

smil3y

IS-IT--Management
Jan 8, 2004
79
AU
I am using VB6 and CR8.5. My VB application creates an access database then creates the fields within the database.
My problem is that the number of fields varies depending on what the user wants to report on. For example the table would normally have fields: RptDate, Section and Hours. However the user can select several Classes of Incidents to report on. Eg Class1 and Class2 or Class1, Class2 and Class3 - maybe even Class4 etc.

The database took a while but that all works fine now. My problem is how do I get Crystal to report on these varying number of classes. Is it possible?

Further can I chart a varying number of classes.

Any help/suggestions - please.
 
Hi,
It may be difficult, given that odd database design, to get Crystal to use the dynamically changing table (Crystal 'remembers' the table structure and may not work if fields are added or removed ( especially) from the table but referenced in the report)..
Does Access allow for the creation of stored proocedures or views? If so, you can probably create a parameter ( or parameters) to pass to the SP that will specify which fields to use..


[profile]
 
Maybe it is odd - but to me this seems the only way I can report on the required data. I have information coming from three or four tables and I am combining it altogether in this single table so that I can report on it.

I have searched high and low trying to get options or best way to do this but am having no luck. I am thinking I may just have to create a heap of fields in the table (so that it is not dynamic) then write data to fields that are required and then try to suppress unused fields.

Guess this will slow things down and make it very messy.
 
Have you tried using a standard table structure that alwasy has ALL the possible fields and only putting data in those that have been requested? You could then suppress fields on the report based on whether the data is null. This way your users get what they need and Crystal has a non-varying data structure to work off of.

-D
 
Thanks D. My problem is that I need to create a report that is based on a table that has a list of fields called CLASSES. The users can vary the number of classes so my reports table was trying to be dynamic and handle the classes that have been craeted.

I have finally decided that I will base my report on the first 6 classes (hopefully there should not be anymore). I have therefore create a standard structure and am suppressing fields not used.

I just assumed that using CR would be a bit more flexible.
 
With VB6 and CR8.5 you most certainly can build a report dynamically in VB using Crystal's RDC (Report Design Component).
In your CR Help menu go to Seagate Software on the Web -->Developer Samples and that will take you to Business Objects (formerly Crystal Decisions), Developer Zone and search for RDC, VB, and perhaps the word "dynamically". You will find what you need. It is no problem for the RDC to read a table layout and include those fields in a report. I assume you are using either the Professional or Developer Edition of Crystal. Otherwise you will have to upgrade your edition. Well worth the investment.

Good Luck
 
Smil3y,

I need to create a report that is based on a table that has a list of fields called CLASSES

That sounds like a very good argument for normalisation. In other words, you need a parant and a child table. The parent table will contain the date, section, hours, etc. The child table will contain one record for each of the classes. This record will include a link back to the parent record.

I know you won't want to alter your table structure at this stage, but the parent/child scenario is really the easiest way to handle this situation. It's one that both Access and Crystal can handle with ease.

Mike


Mike Lewis
Edinburgh, Scotland

My Visual Foxpro web site: My Crystal Reports web site:
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top