views:

183

answers:

1

I have a crystal report, which takes data from an XML template. For a particular field of report, say 'Cost' the database stored procedure send data to XSD file in decimal format , but when the crystal report displays data picking from XSD, it is rounded off.

When i right click on other data fields of report, I can see 'Field:table1.columnname',. But when i click on 'Cost' field, it shows 'Text:'.

To my understanding, this is a text field which is mapped to pick data from XSD and since the type is text, it gives result in text hence truncating the decimal.

Please suggest how can I get decimals here.

P.S: This code was created by someone else, so i have no idea on what they had set at that time. I have to fix it and i have no clue about it.

+1  A: 

(This sounds like one of those problems which is probably fixable in 20 seconds if I stood over your shoulder. Or not. Since that's not possible, let's do some background first:)

  1. When you right-click on a field and see Text:, that means it's just a Text Object which may or may not display data from the database (if you just roll your mouse over it, it should say Text Object). When you want a report to say something generic like "Hello, my name is", this is how you'd do it. But you can also drag & drop data fields into it as well.

  2. The other data fields that say 'Field:table1.columnname' when you right-click are indeed pulled (almost) directly from the database

Try this:

  1. Go into your Field Explorer (If it's not open already, from the menu bar, choose View->Field Explorer). Check the Field Type of your field of interest. If it's a number field, then that's how it's being pulled from the database, which is good.

  2. Try deleting the original field in the report and drag&dropping your field directly from the field explorer. Preview the report. Right click to Format Field. There, you'll see display options to add/remove decimals, insert currency symbols, etc.

That's enough for now. Let us know how it goes.

PowerUser
Thanks for the answer. My day one with Crystal reports and I was asked to fix something. As told above, I created new field, added formula, deleted original and drag/dropped new. Finally it is done.. and it Works :) ! Thanks a lot for your help...
RMN