DialogPage events
RICOLEBO
FRANCE
I want to open a dialogPage before print a report to set a variable in the report and
use it to build the SqlCommandText in my program. (I have set DialogPage to visible false in the report to not have 2 times the dialogBox)
What I want to do is :
- frxReport1.LoadFromFile('myReport')
- Page := TfrxDialogPage(frxReport1.FindObject('DialogPage1'));
- Page.ShowModal; -> open the dialogPage (Ok)
- DialogPage1.btOKOnClick build my Sql.CommanText in a variable (in the report)
- Set my SQL.commandText with the variable of the report and then active the dataSet (in my program)
- frxReport1.print
My problem is : No event fire when dialogPage is called by showModal ! DialogPage1.btOKOnClick works only when the dialogPage is open with
the frxReport.Print or frxReport.PrepareReport (It's to late to change the query).
Note : Please tell me if I can use dialogPage to do this or if dialogPage exist only to add comments to the report.
Thank you
Eric
use it to build the SqlCommandText in my program. (I have set DialogPage to visible false in the report to not have 2 times the dialogBox)
What I want to do is :
- frxReport1.LoadFromFile('myReport')
- Page := TfrxDialogPage(frxReport1.FindObject('DialogPage1'));
- Page.ShowModal; -> open the dialogPage (Ok)
- DialogPage1.btOKOnClick build my Sql.CommanText in a variable (in the report)
- Set my SQL.commandText with the variable of the report and then active the dataSet (in my program)
- frxReport1.print
My problem is : No event fire when dialogPage is called by showModal ! DialogPage1.btOKOnClick works only when the dialogPage is open with
the frxReport.Print or frxReport.PrepareReport (It's to late to change the query).
Note : Please tell me if I can use dialogPage to do this or if dialogPage exist only to add comments to the report.
Thank you
Eric
Comments
frxReport1.LoadFromFile('myReport');
frxReport1.Script.Compile;//Compile script
Page := TfrxDialogPage(frxReport1.FindObject('DialogPage1'));
Page.ShowModal;
I try this, but it doesn't work (no effect)
And I just to see that the variables input in the dialogPage are not available
in the report !
I put a TfrxMemoView with [START_DATE.DATE] and the value of the parameter is not displayed.
frxReport1.LoadFromFile('myReport');
frxReport1.PrepareReport();//
Page := TfrxDialogPage(frxReport1.FindObject('DialogPage1'));
Page.ShowModal;
But NO ! PrepareReport doen't change something !
I don't know if it's a bug, but it seems that use DialogPage.ShowModal
show only the dialog page and do nothing else, because the variables of
the dialogPage are not set in the report and no event are fired ?
I can send you example.
Send me please your example
Page := TfrxDialogPage(frxReport1.FindObject('DialogPage1'));
Page.Visible := True;
frxReport1.PrepareScript;
try
frxReport1.Engine.Run; // Silent exception (no possible with prepareReport)
except end;
Page.Visible := False;
=> Then, Set my commandText with the script variable
frxReport1.PrepareReport;
frxReport1.Print;