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

Clipped fields (tops) when pulling string data from MS-SQL

Status
Not open for further replies.

traigo

Programmer
Mar 29, 2004
15
US
CR 8.5.0.127

If you remember, I had a very annoying report I had to fight with. Long story short, they got fed up and rewrote the report but told me to fix the formatting. So I did. I came up with a solution for today and it works, but I want to know if anyone else has a solution. I am pulling data from an MS-SQL server on our network. The data comes in as parameters (from a program not SQL), strings, and numeric data. The numeric data can be pulled in a formatted correctly. The strings and parameter values sometimes cut the top of the field off. When you look at preview, you can see that the data is not displayed in the middle (vertically) of the field, but at the very top. Part of it, just a pixle or two, is on the border of the field. When it prints, it cuts the tops of the fields off. The data also doesn't lign up with the other fields. You can align the tops, middles, bottoms, but the data in the string fields will not line up to the numeric fields. I came up with a formula for converting the string fields in this report to numeric. They are numeric values stored in string fields. The program that stores them has a fixed width string that stores the numeric data like " 12" in a 7 char string field. This is the formula I came up with and it seems to correct the formatting:
FORMULA=cdbl(trim(IIF(IsNumeric(Trim({TABLE.FIELD})), {TABLE.FIELD}, "0"))) suppress on "0". The data will never be 0, The program that stores the data will either store a number greater than 0 or 10 spaces for a null value.
We use Courier New size 8 on our reports. Let me know if I need to give more information.

Anyone know of a better way of fixing this? I realize that this won't work with alpha or alpha-numeric string values and I know I will run into those soon.

There are 10 types of people in the world, those that understand binary, and those that don't.
 
I do remember.

I don't understand what "The data comes in as parameters (from a program not SQL), strings, and numeric data. " means. Does this program mean a Stored Procedure?

Are you creating a data set using an external program and passing values to a Crystal Report?

If not, how is Crystal connecting to this program to pull parameters, etc.?

Data doesn't have a pre-defined font characteristic in CR 8.5, unless you're using a formatting option such as HTML or RTF for a paragraph.

If you lassoo objects, right click and select format objects->Font, it will use the same font for each object, and all other attributes.

If you do a save data with report and forward it to my email I'd be curious to see what's going on here (only a small amount of data, please, my email is crystalreports//@//hotmail.com, remove the slashes).

-k
 
The program I am using is a clipper payroll program. I work for the company that produces it. The program opens crystal's runtime files, viewer, or whatever it's called and passes parameters to it to display/print the report. The rest of the data is pulled from the SQL tables. The parameter fields are used for things like Title, Report number, and other user defined values that are specified at the time the report is run. You enter certain values, like a date range and then run the report. These values determine what the report is to display. This lets us have a crystal report that can be displayed in many different ways. Like the title field can be customized by our clients to pass their name through. Instead of "Report for ABC" it would say "Acme Payroll Company Report for ABC".

I have tried to lasso and format the data, but it still does the same. The wierd thing is, if you pull up the report it will clip the tops. If you go back into the detail view then back to preview, it will display and print correctly now.

I'll email the report to you and let you see it.

There are 10 types of people in the world, those that understand binary, and those that don't.
 
I had no difficulties with the alignment.

I even dropped the @GLTX_MASTER alongside your formula and they aligned identically.

Perhaps you have a font or printer driver issue. If CR is substituting a font, it can get weird, and printer drivers can cause problems as well, what default printer are you using?

Try changing the font and the driver, perhaps you can isolate the concern.

-k

-k
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top