This is a migrated thread and some comments may be shown as answers.

Report lose formatting after Export in Excel

12 Answers 380 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
intrasoft
Top achievements
Rank 1
intrasoft asked on 19 Jan 2009, 12:16 PM
Hello,

I have a textbox on my report with value 0.083333333. I formatted this Textbox with the format {0:#.000}. In the preview the value is formatted with 3 decimal places.

When I export this preview to Excel, the report lose this formatting.

Someone can help me?

Thx
Bruno

12 Answers, 1 is accepted

Sort by
0
Steve
Telerik team
answered on 20 Jan 2009, 01:01 PM
Hello intrasoft,

I tried this locally but was not able to reproduce the problem with decimal, double and integer field types. Is your field by any chance string data type? If this is the case, excel would threat this field as string and therefore display it as is, with no formatting applied.

Kind regards,
Steve
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
intrasoft
Top achievements
Rank 1
answered on 20 Jan 2009, 01:26 PM
Hello Steve,

no they are all double-Fields. Additionally I tried to convert them with CDbl in Double, to be secure. But as soon as I export the formatted value, in excel the value is not formatted. The Format-Type of the Cell in Excel is always Standard.

The Data-Basis is a Typed Dataset DataType double, maybe that should be a problem?

thx
Bruno
0
Steve
Telerik team
answered on 20 Jan 2009, 02:03 PM
Hi Bruno,

This is really strange and we would like to further investigate this. We would need you to attach a sample report exhibiting the problematic behavior, the exported excel file and the regional settings on the machine where you work. If this is on a server and you export from your local mashine, please provide the regional settings for both.

Kind regards,
Steve
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
intrasoft
Top achievements
Rank 1
answered on 20 Jan 2009, 02:34 PM
Hello Steve,

I created a sample application. You can download it from our page (I couldnt attach files on this thread).
All files are in the zip-File (incl. the excel file)

Sample-Code

Thx for your help
Bruno
0
Steve
Telerik team
answered on 21 Jan 2009, 05:23 PM
Hi Bruno,

Sorry for the misunderstanding. I must have missed the fact that you are using custom format string (which are not supported as noted in our documentation) to achieve the scenario you describe and tested this locally by setting the format directly through the format editor of the textbox, which applies {0:N2}, which works correctly. Please use it instead and the excel cells would be properly formatted.

Sincerely yours,
Steve
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
intrasoft
Top achievements
Rank 1
answered on 26 Jan 2009, 07:08 AM
Hello Steve,

thank you for your answer. I changed the format, and now it works.
But just for info, I created the format-string with your Format-Builder. Category=>Numer, Decimal places =>2, and the result was {0:#.00}.

Thx
Bruno


0
Steve
Telerik team
answered on 26 Jan 2009, 02:55 PM
Hello Bruno,

Indeed after some testing I was able to reproduce the problem and it seems to appear only on initial format appliance. If you open the Format Builder for this item once again and simply click OK without any changes, the proper {0:N2} format would be shown.
I've logged it in our bug tracking system and we would further investigate what is the culprit here. Your Telerik points have been updated for bringing this to our attention.

Regards,
Steve
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Rudy
Top achievements
Rank 1
answered on 04 Feb 2009, 10:13 AM
maybe i have a similar problem...
my radgrid has 2 columns:
 <telerik:GridBoundColumn DataField="Price"  EmptyDataText="0" HeaderText="Prezzo"
                            UniqueName="Price">
                        </telerik:GridBoundColumn>
                        
                        <telerik:GridBoundColumn DataField="Discount" EmptyDataText="0" HeaderText="Sconto"
                            UniqueName="Discount">
                        </telerik:GridBoundColumn>

Price and Discount in the SQL database are decimal(9,2)

when i export to excel some values of these 2 columns completely change; some remains correct: ex.
price          discount
2500.00     0.00

others become like
430,50       0,43

i noticed that "." is substituted with ","
i cannot find a relation between the original value and the "strange" value.
when i export to CSV it's all correct.

Thanks
Rudy
0
Steve
Telerik team
answered on 04 Feb 2009, 11:38 AM
Hi Rudy,

Please open a thread in the RadGrid category. This forum is specifically for Telerik Reporting and therefore your issue is not related to the product in any way. By opening a thread in the proper category, your inquiry would be properly answered by the people developing/maintaining the corresponding product.

Thank you for the understanding.

Greetings,
Steve
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Vanessa Saraiva
Top achievements
Rank 1
answered on 25 Jan 2010, 10:04 AM
Hello,
After exporting report to excel, i have tried filter the document by a text field column. However, the search did not worked.
Do i have to do something in particular to achieve this type of search, before exporting the report?
It seems that is some problem with string fields, because this only hapen with this type of columns.
What can I be doing wrong?

Thanks.
0
Steve
Telerik team
answered on 25 Jan 2010, 05:49 PM
Hello Vanessa,

Please review the supported formattings in excel in the Design Considerations for Excel Rendering help article and verify that the formatting you're using is supported. To further pinpoint what is the applied formatting, check the problematic column cells through the "Format Cells..." context menu in Excel.

Kind regards,
Steve
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Vanessa Saraiva
Top achievements
Rank 1
answered on 26 Jan 2010, 03:26 PM

Hi,

I really didn't get it. I can´t find what i´m doing wrong.
I have changed the cells formatting from General to Text and copied the column to another excel document. In this new document the filter works fine. So, the problem might be related to cells formatting.

Could you give me some tips to solve this problem?

Thanks in advance.

Tags
General Discussions
Asked by
intrasoft
Top achievements
Rank 1
Answers by
Steve
Telerik team
intrasoft
Top achievements
Rank 1
Rudy
Top achievements
Rank 1
Vanessa Saraiva
Top achievements
Rank 1
Share this question
or