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

Author Topic: Dialog and Function browser?  (Read 7570 times)

Mucip

  • Jr. Member
  • **
  • Posts: 51
    • View Profile
Dialog and Function browser?
« on: March 03, 2020, 10:24:03 am »
Hi,
There is Script Browser pane on the left side. But nothing happens when I press the buttons.
Is there any tutorial about how to add/edit/delete Functions and Dialogs?

Regards,
Mucip:)

Arin Alex

  • Developer
  • Administrator
  • Hero Member
  • *****
  • Posts: 1005
    • View Profile
Re: Dialog and Function browser?
« Reply #1 on: March 04, 2020, 09:59:29 am »
Hi!
Honestly, add/edit/delete Functions has no functionality :)
I had some ideas on how this might work, but I realized that these are not really needed functions.
What about dialogs there are two ways how you can add it to the report:
First, you can create a dialog using the embedded dialog designer.
Second, you can create it using qtcreator or qt dialog designer
and add it using button add at the dialog's tab.

What about how to create custom functions. 
You can create it using JavaScript in the init script or
create some object inherited from QObject with Q_INVOKABE methods
and register it in the script engine. 

Mucip

  • Jr. Member
  • **
  • Posts: 51
    • View Profile
Re: Dialog and Function browser?
« Reply #2 on: March 04, 2020, 11:15:08 am »
Hi,
Wouv... Very deep and difficult situation for me... :)

OK. Let me forget about dialogs.

By the way where is the embedded dialog designer?

Regards,
Mucip:)
« Last Edit: March 04, 2020, 11:17:09 am by Mucip »

Arin Alex

  • Developer
  • Administrator
  • Hero Member
  • *****
  • Posts: 1005
    • View Profile
Re: Dialog and Function browser?
« Reply #3 on: March 17, 2020, 11:36:51 pm »
Quote
By the way where is the embedded dialog designer?

Mucip

  • Jr. Member
  • **
  • Posts: 51
    • View Profile
Re: Dialog and Function browser?
« Reply #4 on: March 22, 2020, 09:02:25 am »
Hi,
It looks well. Thanks. ;)

So how can we connect dialogs window to report functionality? Any document or demo?

Regards,
Mucip:)

Arin Alex

  • Developer
  • Administrator
  • Hero Member
  • *****
  • Posts: 1005
    • View Profile
Re: Dialog and Function browser?
« Reply #5 on: March 25, 2020, 01:46:33 am »
Hi Mucip!
I have created a small video about dialogs.
https://www.youtube.com/watch?v=ZG5j9R3RR34

Mucip

  • Jr. Member
  • **
  • Posts: 51
    • View Profile
Re: Dialog and Function browser?
« Reply #6 on: March 26, 2020, 04:30:25 pm »
Hi,
You're great Arin. Thanks.  ;)

This is very usefull. Sometims it's needed to hide something on the report depends on user demand. This dialog is good for this. Dialog confirms "Do you want to see prices?".

If user choose OK then we can see the prices on the report. Otherwise we hide the prices on the report.

Regards,
Mucip:)

solomon78

  • Newbie
  • *
  • Posts: 24
    • View Profile
Re: Dialog and Function browser?
« Reply #7 on: March 26, 2020, 05:03:04 pm »
Arin Alex, Thank you for uploading video about dialogs, please can you do video on how to add Limereport on Qt and query sqlite database? I will appreciate your effort

Arin Alex

  • Developer
  • Administrator
  • Hero Member
  • *****
  • Posts: 1005
    • View Profile
Re: Dialog and Function browser?
« Reply #8 on: March 27, 2020, 10:43:51 am »
solomon78, Hi!
Quote
please can you do video on how to add Limereport on Qt
Sorry, I didn't clearly understand what do you mean.
If you ask how to add limereport to your project you can watch this video https://www.youtube.com/watch?v=Z7JOOQ187XE

solomon78

  • Newbie
  • *
  • Posts: 24
    • View Profile
Re: Dialog and Function browser?
« Reply #9 on: March 29, 2020, 09:41:35 pm »
I mean how to query database from Qt GUI for example(Select * from categories). Thank you

Mucip

  • Jr. Member
  • **
  • Posts: 51
    • View Profile
Re: Dialog and Function browser?
« Reply #10 on: March 30, 2020, 12:15:39 am »
Hi,
Let me explain mey way:
I will add these lines to header file

//For Lime Report
QSqlQueryModel *raporModel;
LimeReport::ReportEngine *mRapor;
//

And in the source code:

// to use LimeReport and fill the data into Model.
mRapor = new LimeReport::ReportEngine(this);
raporModel = new QSqlQueryModel(this);

raporModel->setQuery("SELECT * FROM tartim WHERE belge_no = '" + belge_no + "' ;");

//To load the LimeReport file.

if(!mRapor->loadFromFile(fileName))
    {
        QMessageBox::critical(this, "Hata!", fileName + " Dosyasına ulaşılamadı!");
        return;
    }

//And push the Model to Limereport. Because you fill the data to Model before.

mRapor->dataManager()->addModel("tartim", raporModel, false); //Use third parameter false if you don't want to delete Model after finishing job.:)

    mRapor->setResultEditable(false);

    mRapor->previewReport();

    //mRapor->designReport();

    //mRapor->printReport();



That's all. It's very easy. But the important thing create the LimeReport instance and the model just in time. Create them and use them. Otherwise the speed is going down.

Regards,
Mucip:)




solomon78

  • Newbie
  • *
  • Posts: 24
    • View Profile
Re: Dialog and Function browser?
« Reply #11 on: March 31, 2020, 10:42:22 am »
Mucip, Thank you, I will it a trial.

solomon78

  • Newbie
  • *
  • Posts: 24
    • View Profile
Re: Dialog and Function browser?
« Reply #12 on: April 22, 2020, 09:56:20 pm »
Thank you Mucip for the help it work but I was having problem on how to query like "raporModel->setQuery("SELECT * FROM tartim WHERE belge_no = '" + belge_no + "' ;");" I want to select base on certain condition, it didn't work as I expected.

Mucip

  • Jr. Member
  • **
  • Posts: 51
    • View Profile
Re: Dialog and Function browser?
« Reply #13 on: April 23, 2020, 09:43:44 pm »
Hi,
Could you explain little bit more?
What is the problem? You can create SELECT statement and send it to LimeReport as I decribed.

Regards,
Mucip:)

solomon78

  • Newbie
  • *
  • Posts: 24
    • View Profile
Re: Dialog and Function browser?
« Reply #14 on: April 24, 2020, 02:51:02 am »
Mucip, It didn't worked. It uploaded  entire information on the database without filtering or condition. please can you share me your details codes on where you made the selection? thanks