FastReport.OpenSource.Web Printable
printferlang opened this issue · 1 comments
printferlang commented
in FastReport.OpenSource.Web
, I want to display TextObject
or other when preview and hide it when printing.
So I wrote the following code in PrintService
:
// 定义事件处理程序方法
private void HtmlExport_CustomDraw(object sender, FastReport.Export.Html.CustomDrawEventArgs e)
{
// 自定义绘制逻辑
if (!e.reportObject.Printable)
{
e.css = string.Empty;
e.html = string.Empty;
e.done = true;
}
}
private byte[] PrintHtml(WebReport webReport)
{
webReport.PictureCache.Clear();
using (var htmlExport = new HTMLExport())
{
htmlExport.CustomDraw += HtmlExport_CustomDraw;
.....
}
}
Is there any other way to implement it?
BogdanStegachev commented
Hello!
To solve your problem, you can use the Printable property of your TextObject in the following way:
TextObject text1 = report1.FindObject(‘Text1’) as TextObject;
text1.Printable= false;
Best regards,
Bogdan