February 10, 2012 at 2:41 am
Hello,
i have to export some % values like 0.26% or 99.45% to excel which is now sent as text to excel.
how to format it automatically while exporting? else the user has to change it to % value before he uses the data.
Thanks in advance.
Regards
Durai Nagarajan
February 10, 2012 at 7:31 am
Hello,
I'm not exactly sure how to format it in Visual Studio, but an easy way to do it is convert the 'text' to 'number' in your syntax. The code will be different depending on what type of database you're using (Orcale, SQL Server, etc). Here's an Oracle example that I've used in the past...
to_number(REGEXP_REPLACE(REGEXP_REPLACE(b.value,'[a-zA-z]',''),',',''))) as "Population"
In this code, a.value is stored as text, and this code converts it to a number.
This will definitely work, but I bet there's a way to do it in VS.
Hope this is helpful.
February 10, 2012 at 8:48 am
hello,
thsi is what i am using
"=IIF(IsNumeric(Fields!units.Value), Formatpercent(Fields!units.Value / Fields!Total.Value,2 ), Formatpercent(0,2 ))"
hope formatpercent cannot be converted to decimal.
kindly help
Regards
Durai Nagarajan
February 10, 2012 at 8:55 am
Is that the code you're using in your dataset query pane?? Or the code your using in our layout pane?? Either way, I'm curious to know if it works, please let me know!
Thanks
Mike
February 10, 2012 at 9:15 am
Hello,
this is in report layout not in dataset.
Regards
Durai Nagarajan
February 16, 2012 at 3:56 am
Hello,
can i get help on this?
Regards
Durai Nagarajan
February 18, 2012 at 6:54 am
I would make a small macro in Excel which will format the cell.
Selection.NumberFormat = "0.00%"
/Gosta
February 20, 2012 at 2:14 am
how can i embed the macro embedded excel while exporting.
Regards
Durai Nagarajan
Viewing 8 posts - 1 through 7 (of 7 total)
You must be logged in to reply to this topic. Login to reply