Page 1 of 2
Specify default font for report
Posted: Wed Mar 14, 2007 6:18 am
by IanMcCarthy
On my PC a report previews OK, a series of text boxes displaying descriptions & values.
In the designer the text boxes show the font as Arial 8pt normal. (Good)
On another PC the user has changed some of the Windows fonts to bold.
On this PC the text boxes also display values in bold. (Bad)
Can I pre-set the default document font to cure this?
Or will I have to pre-set each text box in the document individually?
Many thanks,
Ian
Specify default font for report
Posted: Wed Mar 14, 2007 7:43 am
by Vital
You can use following code:
Code: Select all
foreach (StiPage page in report.Pages)
{
page.SelectAll();
page.SetFont(font);
}
Thank you.
Specify default font for report
Posted: Thu Mar 15, 2007 5:06 am
by IanMcCarthy
I've just had some further information about this:
It appears the user had changed the dpi setting of his monitor from 96 to 120 (rather than changing the font selection as I originally thought).
This made all the text appear bigger (it looked like bold).
Just something to watch out for...
Many thanks for your splendid support.
Ian
Specify default font for report
Posted: Mon Nov 26, 2007 2:47 pm
by ChristianH
I´m facing the same problem.
Reports are designed for monitors set to 96 dpi. On monitors with 120 dpi everything becomes bigger....
Is there an easy solution ? I´m searching for a switch like "use 96dpi setting" or something like this...
Specify default font for report
Posted: Mon Nov 26, 2007 4:43 pm
by Vital
We need time for investigation of this problem. We will inform you about progress in this topic.
Thank you.
Specify default font for report
Posted: Mon Dec 03, 2007 3:09 am
by Vital
Try to use following method:
Code: Select all
private void ChangeFontSize(StiReport report)
{
StiComponentsCollection comps = report.GetComponents();
foreach (StiComponent comp in comps)
{
IStiFont font = comp as IStiFont;
if (font != null)
{
font.Font = Stimulsoft.Base.Drawing.StiFontUtils.ChangeFontSize(font.Font, font.Font.Size * 96 / 120);
}
}
}
Thank you.
Specify default font for report
Posted: Fri Dec 07, 2007 3:08 am
by ChristianH
This is a solution, indeed.
Thanks !
Specify default font for report
Posted: Fri Jan 04, 2008 9:52 am
by mmurdock
Where do you put this? Is it in the report or do you put it in your app?
Thanks,
Mat
Specify default font for report
Posted: Fri Jan 04, 2008 12:39 pm
by Vital
You can put this method in report code or in application.
Thank you.
Specify default font for report
Posted: Fri Jan 11, 2008 3:09 pm
by René van den Berg
Hi,
I'm having problems with DPI settings of PC's of my customers as well. I have the problem that one customer is using DPI 120 and the other is using DPI 96, so I can't use the solution you suggested. Wouldn't it be better to make stimulreport independent of the DPI settings on a PC? I can't imagine that anyone thinks it is useful to scale the reportfonts as well as the screenfonts.
Greetings,
René van den Berg
Egosoft B.V.