Page 1 of 1
Hide or show fields between preview and print
Posted: Wed Aug 17, 2016 1:26 am
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.
Re: Hide or show fields between preview and print
Posted: Thu Aug 18, 2016 6:54 am
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.
Re: Hide or show fields between preview and print
Posted: Mon Jan 07, 2019 5:17 pm
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
Re: Hide or show fields between preview and print
Posted: Mon Jan 07, 2019 11:03 pm
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.
Re: Hide or show fields between preview and print
Posted: Tue Jan 08, 2019 1:29 pm
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
Re: Hide or show fields between preview and print
Posted: Tue Jan 08, 2019 3:45 pm
by Lech Kulikowski
Hello,
Yes, In the JS version, events are not supported also.
Thank you.
Re: Hide or show fields between preview and print
Posted: Tue Jan 08, 2019 4:00 pm
by cbrydon
OK - Thanks for letting me know!
Re: Hide or show fields between preview and print
Posted: Wed Jan 09, 2019 11:08 pm
by Lech Kulikowski
Hello
Please let us know if you need any additional help.
Thank you.