LimeReport Forum

General Category | Основное => Discussion | Обсуждение => Topic started by: Pierre udm on April 25, 2016, 11:43:54 AM

Title: Date type parameter passing.
Post by: Pierre udm 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}
Title: Re: Date type parameter passing.
Post by: Admin 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());
Title: Re: Date type parameter passing.
Post by: Pierre udm on April 25, 2016, 04:20:56 PM
Thank you very much. Problem solved