English 中文(简体)
动态从文件系统加载图片进入Crystal Report(VS 2008版本)
原标题:
  • 时间:2008-11-06 09:47:07
  •  标签:

I have a VB.NET application which needs to generate reports (invoices) which contains optional images. The images are going to be loaded into 1 of 6 places on the report, but will reside on the client PC (deployed with the application). I ve been trying to access the ICROleObject object, which is what s placed onto the report, but I can t locate this interface in the object browser, even. As this is the object s interface, I figured that it would let me access it if only I could cast it:    

 CType(r.ReportDefinition.ReportObjects("picTL"), ICROleObject)
Any ideas where I would find this, or if I m even approaching this correctly?
I ve tried following the directions at http://www.idautomation.com/crystal/streaming_crystal.html, and that won t work with the version of Crystal which is embedded in .NET 2008. Neither will the solution found at http://www.a1vbcode.com/a1vbcode/vbforums/Topic25620-3-1.aspx#bm25974, although that one looks a bit more promising, and is the one I m trying to model after.
If I have to use a dataset & a series of subreports, I suppose could ... but that method just doesn t seem as straightforward as this one.
最佳回答

你应该将其转换为PictureObject。类型“PictureObject”可以在CrystalDecisions.CrystalReports.Engine命名空间中找到。

例如

Dim pic = CType(rapportCourant.ReportDefinition.ReportObjects("Picture1"), PictureObject) pic.ObjectFormat.EnableSuppress = True

你可以根据需要抑制或启用图片对象。

问题回答

My approach has been setting a Crystal Reports Parameter to define which image should be visibile and then customize the Suppress formula using this parameter. I had a crystal reports exception in exporting report which was caused by manipulating report objects from outside the report, even if print preview was working fine.





相关问题
热门标签