Welcome, Guest. Please login or register.
Did you miss your activation email?

Author Topic: How to define SQL statement of report while runtime?  (Read 1927 times)

Mucip

  • Jr. Member
  • **
  • Posts: 51
    • View Profile
How to define SQL statement of report while runtime?
« on: February 22, 2020, 08:01:48 PM »
Hi,
First of all congrulations for this project. Good job.  ;)

As I see on the tutorial videos you may define database and table and the columns. But I want to designe report in the begining and send the data to the report on runtime. I want to define SQL staement on runtime.

I'm sure it should be possible and I couldn't find any tutorial about this. I am using QtRPT now and want to try your project too.

Regards,
Mucip:)

Arin Alex

  • Developer
  • Administrator
  • Hero Member
  • *****
  • Posts: 992
    • View Profile
Re: How to define SQL statement of report while runtime?
« Reply #1 on: February 22, 2020, 09:43:09 PM »
Hi.
Limereport manual: https://sourceforge.net/projects/limereport/files/UserManualEn.pdf/download

Look there are some ways how limereport can get data:
1) You can define all data sources in the report template and manage them by the report variables.
3) You can send data via QAbstractItemModel, Section - External Data Sources in the manual.   
2) You can use callbackdatasource it is very similar to QtRpt approach.
https://www.youtube.com/watch?v=IekDWzh251c

You also can watch demo_r1 where all these approaches are demonstrated.
Still, have questions? Write, I will be glad to help

Mucip

  • Jr. Member
  • **
  • Posts: 51
    • View Profile
Re: How to define SQL statement of report while runtime?
« Reply #2 on: February 23, 2020, 04:05:28 PM »
Dear Mr. Arin,
Thanks a lot for your quick reply.

I will check and keep asking. :)

By the way I wanted to support you about Turkish translating and etc.

Spasibo.

Regards,
Mucip:)

Arin Alex

  • Developer
  • Administrator
  • Hero Member
  • *****
  • Posts: 992
    • View Profile
Re: How to define SQL statement of report while runtime?
« Reply #3 on: February 23, 2020, 11:07:33 PM »
Hi!
Quote
By the way I wanted to support you about Turkish translating and etc.
You can create the Turkish translation using Qt Linguist and send it on my e-mail: arin_a@bk.ru

Mucip

  • Jr. Member
  • **
  • Posts: 51
    • View Profile
Re: How to define SQL statement of report while runtime?
« Reply #4 on: February 23, 2020, 11:35:50 PM »
Hi,
OK. I will...

I'm trying your project now according to tutorial you sent.

I thing we need to add "qml" to pro file too?

QT       += core gui printsupport xml qml

Regards,
Mucip:)

Mucip

  • Jr. Member
  • **
  • Posts: 51
    • View Profile
Re: How to define SQL statement of report while runtime?
« Reply #5 on: February 24, 2020, 12:04:50 AM »
Hi again,
I am working on Win platform unfortunatelly and MSVC2017 x32 and MSVC2017 x64 config. But I have MSVC 2019 installed.

I want to compile program both x32 and x64 architecture and try to use below code in pro file but no succes?!


CONFIG(x86_64) {

#64 bit path
win64:CONFIG(release, debug|release): LIBS += -L$$PWD/../LimeReport/win64/release/lib/ -llimereport
else:win64:CONFIG(debug, debug|release): LIBS += -L$$PWD/../LimeReport/win64/debug/lib/ -llimereportd

INCLUDEPATH += $$PWD/../LimeReport/include64
DEPENDPATH += $$PWD/../LimeReport/include64

} else {

#32 bit path
win32:CONFIG(release, debug|release): LIBS += -L$$PWD/../LimeReport/win32/release/lib/ -llimereport
else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/../LimeReport/win32/debug/lib/ -llimereportd
INCLUDEPATH += $$PWD/../LimeReport/include32
DEPENDPATH += $$PWD/../LimeReport/include32
}

Where am I wrong?

Regards,
Mucip:)

Mucip

  • Jr. Member
  • **
  • Posts: 51
    • View Profile
Re: How to define SQL statement of report while runtime?
« Reply #6 on: February 24, 2020, 12:32:33 AM »
Hi,
Now it's OK. Thanks...

contains(QT_ARCH, i386) {

#32 bit path
# message("32-bit")

win32:CONFIG(release, debug|release): LIBS += -L$$PWD/../LimeReport/win32/release/lib/ -llimereport
else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/../LimeReport/win32/debug/lib/ -llimereportd
# else:unix: LIBS += -L$$PWD/../LimeReport/win32/debug/lib/ -llimereport

} else {
#64 bit path
#message("64-bit")

win32:CONFIG(release, debug|release): LIBS += -L$$PWD/../LimeReport/win64/release/lib/ -llimereport
else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/../LimeReport/win64/debug/lib/ -llimereportd
# else:unix: LIBS += -L$$PWD/../LimeReport/win32/debug/lib/ -llimereport

}



Regards,
Mucip:)