Select Report page to print from Dialog Form
tampasounds
US
I have made a report with 3 pages
Page1 (named order) of report is dynamic and grows depending on how much data
Page2 (named ccauth) of report is static text (like terms and conditions)
Page3 (named terms) of report is similar with more static text
I am trying to use dialog form with checkbox controls to determine which report page(s) are displayed when running report
I have looked in user manual and see how this works with controlling bands very nicely but when
I tried to do a small peice of code within onclick event to control the firing of the report pages I didnt have much luck
My Code:
procedure Button1Click(Sender: TfrxComponent); // This is OK button on Dialog Form
begin
if checkbox1.checked := True //Checkbox for page1 of report
then
Order.Visible := True
else
Order.Visible := False
if checkbox2.checked := True //Checkbox for page2 of report
then
ccauth.Visible := True
else
ccauth.Visible := False
if checkbox3.checked := True
then
terms.visible := True
else
terms.Visible := False
end;
Is this even possible ? Many thanks for your input and some direction on this.
Page1 (named order) of report is dynamic and grows depending on how much data
Page2 (named ccauth) of report is static text (like terms and conditions)
Page3 (named terms) of report is similar with more static text
I am trying to use dialog form with checkbox controls to determine which report page(s) are displayed when running report
I have looked in user manual and see how this works with controlling bands very nicely but when
I tried to do a small peice of code within onclick event to control the firing of the report pages I didnt have much luck
My Code:
procedure Button1Click(Sender: TfrxComponent); // This is OK button on Dialog Form
begin
if checkbox1.checked := True //Checkbox for page1 of report
then
Order.Visible := True
else
Order.Visible := False
if checkbox2.checked := True //Checkbox for page2 of report
then
ccauth.Visible := True
else
ccauth.Visible := False
if checkbox3.checked := True
then
terms.visible := True
else
terms.Visible := False
end;
Is this even possible ? Many thanks for your input and some direction on this.
Comments
Check for the checkboxes at a later point, when the pages are going to be printed. My guess is that the control (pages) properties are being reset after the dialog executes.
if that doesn't work try it in one of the Report events, like frxReport1.OnStartReport or frxReport1.OnReportPrint or frxReport1.OnRunDialogs