【问题标题】:Azure - permissions running ReportViewerAzure - 运行 ReportViewer 的权限
【发布时间】:2011-08-18 17:51:28
【问题描述】:

我在正确时间运行的 Web 角色上成功运行控制台应用程序,并将成功发送测试电子邮件:

net start "task scheduler"
net user scheduler SecretP@ssw0rd /add
net localgroup Administrators scheduler /add
schtasks /create /SC WEEKLY /D THU /ST 17:30 /TN WariCheckNewFeed /TR %~dp0ConsoleAppToCallWebPage.exe /F /RU scheduler /RP SecretP@ssw0rd

问题:当它到达:

ReportParameter startAndEndDateStringParam = new ReportParameter("StartAndEndDateString", startAndEndDateString);

            LocalReport reportSummaryPDF = new LocalReport();
            reportSummaryPDF.ReportPath = "MerchantCampaignSummary.rdlc";

            reportSummaryPDF.SetParameters(new ReportParameter[] { campaignName, merchantNameParam, totalRedeemed, startAndEndDateStringParam });
            reportSummaryPDF.DataSources.Clear();
            reportSummaryPDF.DataSources.Add(datasource1);
            reportSummaryPDF.DataSources.Add(datasource2);

我明白了:

Application: ConsoleAppToCallWebPage.exe
                    Framework Version: v4.0.30319
                    Description: The process was terminated due to an unhandled exception.
                    Exception Info: Microsoft.Reporting.WinForms.LocalProcessingException
                    Stack:
                       at Microsoft.Reporting.WinForms.LocalReport.EnsureExecutionSession()
                       at Microsoft.Reporting.WinForms.LocalReport.SetParameters(System.Collections.Generic.IEnumerable`1<Microsoft.Reporting.WinForms.ReportParameter>)
                       at ConsoleAppToCallWebPage.Program.SendMerchantSummaryAndBreakdownReports(System.String, System.Guid, System.Guid)
                       at ConsoleAppToCallWebPage.Program.Main(System.String[])

DLLS 是来自我的 Win7 64 位机器的 ReportViewer 版本 10。

如果我 RDP 到 Azure Web 实例,我可以从 e:\approot\startuptasks\consoleapptocallwebpage.exe 成功运行控制台应用程序

感觉像是权限!

<WebRole name="Web" vmsize="Small" enableNativeCodeExecution="true">
    <Sites>
      <Site name="Web">
        <Bindings>
          <Binding name="HttpIn" endpointName="HttpIn" />
        </Bindings>
      </Site>
      <Site name="WebMVCAdmin" physicalDirectory="c:\publishWebMVCAdmin">
        <Bindings>
          <Binding name="HttpIn" endpointName="HttpIn" hostHeader="pvadmin8.mateerit.co.nz" />
        </Bindings>
      </Site>
    </Sites>
    <ConfigurationSettings>
      <Setting name="DiagnosticsConnectionString" />
      <Setting name="DataConnectionString" />
      <Setting name="SQLAzureRetryCountMaximum" />
      <Setting name="SQLAzureRetryDelaymSec" />
    </ConfigurationSettings>
    <Endpoints>
      <InputEndpoint name="HttpIn" protocol="http" port="80" />
    </Endpoints>
    <Imports>
      <Import moduleName="RemoteAccess" />
      <Import moduleName="RemoteForwarder" />
    </Imports>
    <Startup>
      <Task commandLine="StartupTasks\addScheduledTaskRunner.cmd" executionContext="elevated" taskType="simple" />
      <Task commandLine="StartupTasks\disableTimeout.cmd" executionContext="elevated" />
    </Startup>
  </WebRole>

【问题讨论】:

    标签: azure reportviewer


    【解决方案1】:

    答案是,reportviewer 作为计划任务运行时在错误的目录中查找 rdlc 文件!

    reportSummaryPDF.ReportPath = @"e:\approot\bin\StartupTasks\myreport.rdlc";

    http://blog.smarx.com/posts/windows-azure-startup-tasks-tips-tricks-and-gotchas
    http://www.voiceoftech.com/swhitley/index.php/2011/07/windows-azure-task-scheduler/

    在Win7计划任务上本地运行有助于调试。

    【讨论】:

      猜你喜欢
      • 2021-05-09
      • 1970-01-01
      • 2023-04-03
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-04-18
      • 2014-06-16
      • 1970-01-01
      相关资源
      最近更新 更多