可以试一下这个:
- public object GetReport(string reportName)
- {
- try
- {
- String URL = "http://192.168.222.1:8080/"+ reportName;
- String Info;
- HttpWebRequest wbRequest = (HttpWebRequest)WebRequest.Create(URL);
- wbRequest.Proxy = null;
- wbRequest.Method = "GET";
- wbRequest.ContentType = "application/xml; charset=UTF-8";
- MemoryStream ms_pub = new MemoryStream();
- HttpWebResponse wbResponse = (HttpWebResponse)wbRequest.GetResponse();
- using (Stream responseStream = wbResponse.GetResponseStream())
- {
- using (StreamReader sReader = new StreamReader(responseStream, Encoding.UTF8))
- {
- byte[] byte_pub = System.Text.Encoding.UTF8.GetBytes(sReader.ReadToEnd());
- ms_pub.Write(byte_pub, 0, byte_pub.Length);
- ms_pub.Seek(0, SeekOrigin.Begin);
- }
- }
- using (TextReader StreamTxtRead = new StreamReader(ms_pub))
- {
- PageReport ViewPgReport = new PageReport(StreamTxtRead);
- return ViewPgReport.Report;
- }
- }
- catch (Exception e)
- {
- throw e;
- }
- return 0;
- }
复制代码 在结合温大佬的,URL从数据库获取即可。
我这个是web端的,所以最后是return的ViewPgReport.Report;
咱们的直接reportLoad即可。结合一下这个和温大佬的
|