From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
06-22-2017 09:21 AM
Hi all,
New to the forum and looking for help.
The company I work for is changing it logo/font. This means we have to go through our calibration sheets and change the font. So far so good. Problem is, we have aprox. 300 calibration sheets in Diadem. Each has several textboxes/graphs/tables and doing it by hand is quite the challenge. They do not share the same layout, so some kind of script to change them will not work.
Does anybody have a good idea how to change the font for the entire report? Talked to NI support and they did not have a fix-all solution.
Any help or suggestion is appreciated.
Best Regards,
Morten
06-22-2017 10:00 AM - edited 06-22-2017 10:03 AM
Hi Morten,
Have you tried this?
Report.Settings.DefaultFontType = eDefaultFontTypeOwn Report.Settings.DefaultFontName = "Times New Roman"
call Report.Refresh()
This only works if all of your fonts are set to default.
But then you can change everything at once with these commands.
06-22-2017 10:10 AM
As TDR Report files are XML files you could also try to parse and replace every occurrence in the file
For example replace all "Arial" with "Times New Roman".
I tested this for a very simple TDR file and it worked.
But I'm not sure if there are any disadvantages when doing it like this.
For sure I cannot officially recommend this but as a workaround it could be ok.
06-23-2017 02:07 AM
If you have special computer dedicated only for doing graphs in DIAdem, the other workaround would be, to replace the fonts with new ones and keep the same names as the old ones. So, you don't have to change anything. Maybe it's stupid containment, but if you are not using those fonts for anything else, could be the fastest fix.
06-23-2017 02:39 AM
Hi,
Thanks for the suggestion. I was looking at that solution, but there is some problems.
In the report I'm testing uses "Verdana" as the font. When I search through the TDR there is no mention of Verdana. However, I can find "Times New Roman" and "Arial". If I change these to the new font "Rubik" nothing happens in the report, it's still "Verdana".
Now comes the added problem: If I change the fonts manually in Diadem from "Verdana" to "Rubik", the TDR file now has "Rubik" in the spots where there use to be "Times New Roman" or "Arial".
It seems to me that the report is settings the fonts in some other way until I change it manually.
Suggestions?
06-23-2017 02:46 AM
I was trying the same with a twist. I tried to uninstall all other fonts exept the one I need. Open the reports and see if they defaulted to the only font available and then save them.
Problem is that there are a lot of system fonts that cannot be removed and DIAdem will probably default to times new roman or some other system font.
I like the idea, but we have a lot of computers running Diadem and changing the underlying font will give rise to uncertanties, especially if the computers are upgraded and someone forgets to do the font-hack.
06-23-2017 09:26 AM - edited 06-23-2017 09:28 AM
Hi Morton,
I would prefer to have script, changing the fonts of each object on each REPORT page. I created an example starting with a few objects. I hope this will help.
dim iLoopS, iLoopO, i dim oCurrSheet, oCurrObject for iLoopS = 1 to Report.Sheets.Count set oCurrSheet = Report.Sheets(iLoopS) for iLoopO = 1 to oCurrSheet.Objects.Count set oCurrObject = oCurrSheet.Objects(iLoopO) select case oCurrObject.ObjectType case eReportObject2DAxisSystem oCurrObject.XAxis.Label.Font.Name = "Arial" oCurrObject.YAxis.Label.Font.Name = "Arial" for i = 1 to oCurrObject.YAxisList.Count oCurrObject.YAxisList(i).Label.Font.Name = "Arial" next case eReportObject2DTable for i = 1 to oCurrObject.Columns.Count oCurrObject.Columns(i).Settings.Font.Name = "Arial" next case eReportObjectPolarSystem case eReportObject3DAxisSystem case eReportObject3DTable case eReportObjectText oCurrObject.Font.Name = "Arial" case eReportObjectFrame case eReportObjectImage case eReportObjectRTFText case eReportObjectArrow case eReportObjectComment case eReportObjectCircle case eReportObjectFormulaDisplay end select next next
Greetings
Walter