Jasper Reports是Crystal Reports的绝佳开源替代品.它非常适用于单页PDF页面,例如多页报告的字母和发票.然而,它不是非常友好的.NET,并且让C#/ Mono与JasperServer玩得很好并不富有成效.
有没有人从C#获得有关如何在JasperServer上运行报告的代码示例,并附加带有SOAP请求的XML数据集?它需要在Mono上运行,因此Microsoft.Web.Services2是不可能的.
我试图推出自己的肥皂请求.Jasper Server似乎接受了它,但我似乎无法得到任何响应,而不是服务器500错误.我没有附加一个MTOM附件.
var sb = new StringBuilder();
sb.AppendLine("<s:Envelope xmlns:s=\"http://schemas.xmlsoap.org/soap/envelope/\">");
sb.AppendLine("<s:Body s:encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\">");
sb.AppendLine("<q1:runReport xmlns:q1=\"http://axis2.ws.jasperserver.jaspersoft.com\">");
sb.AppendLine("<requestXmlString xsi:type=\"xsd:string\">");
sb.AppendLine("<request operationName=\"runReport\" locale=\"en\">");
sb.AppendLine(" <argument name=\"RUN_OUTPUT_FORMAT\">PDF</argument>");
sb.AppendFormat(" <resourceDescriptor name=\"\" wsType=\"\" uriString=\"{0}\" isNew=\"false\">", "/JourneyReport");
sb.AppendLine(" <label>null</label>");
sb.AppendLine(" <parameter name=\"testparam\">1</parameter>");
sb.AppendLine(" </resourceDescriptor>");
sb.AppendLine(" </request>");
sb.AppendLine("</requestXmlString>");
sb.AppendLine("</q1:runReport>");
sb.AppendLine("</s:Body></s:Envelope>");
var webRequest = (HttpWebRequest)WebRequest.Create("http://localhost:8080/jasperserver/services/repository");
webRequest.Credentials = new NetworkCredential("jasperadmin","jasperadmin");
webRequest.PreAuthenticate = true;
webRequest.Headers.Add("SOAPAction","");
//Set HttpWebRequest properties
byte[] bytes = System.Text.Encoding.UTF8.GetBytes(sb.ToString());
webRequest.Method = "POST";
webRequest.ContentLength = bytes.Length;
webRequest.ContentType = "text/xml; encoding='utf-8'";
//Get Stream object
var …Run Code Online (Sandbox Code Playgroud) 我想从多个线程递增无符号整数.
我知道Interlocked.Increment,但它不处理无符号整数.我可以使用lock(),但出于性能原因我不愿意.
它只是以正常方式增加它的线程安全吗?如果偶尔的增量丢失也没关系,因为它只用于统计.我不想要的是腐败的价值.
我有一个在Linux/mono上运行的长时间运行的C#服务器应用程序,并且我已经添加了动态加载DLL程序集以扩展应用程序的功能.我发现在运行时更新这些DLL程序集不能使用AppDomains,这看起来会妨碍我已经完成的工作.当然会有解决方法,但这不是我真正想要的.
mono可以提供我可能错过的任何替代解决方案吗?C#4.0在这方面有什么新东西吗?
我正在使用ServiceStack.ServiceClient.Web.XmlServiceClient连接到Web服务.有没有办法为请求添加附件?
更多信息:
我想要做的是避免使用Microsoft.Web.Services2,因为我使用的是Mono.我正在尝试上传XML数据文件以及XML请求.就像这个问题一样: 通过C#.net中的webservice将报表单元上传到jasperserver
c# ×4
mono ×2
soap ×2
appdomain ×1
dll ×1
jasperserver ×1
plugins ×1
servicestack ×1
unsigned ×1