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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Crystal Coding Standards 5

Status
Not open for further replies.

kutoose

Technical User
Sep 11, 2002
169
US
I am looking to standardize crystal reporting development in my organization. There are
a few hundreds of reports which I have to re write and format to look 'professional'.
I need some guide lines so that the future reports would be created on the same lines. I need
to create a document to do this...

Any help is appreciated !

 
Each organization seems to have a different approach.

I build both generic landscape and portrait templates to be used as starting points for all reports, inclusive of art, report title (formula comprised of the summary info Title field), page number format, etc. Then I use a suppressed, colorized Page Header section containing text boxes demonstrating particulars.

As for variable naming, etc., use whatever the IT standards are.

-k kai@informeddatadecisions.com
 
If you want a starting point for presentation, check out the Xtreme sample reports you have with your CR install. You can pinch some of their design ideas, and customise them to your own tastes.

Naith
 
Actually I wanted something in Crystal which will be similar to a coding convention. It can be specific to an organization...It will be used by the developers who create report, knowing the company standards for reports
 
Like specifications how to name a report, how to name a variable etc etc. This will be specific to an organization
 
I think you're throwing us a little here, Kutoose.

If you're designing reports for an organisation, and you want something which will indicate your company coding standards - then you should be outlining these standards to Crystal. Crystal can't tell you what the standards for your organisation are.

If you're referring to a range of templates that you might be able to distribute to multiple companies, then I'm afraid Crystal doesn't have anything like that pre-packaged.

If I've gone and grabbed the complete wrong end of the stick, then please set me straight.

All the best,

Naith
 
Dear Kutoose,

If I understand correctly, you are trying to create a Standards document and rather than starting from scratch you are looking for ideas and recommendations from the forum and/or an actual document if we have one to shorten your development time.

I don't know if anyone else has such a document. I write reports for companies so I tend to design them the way I like unless they have a particular design requirement.

Here are some tips though:

Name reports consistently and create them with names that describe what they do and when they are run. This helps alot if an admin assitant is charged with running the reports - they can simply sort by name in their report directory and they are ready to go...easy to find the ones that the boss wants run.

For example:

Weekly Mgt Total Sales by Region
Weekly MKT Total Sales by Bracn
Weekly Salesrep Total Sales by Customer
Daily Salesrep Total Sales
Monthly Mgt Total Sales by State

This helps to sort out what a report does and when it is run.

Make it a Standard to populate the File/Summary Info with Author, keywords, Title, and comments. Comments should be updated every time a report is modified with a small indication of what was modified, the date and modifier's initials.

In your reports themselves:

Place the file path at the bottom of reports, this will help you track them down when a user wants you to modify them.

Name formulas, variables, expressions, and parameters for what they do! Make the naming of these consistent across reports.

For example, if you add date range parameters like Start Date, From Date, To Date and End Date to reports; come up with a consistent name for them so that you can copy and paste select statements, etc from report to report.

I create formulas for each Title (Title, SubTitle, DateRamge) on My report. S

Document formula with comments. Document report with a Formula (Documentation?) and insert the text into the formula or use a text box to do the same, you can suppress it and make it a color like green so that it is easy to see in Design, but doesn't show up at all in preview.

Finally, as you are rewriting those 100 reports, keep track of what you like as design standards (logo in upper right, etc.)

Create a template report that you can start from that has as much of your standards included.

The goal of standards is to make the report writer's job easier - so don't get too carried away with rules :)

Hope this helps,

ro
Rosemary Lieberman
rosemary@microflo.com, Microflo provides expert consulting on MagicTSD and Crystal Reports.
 
As mentioned by other posters, standards are highly subjective and are specific to the needs of every environment.

I've actually written CR Coding Standards checklists for past clients. In my case the checklist is a table with entries for the various categories of standards and then columns for Developer and End User initials. The idea is that the developer--as part of an iterative development process--will check off each standard (as applicable) and turn this document over to the testers along with signed specs, mockups and a completed report. The End User, as part of the acceptance testing process will validate the formatting along with the functionality and accuracy of the report. Believe it or not, I've had developers (mostly junior) that will check off a standard when it has clearly not been applied.

The checklist typically contains both general and client-specific report formatting and even SQL-formatting standards (not only when views and stored procs are used, but within complex or multi-line CR formulae). Examples are:[ol][li]All margins must be .25" except for the top, which is .50" to allow for printing and binding.[/li]
[li]Dates will be formatted as MM/DD/YYYY[/li][li]Text fields will left justified[/li][li]Numeric fields will be right justified with no decimals, unless specified[/li][li]Formulae will not be used in the Record Selection Criteria unless they can be passed to the server (/gives props to SynapseVampire [2thumbsup])[/li][li]etc...[/li][/ol]
 
Thanks Rose Mary and rhinok ...

Thanks a million...

That was excatly I wanted. I managed to create a document with all these information. Also can you suggest some variable declaring standards ?

There are many reports in the company from different departments.

Sorry Naith and synapsevampire I was not probably able to convey what I was looking for ...
 
I like to name formulas that work with a specific variable in a way that those formulas stay together in the formula list:

Amount1 Accum
Amount1 Display
Amount1 Reset

Works better than:

Accum Amount1
Display Amount1
Reset Amount1

Make sure that the names of the variables and formulas are both self evident, rather than cryptic.

I have started leaving comments in variable formulas that indicate what other formulas use this variable, and even where those other formulas are located. This is especially helpful when you are passing variables from Subreports. I try to do this (at least) in any formula that display's a value on the report, because that is where I usually start troubleshooting. That allows you to more quickly work backward to the source formulas. Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Guide to using Crystal in VB
tek@kenhamady.com
 
Naming variables in Crystal is less important than in other development environments because Crystal forces you to re-declare a variable in each formula that uses it. Hence, you can easily see if the variable is local, global, or shared and its data type.

If you wish, you can use the typical naming convention of
gs_something to indicate Global String var,
sd_something to indicate a Shared Date var,
lsa_something to indicate a Local String Array var, etc.

While I'm religious about this in development
environments such as VB & PowerBuilder, I haven't seen a real need for it in Crystal.

It's more important to comment your formulas and name them properly. To add to the useful comments above, I name aggregate formulas using a technique that makes it easy to figure out the:
Aggregation Level: (G for Grand, 1 for level 1, ...)
and
Aggregation Type: (t for sum, a for average, Max for Maximum, Min for Minimum, ...)

This allows me to glance and identify:
@Value_Gt as Grand total of Value
@Value_1a as Level-1 Average of Value
@Value_2Max as Level-2 Maximum of Value.

Cheers,
- Ido CUT, Visual CUT, and DataLink Viewer:
view, e-mail, export, burst, distribute, and schedule Crystal Reports.
 
Don't know if its relevant but I use good ol' fashioned Microsoft word. Every report I have has a Word document that spells out exactly what the point of the report is. This will include all Tables used, links, parameter fields, formulas, etc... and even a 'possible change's' section. I also have another document that lists all the Formula fields I've previously used with their names, the code behind them and an explanation. This way I only need to remember the functionality of a formula. I then search through my document and cut'n'paste both name and code into my new report. What I would be interested to know is how people keep a tag on report versions. i.e. how do people keep track of a report from an idea to the completed report.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top