1

ファイル システムからレポート サーバーにレポートをアップロードしようとしていますが、何らかの理由でレポートをアップロードしても表示されません。

コードのセクションは次のとおりです。

WebClient reptserv = new WebClient();
        File.WriteAllLines(@"C:\HereGoesNothing.rdl", lines);
        Uri address = new Uri("http://localhost/reportserver");
        reptserv.UploadFileAsync(address, @"C:\HereGoesNothing.rdl");           

レポートはレポートビルダーで問題なく実行されるので、それが問題ではないことはわかっていますが、その後は困惑しています.

4

1 に答える 1

2

以下を見てください。質問の答えです。これは、目的を達成するためのより良い方法です... .net アプリケーション経由でレポート マネージャーにレポート ファイルをアップロードしますか?

基本的に、サービス参照をレポート サーバーに追加し、プロキシ クラスを介してアップロードします。また、http: //msdn.microsoft.com/en-us/library/aa237438%28SQL.80%29.aspxも参照してください。

public static void createReport()
{
  ReportingService rs = new ReportingService();
  rs.Credentials = System.Net.CredentialCache.DefaultCredentials;

  Byte[] definition = null;
  Warning[] warnings = null;
  string name = "HereGoesNothing";

  try
  {
     FileStream stream = File.OpenRead(@"C:\HereGoesNothing.rdl");
     definition = new Byte[stream.Length];
     stream.Read(definition, 0, (int) stream.Length);
     stream.Close();
  }

  catch(IOException e)
  {
     Console.WriteLine(e.Message);
  }

  try
  {
     warnings = rs.CreateReport(name, "/", false, definition, null);

     if (warnings != null)
     {
        foreach (Warning warning in warnings)
        {
           Console.WriteLine(warning.Message);
        }
     }

     else
        Console.WriteLine("Report: {0} created successfully with no warnings", name);
  }

  catch (SoapException e)
  {
     Console.WriteLine(e.Detail.InnerXml.ToString());
  }

}

于 2011-03-16T16:48:09.250 に答える