Page 1 of 1

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

Posted: Wed Sep 03, 2008 2:57 am
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!

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

Posted: Wed Sep 03, 2008 7:50 am
by Edward
Hello.

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

Thank you.

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

Posted: Wed Sep 03, 2008 8:43 am
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!

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

Posted: Thu Sep 04, 2008 6:26 am
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.

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

Posted: Thu Dec 25, 2008 12:43 am
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!

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

Posted: Thu Dec 25, 2008 4:39 pm
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.

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

Posted: Mon Jan 12, 2009 6:10 am
by Eugene
Thank you, Ivan,
That is a good solution!

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

Posted: Mon Jan 12, 2009 6:21 pm
by Ivan
Hello,

Let us know if you need any help.

Thank you.