Hide or show fields between preview and print

Stimulsoft Ultimate discussion
Post Reply
User avatar
midspace
Posts: 25
Joined: Tue Sep 10, 2013 12:20 am
Location: Melbourne, Australia

Hide or show fields between preview and print

Post by midspace »

Is it possible to have a field visible in preview, but hidden during print and export?
And is it also possible to hide a field in preview, but visible during print and export?

I do not have an explicit sample.
HighAley
Posts: 8431
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Hide or show fields between preview and print

Post by HighAley »

Hello.

You could set the Printable property of the component to False. Then it will be visible in the Viewer and will not be printed.
If you need to do other changes, you could handle the Printing and Exporting events and render the report again with or without some components.

Thank you.
cbrydon
Posts: 173
Joined: Fri May 30, 2014 4:37 pm

Re: Hide or show fields between preview and print

Post by cbrydon »

Hello,

I've tried hiding a control between Preview and Print using the Report events, but haven't had any luck.
Attached is a very basic report. For the purposes of testing there is no data associated with the report.

What I'd like to be able to do is hide TitleBand1 when printing, but still be able to see it when Previewing.
I was able to set the Printable property of the Text1 component to false and it does not show when
printing, which is great. However the space taken up by the TitleBand still exists when printing the report.

I tried using the expression below in the report's Printed, Printing, Exported and Exporting events, but
couldn't get it to work - the space taken up by TitleBand1 was always present.

ReportTitleBand1.Enabled = false;

I also tried
ReportTitleBand1.Printable = false; in the same 4 events, but that didn't work either.

I'm using Stimulsoft 2018.1.8 from Febraury 19, 2018. ASP.NET, Flex.

Hope you can provide some direction.

Thanks,
Carl
Attachments
TestDisclaimer.mrt
(11.2 KiB) Downloaded 187 times
Lech Kulikowski
Posts: 6266
Joined: Tue Mar 20, 2018 5:34 am

Re: Hide or show fields between preview and print

Post by Lech Kulikowski »

Hello,

You should render report again before printing to hide rendered elements:
ReportTitleBand1.Enabled = false;
this.Render(false);

Also, in the flex version events are not supported.

Thank you.
cbrydon
Posts: 173
Joined: Fri May 30, 2014 4:37 pm

Re: Hide or show fields between preview and print

Post by cbrydon »

Thanks Lech,

Which Event Handler should I put that code in? I tried placing it in both the Exported and Exporting
events for the report, but it didn't make any difference.

I should have clarified that the Designer I'm using is Stimulsoft 2018.1.8 from Febraury 19, 2018. ASP.NET, Flex., but the
view I'm using is Stimulsoft 2018.1.8 from Febraury 19, 2018. ASP.NET, JS.

Maybe these events aren't supported in the JS version either?

Carl
Lech Kulikowski
Posts: 6266
Joined: Tue Mar 20, 2018 5:34 am

Re: Hide or show fields between preview and print

Post by Lech Kulikowski »

Hello,

Yes, In the JS version, events are not supported also.

Thank you.
cbrydon
Posts: 173
Joined: Fri May 30, 2014 4:37 pm

Re: Hide or show fields between preview and print

Post by cbrydon »

OK - Thanks for letting me know!
Lech Kulikowski
Posts: 6266
Joined: Tue Mar 20, 2018 5:34 am

Re: Hide or show fields between preview and print

Post by Lech Kulikowski »

Hello

Please let us know if you need any additional help.

Thank you.
Post Reply