MODIFIED: NOT A Bug? inserting Spreadsheet in a Page

Discussions about the development of the TechDraw workbench
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
dino
Posts: 113
Joined: Mon Sep 22, 2014 11:28 pm

MODIFIED: NOT A Bug? inserting Spreadsheet in a Page

Post by dino »

Hello!
I'm using TechDraw to show and save in pdf a draw and a Spreadsheet into one page, but with newer versions of FC the text size and cell size do not coincide and some text go out of the page, with the olds versions it work good :(

On freecad 0.19.17651 works good
OS: Windows 10 (10.0)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.17651 (Git)
Build type: Release
Branch: master
Hash: 16c26cb3b1cd7209ea8efc8cb30b3b18fd80cf95
Python version: 3.6.8
Qt version: 5.12.1
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: Italian/Italy (it_IT)
With Version: 0.19.17651
With Version: 0.19.17651
FC_17651.PNG (25.33 KiB) Viewed 978 times
On freecad 0.19.18284 it does not
OS: Windows 10 (10.0)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.18284 (Git)
Build type: Release
Branch: master
Hash: cd8f0e0960d048032b6967edb9e8952541a5eb6c
Python version: 3.6.8
Qt version: 5.12.1
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: Italian/Italy (it_IT)
With Version: 0.19.18284
With Version: 0.19.18284
FC_18284.PNG (23.27 KiB) Viewed 978 times
Attachments
ProvaSpreadsheet.FCMacro
Macro
(2.71 KiB) Downloaded 38 times
Last edited by dino on Thu Sep 26, 2019 4:31 pm, edited 1 time in total.
User avatar
wandererfan
Veteran
Posts: 6324
Joined: Tue Nov 06, 2012 5:42 pm
Contact:

Re: Bug? inserting Spreadsheet in a Page

Post by wandererfan »

dino wrote: Tue Sep 24, 2019 1:46 pm I'm using TechDraw to show and save in pdf a draw and a Spreadsheet into one page, but with newer versions of FC the text size and cell size do not coincide and some text go out of the page, with the olds versions it work good :(
Not sure where row height is determined. Will have to do some digging.
User avatar
wandererfan
Veteran
Posts: 6324
Joined: Tue Nov 06, 2012 5:42 pm
Contact:

Re: Bug? inserting Spreadsheet in a Page

Post by wandererfan »

dino wrote: Tue Sep 24, 2019 1:46 pm I'm using TechDraw to show and save in pdf a draw and a Spreadsheet into one page, but with newer versions of FC the text size and cell size do not coincide and some text go out of the page, with the olds versions it work good :(
TD gets the row height from the spreadsheet (30 in this case).

37 rows * 30 pixels/row = 1110 pixels. At 92 pixels per inch, that's > 12 inches or ~305 mm which is taller than A4 page. Which is what we get with freecad-daily.

I can't figure out why it worked in earlier builds. From the pictures, the row height is noticeably smaller in the earlier version.

I haven't found where the row height is set in Spreadsheet yet. Maybe the default height of a row changed?
dino
Posts: 113
Joined: Mon Sep 22, 2014 11:28 pm

Re: Bug? inserting Spreadsheet in a Page

Post by dino »

I think we have to search the problem in cell and text heights becouse with FC 0.18 the sheet is ok (same as 0.19 old) but the text is bigger then 0.19 as "old" and "new" version.
In FC 0.19 the "old" and "new" versions cell hegth is different but the text heigth is the same.
For me the best way is to set the heitght of the cell in mm (or inch) and the text in pt (1pt = 0,352778mm), so we can export it in pdf file easealy
FreeCAD-0.18.16131.3129ae4-WIN-x64-portable.PNG
FreeCAD-0.18.16131.3129ae4-WIN-x64-portable.PNG (38.11 KiB) Viewed 874 times
dino
Posts: 113
Joined: Mon Sep 22, 2014 11:28 pm

Re: Bug? inserting Spreadsheet in a Page

Post by dino »

:D
The row heigth in TechDraw is setted by Spreadsheet row heigth, the same as column width!

Code: Select all

sp = App.ActiveDocument.Spreadsheet
sp.setColumnWidth("B", 30)
sp.setRowHeight("10", 15)
App.activeDocument().recompute()
dino
Posts: 113
Joined: Mon Sep 22, 2014 11:28 pm

Re: Bug? inserting Spreadsheet in a Page

Post by dino »

NOT a BUG!
the difference is that olds versions sets by default Row Height to 20 the newer to 30 px :D

:lol: :lol: :lol:
User avatar
wandererfan
Veteran
Posts: 6324
Joined: Tue Nov 06, 2012 5:42 pm
Contact:

Re: Bug? inserting Spreadsheet in a Page

Post by wandererfan »

dino wrote: Thu Sep 26, 2019 4:30 pm NOT a BUG!
the difference is that olds versions sets by default Row Height to 20 the newer to 30 px :D
:? but why?

Oh well as long as it works now.
Post Reply