Document parameters

Stimulsoft Reports.NET discussion
Post Reply
baldic
Posts: 2
Joined: Fri Jan 20, 2012 7:26 am
Location: Holland

Document parameters

Post by baldic »

Hello,

We are investigating the reporter and have a question:

is it possible to use document parameters which value can be used to hide/show report elements. So use the parameter during desgin process, but set its value from OUTSIDE the DESIGNER?
For example in case of a document to be printed to paper or used in mail.In case we create a PDF to be mailed some logo should appear, but in case we print to preprinted paper it should NOT appear.

In case it does already exist: Where can we find this?

Thx in before.

Baldic
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Document parameters

Post by HighAley »

Hello.
baldic wrote:We are investigating the reporter and have a question:

is it possible to use document parameters which value can be used to hide/show report elements. So use the parameter during desgin process, but set its value from OUTSIDE the DESIGNER?
For example in case of a document to be printed to paper or used in mail.In case we create a PDF to be mailed some logo should appear, but in case we print to preprinted paper it should NOT appear.

In case it does already exist: Where can we find this?
You could set the Printable property to False of components which you don't want to print.

Thank you.
baldic
Posts: 2
Joined: Fri Jan 20, 2012 7:26 am
Location: Holland

Document parameters

Post by baldic »

Hello Aleksey,

Ok, is clear. But now the question is: Can we set this parameter from out side the designer during rendering process. Because if I understand your answer well, this means during design time it can be set to OR true OR false. As my example explains, it should be possible from outside the designer. At moment of design I do not know how a document based on the design is treated. In other words, I do not know if it is mailed or printed or both. And in case printed that logo might needed to NOT be shown, but in case I mail, it should.

Regards, Baldic
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Document parameters

Post by HighAley »

Hello, Baldic.
baldic wrote:Ok, is clear. But now the question is: Can we set this parameter from out side the designer during rendering process. Because if I understand your answer well, this means during design time it can be set to OR true OR false. As my example explains, it should be possible from outside the designer. At moment of design I do not know how a document based on the design is treated. In other words, I do not know if it is mailed or printed or both. And in case printed that logo might needed to NOT be shown, but in case I mail, it should.
But do you know what elements should be printed and what shouldn't.
If you once set the Printable property of the logo to False then each time you print the element, it will be disable and when you will mailing it, it will be mailed.

Also you could use next code to Disable report components before rendering it:

Code: Select all

(rep.GetComponentByName("Logo") as StiComponent).Enabled = false;
or 
(rep.GetComponentByName("Logo") as StiComponent).Printable = false;
Thank you.
Post Reply