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

How do divide ALL my numbers by 1000?

Status
Not open for further replies.

Razor1973

Programmer
Joined
Jul 6, 2006
Messages
16
Subject is self-explanatory, but I will provide more details.

I have created a set of reports and my client now wants to see all figures in thousands. Dividing the amounts at the data source is not an option, before this is suggested. Long story.

I have had no choice but to create ONE FORMULA PER NUMBER on my report and divide by 1000. Actually, I created a function called {@Scale} that only returns 1000 and I am dividing by that function instead, just in case they change their minds. I could always go change the value of my {@Scale} formula.

This is an extremelly tedious job, to say the least. I have created 80+ formulas in one of my reports and I still have many more reports to go. Obviously, this increases the margin for errors.

Can you recommend an alternate solution to this problem?

TIA!
 
Creating Views for future reports resolves this sort of thing, in fact using Command Objects might have allowed for automating part of it, and posting without your software version doesn't help.

I like the idea of now using some generic formula that you'll divide by so that you might simplify this for future changes, however you're still taking the approach that business rules are embedded in a middle tier.

Writing code to automate this would likely take longer, so hire a junior coder at a reduced rate to make the changes and bill at a high enough rate to have made it worth your while.

-k
 
Thanks for your feedback, synapsevampire.

I apologize. I am using CR XI SP2.

About your suggestion of using views, I will reiterate what I said in my original post. Dividing the amounts at the data source is not an option. I am not using an ODBC connection to a database where I can create views. I am using a connection to a proprietary OLEDB provider we have absolutely no control over. The way the data is returned is the only way the data can be returned, so all the work needs to be done at the Crystal Reports end.

I myself am a programmer and would definitely have done the views and charged accordingly. However, I do not have that choice available to me.

Any other suggestions? Am I screwed and stuck with creating hundreds of formulas all of which do the same to different fields?

Thanks again!
 
Actually, that was it! Go to that thread if you're interested in the solution.

Thanks!
 
Ahh, right, that might ork for you.

Just make sure that you also include summaries on the fields as it changes the formatting only, not the value.

Also you'll probably see that the fomatting isn't observed during export.

-k
 
Well, the formatting might not be kept when exporting to Excel, but it should show exactly as it shows in Crystal Reports when exported to PDF... I hope!

I will test tomorrow.
 
I tested and, funny thing, the numbers were all kept divided by 1000 both in PDF and in Excel. They weren't when exporting to Excel Data Only, but in the regular Excel export keeping all formats, the numbers were divided by 1000. They were not just SHOWING that way, but I made sure that the number stored in the cell was already scaled.

Funny, huh? And convenient. Thank God!
 
Yeah, doesn't work in CR 10 when exporting.

We had a dtabase programmer work on a report and use a similar method to generate a report here, extending your use here to every aspect of the formatting, including bold and decimals. It was significantly more complex, and we ended up rewriting it due to exporting issues and general maintenance.

Glad it worked out for you.

-k
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top