travel_he 发表于 2016-6-21 10:54:41

FlashViewer导出问题

本帖最后由 Lenka.Guo 于 2016-6-21 12:03 编辑

导出时要新加载一个 报表实例,这样就有一个问题,如果此报表很复杂,有许多参数,数据源等,显示时也要一个实例,这样两次加载实例不是影响效率吗?
尝试在加载报表时将报表实例保存在SESSION里
Dim pr As GrapeCity.ActiveReports.PageReport = context.Session("AR_PageReport")
,但导出时引用报末引用实例
word.Export(pr.Document, memStream)

Lenka.Guo 发表于 2016-6-21 12:02:44

在Session 传对象的时候,数据丢失。您可以参考帖子中处理过此类问题:http://gcdn.gcpowertools.com.cn/forum.php?mod=redirect&goto=findpost&ptid=20611&pid=104690&fromuid=29382

travel_he 发表于 2016-6-22 09:51:29

Dim pr As New GrapeCity.ActiveReports.PageReport(New System.IO.FileInfo(Context.Server.MapPath("PageReport1.rdlx")))
            Session("AR_PageReport") = pr.Document.Pages.Clone

错误        1        “Pages”不是“GrapeCity.ActiveReports.Document.PageDocument”的成员。

Lenka.Guo 发表于 2016-6-22 11:27:04

travel_he 发表于 2016-6-22 09:51
Dim pr As New GrapeCity.ActiveReports.PageReport(New System.IO.FileInfo(Context.Server.MapPath("Pag ...

非常抱歉,之前没理解清楚,您是想将PageReport作为对象传递过去,如果传PageReport对象,传过去是空,
需要在Session中传Document对象,代码如下:GrapeCity.ActiveReports.PageReport rdl = new GrapeCity.ActiveReports.PageReport(new System.IO.FileInfo(Server.MapPath(@"~\RdlReport1.rdlx")));
                GrapeCity.ActiveReports.Document.PageDocument rptd = new GrapeCity.ActiveReports.Document.PageDocument(rdl);
                WebViewer1.Report = rdl;

                Session["Report"] = rptd;接受Session 对象:

PageDocument rpt = context.Session["Report"] as PageDocument;

travel_he 发表于 2016-6-22 15:51:49

完美解决,VERY NICE

Lenka.Guo 发表于 2016-6-22 17:46:00

travel_he 发表于 2016-6-22 15:51
完美解决,VERY NICE

:hjyzw:
页: [1]
查看完整版本: FlashViewer导出问题