Showing posts with label exported. Show all posts
Showing posts with label exported. Show all posts

Wednesday, March 28, 2012

Numbers and Crystal Reports 9

I exported a column of type float to SQL Server using DTS. In Crystal
reports, it 'sees' the column as a string! Is 'float' the best type to
use? Must I create a formula field in CR to 'correct' for this?Hi

From the database side you should choose the most appropriate datatype for
the data which it will hold, at a guess decimal might be more appropriate.

Its been a while since I used Crystal so I can't remember how it determined
the datatypes, but I seem to remember that you mask the output to be in the
format that you require.

John

"chrispycrunch" <chrispycrunch@.gmail.com> wrote in message
news:1107712517.428328.79850@.o13g2000cwo.googlegro ups.com...
>I exported a column of type float to SQL Server using DTS. In Crystal
> reports, it 'sees' the column as a string! Is 'float' the best type to
> use? Must I create a formula field in CR to 'correct' for this?|||chrispycrunch (chrispycrunch@.gmail.com) writes:
> I exported a column of type float to SQL Server using DTS. In Crystal
> reports, it 'sees' the column as a string! Is 'float' the best type to
> use? Must I create a formula field in CR to 'correct' for this?

So if you sp_help on the table in Query Analyzer, it is reported to be
a float?

If so, you should probably ask in a forum devoted to Crystal Reports. We
use Crystal in our shop, but I don't have it installed on my machine...

--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp|||"John Bell" <jbellnewsposts@.hotmail.com> wrote in message
news:4206972c$0$7707$fa0fcedb@.news.zen.co.uk...
> Hi
> From the database side you should choose the most appropriate datatype for
> the data which it will hold, at a guess decimal might be more appropriate.
> Its been a while since I used Crystal so I can't remember how it
> determined the datatypes, but I seem to remember that you mask the output
> to be in the format that you require.
> John
> "chrispycrunch" <chrispycrunch@.gmail.com> wrote in message
> news:1107712517.428328.79850@.o13g2000cwo.googlegro ups.com...
>>I exported a column of type float to SQL Server using DTS. In Crystal
>> reports, it 'sees' the column as a string! Is 'float' the best type to
>> use? Must I create a formula field in CR to 'correct' for this?
>
I would imagine decimal is probably more appropriate than float.

I usually base my crystal reports on stored procedures rather than directly
on tables.
I can then do any "work" necessary to make the crystal report easier to put
together in the stored procedure which I, quite frankly, find a lot easier
to work with than the crystal alternatives.
I'd do any maths I could in the stored procedure as well.
If float is best for storage and decimal for presentation then you could
cast the field in your stored procedure's select statement.

If these are no good for you then, is it just a presentation thing?
You can specify a formula for display format of a field in crystal.

HTH
--
Regards,
Andy O'Neill

Monday, March 12, 2012

Number format do not work when exported to excel?

I have a report where I have formated the numbers with #.#. When I run this
repot this works well and give me the decimal only when it is needed.
However, when I export to excel, I get te decimal point even when it is not
needed. For example the when I have the whole number 100 it displays as 100.
in excel.
I could use the N1, but I do not want 100.0 to display either.
Any help would be appreciated.
p.s. I am using a matrix if that makes a difference. I have not noticed
this when exporting a table, although I don't know it doesn't happen.On Mar 22, 8:58 am, bugfish69 <bugfis...@.discussions.microsoft.com>
wrote:
> I have a report where I have formated the numbers with #.#. When I run this
> repot this works well and give me the decimal only when it is needed.
> However, when I export to excel, I get te decimal point even when it is not
> needed. For example the when I have the whole number 100 it displays as 100.
> in excel.
> I could use the N1, but I do not want 100.0 to display either.
> Any help would be appreciated.
> p.s. I am using a matrix if that makes a difference. I have not noticed
> this when exporting a table, although I don't know it doesn't happen.
It sounds like this is a defect in the export to Excel functionality.
Sorry I could not be of more assistance.
Regards,
Enrique Martinez
Sr. SQL Server Developer|||How about using a conditional formating expression to supress the trailing
zero:
=iif(Fields!.<FieldName>.Value - Fix(Fields!.<FieldName>.Value = 0, "#",
"#.0")
"EMartinez" wrote:
> On Mar 22, 8:58 am, bugfish69 <bugfis...@.discussions.microsoft.com>
> wrote:
> > I have a report where I have formated the numbers with #.#. When I run this
> > repot this works well and give me the decimal only when it is needed.
> > However, when I export to excel, I get te decimal point even when it is not
> > needed. For example the when I have the whole number 100 it displays as 100.
> > in excel.
> >
> > I could use the N1, but I do not want 100.0 to display either.
> >
> > Any help would be appreciated.
> >
> > p.s. I am using a matrix if that makes a difference. I have not noticed
> > this when exporting a table, although I don't know it doesn't happen.
> It sounds like this is a defect in the export to Excel functionality.
> Sorry I could not be of more assistance.
> Regards,
> Enrique Martinez
> Sr. SQL Server Developer
>|||Thanks for the tip. It solved the problem in this instance, however it does
get messy when the filed is a calculated field and not just a field name.
"Bruce Johnson [MSFT]" wrote:
> How about using a conditional formating expression to supress the trailing
> zero:
> =iif(Fields!.<FieldName>.Value - Fix(Fields!.<FieldName>.Value = 0, "#",
> "#.0")
>
> "EMartinez" wrote:
> > On Mar 22, 8:58 am, bugfish69 <bugfis...@.discussions.microsoft.com>
> > wrote:
> > > I have a report where I have formated the numbers with #.#. When I run this
> > > repot this works well and give me the decimal only when it is needed.
> > > However, when I export to excel, I get te decimal point even when it is not
> > > needed. For example the when I have the whole number 100 it displays as 100.
> > > in excel.
> > >
> > > I could use the N1, but I do not want 100.0 to display either.
> > >
> > > Any help would be appreciated.
> > >
> > > p.s. I am using a matrix if that makes a difference. I have not noticed
> > > this when exporting a table, although I don't know it doesn't happen.
> >
> > It sounds like this is a defect in the export to Excel functionality.
> > Sorry I could not be of more assistance.
> >
> > Regards,
> >
> > Enrique Martinez
> > Sr. SQL Server Developer
> >
> >

Number Format after Exporting to Excel from Reporting Services

I suddenly have a large amount of users asking me why they can't do
sums on Excel 2003 exported Reporting Services reports. The numbers
in the cells are not formatted as numbers nor does it appear like you
can change it within Excel. Some are retypeing number into each
column.
Is this something I can control within Reporting Services or does
something need to be done within Excel after the export.
Any help would be great.
Thanks,
MikeOn Jul 13, 12:52 pm, michael h <mikej...@.gmail.com> wrote:
> I suddenly have a large amount of users asking me why they can't do
> sums on Excel 2003 exported Reporting Services reports. The numbers
> in the cells are not formatted as numbers nor does it appear like you
> can change it within Excel. Some are retypeing number into each
> column.
> Is this something I can control within Reporting Services or does
> something need to be done within Excel after the export.
> Any help would be great.
> Thanks,
> Mike
You might be able to convert the numbers via an expression and that
way it can export and be recognized as an integer/long value. An
expression similar to this might work.
=CInt(Fields!FieldName.Value)
-or-
=CLng(Fields!FieldName.Value)
Hope this helps.
Regards,
Enrique Martinez
Sr. Software Consultant