Export to Excel - data doesn't fit to cell vertically

Stimulsoft Reports.NET discussion
Post Reply
Eugene
Posts: 28
Joined: Sat Aug 12, 2006 9:11 am
Location: Ekaterinburg, Russia

Export to Excel - data doesn't fit to cell vertically

Post by Eugene »

Hi!
I've got a problem when exporting report data to Microsoft Excel. Seems that when I have a multiline data in the cell, the export engine cannot determine the correct height of Excel row. So, when there needs to be, say, 4 lines of text in a cell, separated by LF+CR, it gives area enough to fit only 2.5 lines. The rest of data is still in the cell, but the cell itself is just not stretched enough vertically.
Is there a way to avoid this, and make the excel row be larger, so all the data fits?
I'm using the latest build (27.08.2008 with VS2008).
I can e-mail a report file or screen shots to support if they are needed.
Thank you!
Edward
Posts: 2913
Joined: Fri Jun 09, 2006 4:02 am

Export to Excel - data doesn't fit to cell vertically

Post by Edward »

Hello.

Yes, it would be great. Please send mrt and mdc files of the report to support[at]stimulsoft.com.

Thank you.
Eugene
Posts: 28
Joined: Sat Aug 12, 2006 9:11 am
Location: Ekaterinburg, Russia

Export to Excel - data doesn't fit to cell vertically

Post by Eugene »

I've sent a letter to support. Unfortunately, I couldn't generate an mdc with data, only report preview in designer, then save. Obviously, there is no data loaded. Is there a way to export data to mdc, say, instead of pdf or xls at runtime? Or this is not needed?

Thank you!
Ivan
Posts: 960
Joined: Thu Aug 10, 2006 1:37 am

Export to Excel - data doesn't fit to cell vertically

Post by Ivan »

In the MS-Office the Wysiwyg-feature sometimes works incorrectly,
text in editing mode and in preview may looks differently.
Therefore, often a text in the MS-Office looks not how in report preview.

Also MS-Word and MS-Excel allows you to set precisely the sizes of objects, but does not allow you to set the sizes of the text precisely.

Here some advises about creating reports for the MS-Office.
Try to use different fonts for text.
For each font try to select appropriate TextQuality;
Here some examples: For Arial font the best choice is 'Standard' mode. For Courier font is 'WYSIWYG'.

Thank you.
Eugene
Posts: 28
Joined: Sat Aug 12, 2006 9:11 am
Location: Ekaterinburg, Russia

Export to Excel - data doesn't fit to cell vertically

Post by Eugene »

Hi, I played with the situation a while ago, this didn't help a lot. Now, returning to the problem, I figured out that the stated problem may be solved (still not fully, but in some way) by increasing the Margins property of Text controls. This allows a larger number be set for cell height, but seems that Excel does not implement margins at all. So, I get larger cell height and same text - the problem is solved.
The new problem is that PDFs set margins easily, so if I export this particular report to PDF, I get huge margins, which is not acceptable. So, is there a way to find out, what is report export format when the report is rendered? I see event named Get Excel Value, when is that one fired and can I change cell margin here?
Thank you!
Ivan
Posts: 960
Joined: Thu Aug 10, 2006 1:37 am

Export to Excel - data doesn't fit to cell vertically

Post by Ivan »

Hello,
Hi, I played with the situation a while ago, this didn't help a lot. Now, returning to the problem, I figured out that the stated problem may be solved (still not fully, but in some way) by increasing the Margins property of Text controls. This allows a larger number be set for cell height, but seems that Excel does not implement margins at all.
Yes, MS-Excell not support margins for the cell, only for page.
So, I get larger cell height and same text - the problem is solved.
The new problem is that PDFs set margins easily, so if I export this particular report to PDF, I get huge margins, which is not acceptable. So, is there a way to find out, what is report export format when the report is rendered?
Please do following (for example, for textbox TextNN):
1. Add boolean variable "isExcell" to report's Dictionary.
2. In BeforePrintEvent of TextNN please write

Code: Select all

if (isExcell) TextNN.Margins.Left = 15;  //or other margin value
3. In your application, write commands:

Code: Select all

report.Load("YourReport.mrt");
report.Compile();
report["isExcell"] = true;   //or false, as you need
report.Render();
report.Show();
Thank you.
Eugene
Posts: 28
Joined: Sat Aug 12, 2006 9:11 am
Location: Ekaterinburg, Russia

Export to Excel - data doesn't fit to cell vertically

Post by Eugene »

Thank you, Ivan,
That is a good solution!
Ivan
Posts: 960
Joined: Thu Aug 10, 2006 1:37 am

Export to Excel - data doesn't fit to cell vertically

Post by Ivan »

Hello,

Let us know if you need any help.

Thank you.


Post Reply