Specify default font for report
-
- Posts: 37
- Joined: Wed Oct 11, 2006 3:44 am
Specify default font for report
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
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
You can use following code:
Thank you.
Code: Select all
foreach (StiPage page in report.Pages)
{
page.SelectAll();
page.SetFont(font);
}
-
- Posts: 37
- Joined: Wed Oct 11, 2006 3:44 am
Specify default font for report
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
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
-
- Posts: 43
- Joined: Fri May 25, 2007 2:54 am
- Location: Austria
Specify default font for report
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...
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
We need time for investigation of this problem. We will inform you about progress in this topic.
Thank you.
Thank you.
Specify default font for report
Try to use following method:
Thank you.
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);
}
}
}
-
- Posts: 43
- Joined: Fri May 25, 2007 2:54 am
- Location: Austria
Specify default font for report
This is a solution, indeed.
Thanks !
Thanks !
Specify default font for report
Where do you put this? Is it in the report or do you put it in your app?
Thanks,
Mat
Thanks,
Mat
Specify default font for report
You can put this method in report code or in application.
Thank you.
Thank you.
-
- Posts: 24
- Joined: Mon Jul 17, 2006 12:41 am
- Location: Holland
Specify default font for report
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.
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.