Recent

Author Topic: LazReport - Wrong SQLQuery Fieldset  (Read 439 times)

LeadGuit

  • New Member
  • *
  • Posts: 24
LazReport - Wrong SQLQuery Fieldset
« on: April 02, 2021, 11:53:53 am »
Hi,

I'm looking at Lazreport to create a simple Report from a Database.

In the Designer though (at design time), I see the wrong DB Fields.
My SqlQuery has the following SQL Text:
Code: SQL  [Select][+][-]
  1. SELECT changes.id AS id, DATE_FORMAT(changes.date_created, "%Y-%m-%d") AS DATE, items.name AS Item, changes.amount AS Amount, changes.cost AS PRice FROM changes LEFT JOIN items ON changes.item_id = items.id;
But the Report Designer shows me the fields of the "changes" table (id, item_id, amount, date_created, cost), not the result of the query, therefore I cannot assign Report Variables to e.g. Item name - as it's not shown.
frDBDataSet.Dataset is set to the SQLQuery, and the Datasource to the SQLQuery's Datasource.
The SQLQuery has the joined-statement set, and doesn't get overwritten anywhere in my code.

Any help or pointer appreciated :-)
Lazarus 2.0.12, FPC 3.2.0. Win 10

Computational Linguist by day, Film/TV Composer by night.

flori

  • Full Member
  • ***
  • Posts: 185
Re: LazReport - Wrong SQLQuery Fieldset
« Reply #1 on: April 02, 2021, 01:28:59 pm »
Hi.
Did you try fast report instead lazreport?

GetMem

  • Hero Member
  • *****
  • Posts: 4017
Re: LazReport - Wrong SQLQuery Fieldset
« Reply #2 on: April 02, 2021, 02:30:43 pm »
@LeadGuit

Preferably you should attach a small demo project that reproduce the issue.
I tested lazreport with a joined-statement SQLQuery and it works fine(see attachment).

PS: Maybe you linked the report to the wrong query?

LeadGuit

  • New Member
  • *
  • Posts: 24
Re: LazReport - Wrong SQLQuery Fieldset
« Reply #3 on: April 02, 2021, 02:55:31 pm »
Hi.
Did you try fast report instead lazreport?
No, as far as I've found, is that the commercial one from fast-report.com, or a different one? In the latter case, could you point to the right place? The commercial one isn't an option due to the cost factor (as pure hobby and "testing stuff out" kinda guy) 
Lazarus 2.0.12, FPC 3.2.0. Win 10

Computational Linguist by day, Film/TV Composer by night.

LeadGuit

  • New Member
  • *
  • Posts: 24
Re: LazReport - Wrong SQLQuery Fieldset
« Reply #4 on: April 02, 2021, 03:12:25 pm »
@LeadGuit

Preferably you should attach a small demo project that reproduce the issue.
I tested lazreport with a joined-statement SQLQuery and it works fine(see attachment).

PS: Maybe you linked the report to the wrong query?

I tried to reproduce it and couldn't get it to work xD (meaning - I couldn't reproduce the issue)
After Lazarus crashed, I reopened and now it seems to work. I guess something wasn't right when I wrote the queries and played with the activation of the query?
« Last Edit: April 02, 2021, 03:44:29 pm by LeadGuit »
Lazarus 2.0.12, FPC 3.2.0. Win 10

Computational Linguist by day, Film/TV Composer by night.

flori

  • Full Member
  • ***
  • Posts: 185
Re: LazReport - Wrong SQLQuery Fieldset
« Reply #5 on: April 02, 2021, 04:00:18 pm »
@ LeadGuit
Fast Report just available comercial version. If u want to use frx, you need to buy. But it also has many disadvantages...
The database connection is very easy on Fast Report.
https://www.fast-report.com/en/
good luck :)

 

TinyPortal © 2005-2018