数据透视表报表-运行时错误 [英] Pivot Table Report - RUN TIME ERROR

查看:166
本文介绍了数据透视表报表-运行时错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,先生

我下载了您的示例:PivotTableReport.aspx& PivotTableReport.aspx.vb.
我正在探索将数据从数据库导出到数据透视表的方法.

但是,当我尝试运行您的示例代码时,当我单击链接时出现以下错误-导出到Excel"

我收到以下错误:

Hi Sir,

I downloaded your sample: PivotTableReport.aspx & PivotTableReport.aspx.vb.
I am exploring methods to export data from database into pivot table.

However when I try to run your sample code I hit the following error when I click on the link - "Export To Excel"

I get the following error:

Microsoft JScript runtine error: ''Worksheet(...).PivotTables(...).PivotFields(...).Interior'' is null or not an object at the following lines - 


WorkBook.Worksheets(2).PivotTables("PivotTable1").PivotFields("Name").Interior.ColorIndex = 10;
        WorkBook.Worksheets(1).PivotTables("PivotTable1").PivotFields("Age").Function = -4112;
        WorkBook.Worksheets(2).PivotTables("PivotTable1").DisplayImmediateItems = true;

        var ch1 = Sheet2.ChartObjects.Add(rang2.Left + rang2.Width, rang2.Top, 350, 220);
        ch1.Chart.ChartType = -4120;
        ch1.Chart.SetSourceData(rang2, 2);

        var ch1 = Sheet2.ChartObjects.Add(ch1.Left + ch1.Width, ch1.Top, 400, 250);
        ch1.Chart.ChartType = 95;
        ch1.Chart.SetSourceData(rang2, 2);

        var ch2 = Sheet2.ChartObjects.Add(rang2.Left + rang2.Width, ch1.Top + ch1.Height, 400, 250);
        ch2.Chart.ChartType = -4100;
        ch2.Chart.SetSourceData(rang2, 2);

        WorkBook.Worksheets(2).Name = "Pivot_Table_Report";
        WorkBook.Worksheets(1).Delete();
        WorkBook.Worksheets(2).Delete();
        WorkBook.HTMLProject.RefreshDocument();
        ExlApp.UserControl = false;
        ExlApp.Visible = true;
    }




请在以下方面为我提供帮助.




Please assist me with the following. Your help is most apperiated!

推荐答案

如果您对此处找到的某些文章有疑问,请在文章结尾的论坛中提问.本文作者在这里看到您的问题的机会不高.
If you have a problem with some article that you found here then please post your question in the forum at the end of the article. The chances of the article''s author seeing your question here are not high.


这篇关于数据透视表报表-运行时错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆