SQL Reporting Addon: Help Requests

Post here for help on using FreeCAD's graphical user interface (GUI).
Forum rules
and Helpful information
IMPORTANT: Please click here and read this first, before asking for help

Also, be nice to others! Read the FreeCAD code of conduct!
User avatar
dcapeletti
Posts: 403
Joined: Wed Jul 23, 2014 2:27 pm

Re: SQL Reporting Workbench for FreeCAD

Postby dcapeletti » Thu Jul 11, 2019 10:35 am

Hello, excellent workbench.
First I write the doubts. I haven't found the operators like, between, maybe they aren't developed yet.

https://www.w3schools.com/sql/sql_like.asp
https://www.w3schools.com/sql/sql_between.asp

On the other hand, it would be interesting to be able to connect the resulting reports to tables of a database, so that when you have a report ready, you can send the results to a mariadb or postgresql database with an export wizard. Also, if something changes in the database, freecad could read that new value and recreate the model.

Thank you very much and again congratulations for this great work.
User avatar
furti
Posts: 331
Joined: Mon Nov 27, 2017 5:27 pm

SQL Reporting Addon: Help Requests

Postby furti » Tue Jul 30, 2019 6:30 am

If you have questions or problems with the SQL Reporting Addon please do not post to the Announcements Topic anymore but instead reply to this topic.

Informations about new features are still posted to the announcement topic: https://forum.freecadweb.org/viewtopic.php?f=9&t=33403
Yann
Posts: 10
Joined: Tue May 07, 2019 1:51 pm

Re: SQL Reporting Addon: Help Requests

Postby Yann » Wed Aug 14, 2019 3:27 pm

Hi!

I've been recently testing the Reporting addon which is a great complement to the schedule tool. I am not familiar with SQL but thanks to the documentation I've been able to get it work.
I'm stuck when it comes to get properties from the different parts of a window. For instance, in a spreadsheet, I can get the volume of the window frame, or glass panel, with this :

Code: Select all

Window.Shape.Solids[0].Volume
So I tried to do the same in the reporting tool:

Code: Select all

Select Label, Shape.Solids[0].Volume
From document
Where IfcRole='Window'
 
But I get this error:

Code: Select all

sql.sql_grammar.ParseError: Line 1: expected [a-zA-Z0-9\.], [ \t\r\n], [ \t\r\n], ","
Select Label,Shape.Solids[0].Volume
                         ^
Obviously the parser doesn't like the bracket in the expression and if I understand well, it needs to be escaped. I tried various things about that but nothing worked.
Is it a current limitation of the addon or am I just doing it wrong?
Is there a workaround?

Thanks for your help!
Yann
User avatar
furti
Posts: 331
Joined: Mon Nov 27, 2017 5:27 pm

Re: SQL Reporting Addon: Help Requests

Postby furti » Wed Aug 14, 2019 5:12 pm

Yann wrote:
Wed Aug 14, 2019 3:27 pm
Obviously the parser doesn't like the bracket in the expression
You are right. This is not implemented right now. i'm not at my computer right now. I will check if there is a workaround for this later on.
langk
Posts: 10
Joined: Sat Nov 09, 2019 11:39 am

Re: SQL Reporting Workbench for FreeCAD

Postby langk » Thu Nov 14, 2019 3:40 pm

Hey,

while using this really nice Addon I came across two things:
  • I would like to output the volume of a wall, but this is currently not available as a fixed attribute under data. So I wanted to calculate it from the dimensions of the wall, but that did not work. In general, do the computational options not work for such a task or it is due to an incorrect SQL command on my part?:

    Select Length*Width*Height As 'Volume'
    From document
    Where IfcRole = 'Wall';
  • I also would like to output the material of an element or the host of an element or the parts attached to a room, but the result is always the same:
    reporting_fail_host.PNG
    reporting_fail_host.PNG (3.88 KiB) Viewed 227 times
    (example for the host)

    Do you think this is a thing you could think about implementing a solution?
User avatar
furti
Posts: 331
Joined: Mon Nov 27, 2017 5:27 pm

Re: SQL Reporting Workbench for FreeCAD

Postby furti » Fri Nov 15, 2019 2:09 pm

langk wrote:
Thu Nov 14, 2019 3:40 pm
I would like to output the volume of a wall
Unfortunately this is not available right now as a separate property. I was thinking about adding it to the Arch Wall.

It seems to be not possible to use more than two operands in a arithmetic expression. I created an issue for this https://github.com/furti/FreeCAD-Reporting/issues/25
But you can access the Shape directly and do something like "Select Shape.Volume...". This value is in mm³ so you might transform it to something more suitable. E.g. use "Select Shape.Volume / 1000000000" to get it in m³
langk wrote:
Thu Nov 14, 2019 3:40 pm
I also would like to output the material of an element
If you do "Select Host..." you will get the full object, a PartFeature in your case. You might use "Select Host.Label..." or "Select Host.Name..." to get the Label displayed in the TreeView for the given object.

Maybe someone can move this posts to the help request thread? https://forum.freecadweb.org/viewtopic.php?f=3&t=38225
User avatar
Kunda1
Posts: 6221
Joined: Thu Jan 05, 2017 9:03 pm

Re: SQL Reporting Workbench for FreeCAD

Postby Kunda1 » Sat Nov 16, 2019 10:38 am

furti wrote:
Fri Nov 15, 2019 2:09 pm
Maybe someone can move this posts to the help request thread? https://forum.freecadweb.org/viewtopic.php?f=3&t=38225
Done
Want to contribute back to FC? Checkout:
#lowhangingfruit | Use the Source, Luke. | How to Help FreeCAD | How to report FC bugs and features