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

Author Topic: Date type parameter passing.  (Read 5697 times)

Pierre udm

  • Newbie
  • *
  • Posts: 11
    • View Profile
Date type parameter passing.
« on: April 25, 2016, 11:43:54 am »
Hello everyone,
I have concerns for the passage of Date parameters in my QT program.
Indeed, during the design and test report in the designer LimeReport , everything goes well . Unfortunately, when called in a function in my program , the test values ​​of the designer are not updated.
Someone he already solved this problem ?

Code called function
Code: [Select]
void Repport::Print()
{
        report->dataManager()->clearUserVariables();
        report->dataManager()->setReportVariable("DateStart",ui->dateEdit->date());
        report->dataManager()->setReportVariable("DateEnd",ui->dateEdit_2->date());
        report->loadFromFile("Repport3.lrxml"); //to load report template file


    }
Query SQL associate
Code: [Select]
SELECT * from result where result.date_analysis BETWEEN $V{DateStart} and $V{DateEnd}

Admin

  • Administrator
  • Newbie
  • *****
  • Posts: 19
    • View Profile
Re: Date type parameter passing.
« Reply #1 on: April 25, 2016, 02:16:37 pm »
Try this
Code: [Select]
report->loadFromFile("Repport3.lrxml"); //to load report template file
report->dataManager()->setReportVariable("DateStart",ui->dateEdit->date());
report->dataManager()->setReportVariable("DateEnd",ui->dateEdit_2->date());

Pierre udm

  • Newbie
  • *
  • Posts: 11
    • View Profile
Re: Date type parameter passing.
« Reply #2 on: April 25, 2016, 04:20:56 pm »
Thank you very much. Problem solved