0

我希望我的 Silverlight cloudapp 使用托管在名为 Reportviewer.aspx 的 WebForm 中的 SSRS Reportviewer 控件,当从我的 SL C# 类调用 javascript OpenReportviewer 函数时,这在测试 Azure“127.0.0.1”环境中运行良好:

<script type="text/javascript" src="Silverlight.js"></script>
<script type="text/javascript">
  function OpenReportViewer(ReportViewerURL, TabHeading, EstId, ShowExtraDetail, ReportTypeID, PreExpandSections) {
        var form = document.createElement('form');
        form.action = ReportViewerURL;   //'http://endorphin.cloudapp.net/Reporting/ReportViewer.aspx';
        form.method = "POST";
        form.target = '_blank'; // this is important to open a new window 

        var tabHeading = document.createElement('input');
        tabHeading.name = 'TabHeading';
        tabHeading.value = TabHeading;
        form.appendChild(tabHeading);

        var estID = document.createElement('input');
        estID.name = 'EstID';
        estID.value = EstId;
        form.appendChild(estID);

        var showExtraDetail = document.createElement('input');
        showExtraDetail.name = 'ShowExtraDetail';
        showExtraDetail.value = ShowExtraDetail;
        form.appendChild(showExtraDetail);

        var reportTypeID = document.createElement('input');
        reportTypeID.name = 'ReportTypeID';
        reportTypeID.value = ReportTypeID;
        form.appendChild(reportTypeID);

        var preExpandSections = document.createElement('input');
        preExpandSections.name = 'PreExpandSections';
        preExpandSections.value = PreExpandSections;
        form.appendChild(preExpandSections);

        document.body.appendChild(form);
        form.submit();
        document.body.removeChild(form);
      } 
    function onSilverlightError(sender, args) {...

但是,我现在已经部署到真正的 Azure,它说:“调用失败:OpenReportviewer”

上面的函数现在完全粘贴了。

调用代码是:

//**********************************************************************************
public void Invoke3(string tabHeading, int estID, int reportTypeID, bool showExtraDetail, bool preExpandSections)
{
  if (true == HtmlPage.IsPopupWindowAllowed)
  {
    string strBaseWebAddress = App.Current.Host.Source.AbsoluteUri;
    int PositionOfClientBin =
        App.Current.Host.Source.AbsoluteUri.ToLower().IndexOf(@"/clientbin");
    strBaseWebAddress = Strings.Left(strBaseWebAddress, PositionOfClientBin);
    string ReportViewerURL = String.Format(@"{0}/Reporting/ReportViewer.aspx", strBaseWebAddress);

    try
    {
      HtmlPage.Window.Invoke("OpenReportViewer", ReportViewerURL, tabHeading, estID.ToString(),
                            showExtraDetail.ToString(), reportTypeID.ToString(), preExpandSections.ToString());
    }
    catch (Exception ex)
    {
      My.ShowError("Failed to invoke Webform for Report Viewer.", ex);
    }
  }
  else
  {
    MessageBox.Show("You must enable popups to view reports. Safari browser is not supported.",
        "Error", MessageBoxButton.OK);
  }
}
4

1 回答 1

0

有2种可能:

  1. 本地 Azure 和真正的 Azure 之间的区别可能是安全区域。
  2. 可能存在一些指向本地 Azure 的硬编码链接。
于 2012-10-19T20:53:20.830 回答