{"id":76,"date":"2010-09-19T10:36:00","date_gmt":"2010-09-19T10:36:00","guid":{"rendered":"\/lisa\/post\/2010\/09\/19\/Group-Totals-Redux-Updating-this-technique-in-RS-2008-R2.aspx"},"modified":"2010-09-19T10:36:00","modified_gmt":"2010-09-19T10:36:00","slug":"group-totals-redux-updating-this-technique-in-rs-2008-r2","status":"publish","type":"post","link":"https:\/\/spacefold.com\/lisa\/2010\/09\/19\/group-totals-redux-updating-this-technique-in-rs-2008-r2\/","title":{"rendered":"Group Totals Redux: Updating this technique in RS 2008 R2"},"content":{"rendered":"<p>As I mentioned <a title=\"last post\" href=\"\/lisa\/2010\/09\/11\/Life-in-a-nutshell-Talking-is-Good\/\">last time<\/a>, Joe Carey has been using my group totals techniques from a relatively old walkthrough here, which was complicated enough to be a two-parter (<a href=\"https:\/\/spacefold.com\/lisa\/?s=pagetotals\">https:\/\/spacefold.com\/lisa\/?s=pagetotals<\/a>&nbsp;will give you both parts).&nbsp; It&nbsp;could not have been made any shorter without leaving out vital bits.&nbsp; That&#8217;s because the whole thing was a giant kludge.<\/p>\n<p>Along comes RS 2008 R2 and makes the whole thing unnecessary, I&#8217;m happy to say.&nbsp;To re-work the original report example, here&#8217;s all you&#8217;d do instead:<\/p>\n<p>1. Use something like the following expression, instead of my bunch-of-code, to express your page numbers; I&#8217;ll take advantage of this opportunity to demonstrate again how&nbsp;clear multiple,&nbsp;well-labelled&nbsp;placeholders can make things in a single text box, but of course you can set up the expressions however you want:&nbsp;<\/p>\n<p style=\"TEXT-ALIGN: center\"><img decoding=\"async\" src=\"\/lisa\/wp-non\/migrated\/2010\/9\/GroupTotalsR2Designer.png\" alt=\"\" \/><\/p>\n<p>&nbsp;2.&nbsp; So what&#8217;s under those nifty placeholders?&nbsp;<\/p>\n<p>&nbsp;<span style=\"color:red;\">GroupPgNo<\/span> and <span style=\"color:red;\">Group Pages<\/span> each use one of the Globals with which you&#8217;re familiar, and which have given you such unsatisfactory results in the past (<strong>=Globals!PageNumber<\/strong> and <strong>=Globals!TotalPages <\/strong>).&nbsp; <span style=\"color:red;\">ReportPageNo<\/span> and <span style=\"color:red;\">Report Pages<\/span> use two new ones:<strong> =Globals!OverallPageNumber<\/strong> AND <strong>=Globals!OverallTotalPages<\/strong> .<\/p>\n<p>3. So how are we getting good results from the two well-known and ill-behaved Globals on a group level now?<\/p>\n<p>One simple change to the properties of the group&nbsp;in which we&#8217;re requesting a page break:<\/p>\n<p style=\"text-align: center;\"><img decoding=\"async\" src=\"\/lisa\/wp-non\/migrated\/2010\/9\/GroupTotalsR2Properties.png\" alt=\"\" \/><\/p>\n<h3>OMG it&#8217;s so easy<\/h3>\n<p>Hard to believe, isn&#8217;t it?<\/p>\n<p>The only code left here is a little&nbsp;thing I did underneath <span style=\"color:red;\">This Region<\/span>, to get the right value in the page header for each region;&nbsp; this probably wouldn&#8217;t have been necessary if I&#8217;d been able to figure out why I couldn&#8217;t get the <strong>RepeatWith<\/strong> property for my Region textbox to work reliably in PDF export.&nbsp; In any case,&nbsp;the expression under the placeholder&nbsp;is =Code.GetThisRegion(ReportItems(<span style=\"color: #a31515;\">&#8220;Region&#8221;<\/span>).Value)<\/p>\n<p>&#8230; and the code is pretty trivial, you&#8217;ll agree:<\/p>\n<p class=\"code\"><span style=\"color: #0000ff; \">Public<\/span> ThisRegion <span style=\"color: #0000ff; \">As<\/span> <span style=\"color: #0000ff; \">String<\/span> = <span style=\"color: #a31515; \">&#8220;&#8221;<\/span><br \/><span style=\"color: #0000ff; \"><br \/>Function<\/span> GetThisRegion(<span style=\"color: #0000ff; \">ByVal<\/span> tS <span style=\"color: #0000ff; \">As<\/span> <span style=\"color: #0000ff; \">String<\/span>) <span style=\"color: #0000ff; \">As<\/span> <span style=\"color: #0000ff; \">String<\/span><br \/><span style=\"color: #0000ff; \">&nbsp;&nbsp; If<\/span> Len(tS) &gt; 0 <span style=\"color: #0000ff; \">AndAlso<\/span> tS &lt;&gt; ThisRegion <span style=\"color: #0000ff; \">Then<\/span><br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ThisRegion = tS<br \/><span style=\"color: #0000ff; \">&nbsp;&nbsp; End<\/span> <span style=\"color: #0000ff; \">If<\/span><br \/><span style=\"color: #0000ff; \">&nbsp;&nbsp; Return<\/span> ThisRegion <br \/><span style=\"color: #0000ff; \">End<\/span> <span style=\"color: #0000ff; \">Function<\/span><\/p>\n<h3>Back to Joe&#8217;s original question<\/h3>\n<p>While we don&#8217;t have to use the kludge for group totals, naturally some of you are going to want an updated example of SOAP usage anyway.&nbsp; It&#8217;s often a requirement to pull a report from the server in code and then display the output to the user under your own steam.&nbsp;<\/p>\n<p>In the original example, I used the <a title=\"MSDN on ReportService.asmx and SOAP\" href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/aa256607(v=SQL.80)\/\" target=\"_blank\" rel=\"noopener\">ReportingService class in the ReportServer 2000 API<\/a>, which was still available in 2005 and was a simple path to take.&nbsp; (To be honest, I didn&#8217;t think about it very much because I generally prefer URL Access, but had shown that alternative in a number of other examples.)&nbsp;&nbsp; Joe would like to do the same thing using the 2005 APIs.<\/p>\n<p class=\"NB\">That&#8217;s not a typo.&nbsp; Use the 2005 APIs to access RS 2008, or 2006 (I <em>think, <\/em>never having done this) if you&#8217;re in SharePoint integrated mode.<\/p>\n<p>In the updated APIs, a different class (in a different WSDL) becomes the main entry point for the type of work I was showing you: ReportExecutionService.<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: center;\"><img decoding=\"async\" src=\"\/lisa\/wp-non\/migrated\/2010\/9\/GroupTotals2008R2WebRef.png\" alt=\"\" \/><\/p>\n<p style=\"text-align: left;\">&#8230; Note that you would&nbsp;use the ReportingService2005 class&nbsp;(via ReportService2005.asmx), instead of or along side, ReportExecutionService&nbsp;( ReportExecution2005.asmx)&nbsp;if you wanted to interrogate the report catalog, find out about a report&#8217;s parameters dynamically, etc.<\/p>\n<p style=\"text-align: left;\">I&#8217;ll briefly sketch out the revised code under the two buttons in my client-side walkthrough sample, here, leaving the original code in comments for the first method:<\/p>\n<p class=\"code\"><span style=\" color: #0000ff; \">Protected<\/span> <span style=\" color: #0000ff; \">Sub<\/span> GetReportHTML _<br \/>&nbsp;&nbsp; (<span style=\" color: #0000ff; \">ByVal<\/span> sender <span style=\" color: #0000ff; \">As<\/span> <span style=\" color: #0000ff; \">Object<\/span>, <span style=\" color: #0000ff; \">ByVal<\/span> e <span style=\" color: #0000ff; \">As<\/span> System.<span style=\" color: #2b91af; \">EventArgs<\/span> ) <\/p>\n<p><span style=\" color: #008000; \">&nbsp;&nbsp; &#8216; Dim rs As New ReportingService2005()<\/span>&nbsp;<br \/><span style=\" color: #008000; \"><span style=\" color: #008000; \">&nbsp;&nbsp; <\/span>&#8216; rs.Credentials = System.Net.CredentialCache.DefaultCredentials<\/span>&nbsp;<br \/><span style=\" color: #0000ff; \"><span style=\" color: #008000; \">&nbsp;&nbsp; <\/span>Dim<\/span> rsE <span style=\" color: #0000ff; \">As<\/span> <span style=\" color: #0000ff; \">New<\/span> ReportExecutionService()&nbsp;<br \/><span style=\" color: #008000; \">&nbsp;&nbsp; <\/span>rsE.Credentials = System.Net. <span style=\" color: #2b91af; \">CredentialCache<\/span>.DefaultCredentials&nbsp;<\/p>\n<p><span style=\" color: #008000; \"><span style=\" color: #008000; \">&nbsp;&nbsp; <\/span>&#8216; Let&#8217;s add the correct Render arguments&nbsp;<br \/><span style=\" color: #008000; \">&nbsp;&nbsp; <\/span><\/span><span style=\" color: #0000ff; \">Dim<\/span> result <span style=\" color: #0000ff; \">As<\/span> <span style=\" color: #0000ff; \">Byte<\/span>() = <span style=\" color: #0000ff; \">Nothing<\/span>&nbsp;<br \/><span style=\" color: #008000; \">&nbsp;&nbsp; <\/span><span style=\" color: #0000ff; \">Dim<\/span> reportPath <span style=\" color: #0000ff; \">As<\/span> <span style=\" color: #0000ff; \">String<\/span> = <span style=\" color: #a31515; \">&#8220;\/Tests\/GroupTotals2008R2&#8221;<\/span>&nbsp;<br \/><span style=\" color: #008000; \">&nbsp;&nbsp; <\/span><span style=\" color: #0000ff; \">Dim<\/span> format <span style=\" color: #0000ff; \">As<\/span> <span style=\" color: #0000ff; \">String<\/span> = <span style=\" color: #a31515; \">&#8220;HTML4.0&#8221;<\/span>&nbsp;<br \/><span style=\" color: #008000; \"><span style=\" color: #008000; \">&nbsp;&nbsp; <\/span>&#8221; For the real fileKey value,&nbsp;<\/span><br \/><span style=\" color: #008000; \"><span style=\" color: #008000; \">&nbsp;&nbsp; <\/span>&#8221; you would want to put something in&nbsp;<\/span><br \/><span style=\" color: #008000; \"><span style=\" color: #008000; \">&nbsp;&nbsp; <\/span>&#8221; here that uniquely identifies the session and the user,&nbsp;<\/span><br \/><span style=\" color: #008000; \"><span style=\" color: #008000; \">&nbsp;&nbsp; <\/span>&#8221; not just the output type as I am doing here&#8230;&nbsp;<\/span><br \/><span style=\" color: #008000; \"><span style=\" color: #008000; \">&nbsp;&nbsp; <\/span>&#8216;Dim fileKey As String<\/span>&nbsp;<br \/><span style=\" color: #008000; \"><span style=\" color: #008000; \">&nbsp;&nbsp; <\/span>fileKey = &#8220;TestHTML&#8221;<\/span>&nbsp;<\/p>\n<p><span style=\" color: #008000; \"><span style=\" color: #008000; \">&nbsp;&nbsp; <\/span>&#8221; Prepare report parameters. You can still do this<\/span>&nbsp;<br \/><span style=\" color: #008000; \"><span style=\" color: #008000; \">&nbsp;&nbsp; <\/span>&#8221; if your report has some parameters you want to pass,<\/span>&nbsp;<br \/><span style=\" color: #008000; \"><span style=\" color: #008000; \">&nbsp;&nbsp; <\/span>&#8221; we just don&#8217;t have the need to pass our &#8220;special&#8221;<\/span>&nbsp;<br \/><span style=\" color: #008000; \"><span style=\" color: #008000; \">&nbsp;&nbsp; <\/span>&#8221; ones for the group total code any more:&#8230;&nbsp;<br \/><span style=\" color: #008000; \">&nbsp;&nbsp; <\/span><\/span><span style=\" color: #0000ff; \">Dim<\/span> parameters(2) <span style=\" color: #0000ff; \">As<\/span> RSExec.ParameterValue&nbsp;<br \/><span style=\" color: #008000; \"><span style=\" color: #008000; \">&nbsp;&nbsp; <\/span>&#8216;parameters(0) = New ParameterValue()<\/span>&nbsp;<br \/><span style=\" color: #008000; \"><span style=\" color: #008000; \">&nbsp;&nbsp; <\/span>&#8216;parameters(0).Name = &#8220;FileKey&#8221;<\/span>&nbsp;<br \/><span style=\" color: #008000; \"><span style=\" color: #008000; \">&nbsp;&nbsp; <\/span>&#8216;parameters(0).Value = fileKey<\/span>&nbsp;<br \/><span style=\" color: #008000; \"><span style=\" color: #008000; \">&nbsp;&nbsp; <\/span>&#8216;parameters(1) = New ParameterValue()<\/span>&nbsp;<br \/><span style=\" color: #008000; \"><span style=\" color: #008000; \">&nbsp;&nbsp; <\/span>&#8216;parameters(1).Name = &#8220;PreProcess&#8221;<\/span>&nbsp;<br \/><span style=\" color: #008000; \"><span style=\" color: #008000; \">&nbsp;&nbsp; <\/span>&#8216;parameters(1).Value = True<\/span>&nbsp;<br \/><span style=\" color: #008000; \"><span style=\" color: #008000; \">&nbsp;&nbsp; <\/span>&#8216;parameters(2) = New ParameterValue()<\/span>&nbsp;<br \/><span style=\" color: #008000; \"><span style=\" color: #008000; \">&nbsp;&nbsp; <\/span>&#8216;parameters(2).Name = &#8220;ExportType&#8221;<\/span>&nbsp;<br \/><span style=\" color: #008000; \"><span style=\" color: #008000; \">&nbsp;&nbsp; <\/span>&#8216;parameters(2).Value = &#8220;HTML&#8221;<\/span>&nbsp;<\/p>\n<p><span style=\" color: #008000; \"><span style=\" color: #008000; \">&nbsp;&nbsp; <\/span>&#8216; This doesn&#8217;t have the same meaning any more<\/span>&nbsp;<br \/><span style=\" color: #008000; \"><span style=\" color: #008000; \">&nbsp;&nbsp; <\/span>&#8216; because we aren&#8217;t double-calling for the preprocess<\/span>&nbsp;<br \/><span style=\" color: #008000; \"><span style=\" color: #008000; \">&nbsp;&nbsp; <\/span>&#8216; to calculate pages:<\/span>&nbsp;<br \/><span style=\" color: #008000; \"><span style=\" color: #008000; \">&nbsp;&nbsp; <\/span>&#8216;Dim sh As New SessionHeader()<\/span>&nbsp;<br \/><span style=\" color: #008000; \"><span style=\" color: #008000; \">&nbsp;&nbsp; <\/span>&#8216;rs.SessionHeaderValue = sh<\/span>&nbsp;<br \/><span style=\" color: #0000ff; \"><span style=\" color: #008000; \">&nbsp;&nbsp; <\/span>Try<\/span>&nbsp;<br \/><span style=\" color: #008000; \"><span style=\" color: #008000; \">&nbsp;&nbsp;&nbsp;<span style=\" color: #008000; \">&nbsp;&nbsp; <\/span><\/span>&#8216;result = rs.Render(reportPath, format, Nothing, Nothing, parameters, _<\/span>&nbsp;<br \/><span style=\" color: #008000; \"><span style=\" color: #008000; \">&nbsp;&nbsp;&nbsp;<span style=\" color: #008000; \">&nbsp;&nbsp;&nbsp;<span style=\" color: #008000; \">&nbsp;&nbsp;&nbsp;<span style=\" color: #008000; \">&nbsp;&nbsp; <\/span><\/span><\/span><\/span>&#8216; Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing)<\/span>&nbsp;<br \/><span style=\" color: #008000; \"><br \/>&nbsp;&nbsp;&nbsp;<span style=\" color: #008000; \">&nbsp;&nbsp; <\/span><\/span>rsE.LoadReport(reportPath, <span style=\" color: #0000ff; \">Nothing<\/span> )&nbsp;<br \/><span style=\" color: #008000; \"><span style=\" color: #008000; \">&nbsp;&nbsp;&nbsp;<span style=\" color: #008000; \">&nbsp;&nbsp; <\/span><\/span>&#8216; rsE.SetExecutionParameters(parameters, Nothing)<\/span>&nbsp;<br \/><span style=\" color: #008000; \">&nbsp;&nbsp;&nbsp;<span style=\" color: #008000; \">&nbsp;&nbsp; <\/span><\/span>result = rsE.Render(format, <span style=\" color: #0000ff; \">Nothing<\/span>, <span style=\" color: #0000ff; \">Nothing<\/span>, <span style=\" color: #0000ff; \">Nothing<\/span>, _<br \/><span style=\" color: #008000; \">&nbsp;&nbsp;&nbsp;<span style=\" color: #008000; \">&nbsp;&nbsp;&nbsp;<span style=\" color: #008000; \">&nbsp;&nbsp;&nbsp;<span style=\" color: #008000; \">&nbsp;&nbsp;&nbsp;<\/span><\/span><\/span><\/span> <span style=\" color: #0000ff; \">Nothing<\/span>, <span style=\" color: #0000ff; \">Nothing<\/span>, <span style=\" color: #0000ff; \">Nothing<\/span>)&nbsp;<br \/><span style=\" color: #008000; \"><span style=\" color: #008000; \">&nbsp;&nbsp;&nbsp;<span style=\" color: #008000; \">&nbsp;&nbsp; <\/span><\/span>&#8216;sh.SessionId = rs.SessionHeaderValue.SessionId<\/span>&nbsp;<\/p>\n<p><span style=\" color: #008000; \"><span style=\" color: #008000; \">&nbsp;&nbsp;&nbsp;<span style=\" color: #008000; \">&nbsp;&nbsp; <\/span><\/span>&#8221; Now we&#8217;ll render a second time before displaying the results,&nbsp;<\/span><br \/><span style=\" color: #008000; \"><span style=\" color: #008000; \">&nbsp;&nbsp;&nbsp;<span style=\" color: #008000; \">&nbsp;&nbsp; <\/span><\/span>&#8221; letting the report know that we are not in &#8220;preprocess&#8221; mode this time:&nbsp;<\/span><br \/><span style=\" color: #008000; \"><span style=\" color: #008000; \">&nbsp;&nbsp;&nbsp;<span style=\" color: #008000; \">&nbsp;&nbsp; <\/span><\/span>&#8216;parameters(1).Value = False<\/span>&nbsp;<br \/><span style=\" color: #008000; \"><span style=\" color: #008000; \">&nbsp;&nbsp;&nbsp;<span style=\" color: #008000; \">&nbsp;&nbsp; <\/span><\/span>&#8216;result = rs.Render(reportPath, format, Nothing, Nothing, parameters, _<\/span>&nbsp;<br \/><span style=\" color: #008000; \"><span style=\" color: #008000; \">&nbsp;&nbsp;&nbsp;<span style=\" color: #008000; \">&nbsp;&nbsp; <\/span><\/span>&#8216; Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing)<\/span>&nbsp;<br \/><span style=\" color: #008000; \">&nbsp;&nbsp;&nbsp;<span style=\" color: #008000; \">&nbsp;&nbsp; <\/span><\/span>Response.OutputStream.Write(result, 0, result.Length)&nbsp;<br \/><span style=\" color: #008000; \">&nbsp;&nbsp;&nbsp;<span style=\" color: #008000; \">&nbsp;&nbsp; <\/span><\/span>result = <span style=\" color: #0000ff; \">Nothing<\/span>&nbsp;<br \/><span style=\" color: #0000ff; \"><span style=\" color: #008000; \">&nbsp;&nbsp; <\/span>Catch<\/span> ex <span style=\" color: #0000ff; \">As<\/span> Exception&nbsp;<br \/><span style=\" color: #008000; \">&nbsp;&nbsp;&nbsp;<span style=\" color: #008000; \">&nbsp;&nbsp; <\/span><\/span>Response.Write(ex.Message())&nbsp;<br \/><span style=\" color: #008000; \">&nbsp;&nbsp; <\/span><span style=\" color: #0000ff; \">End<\/span>&nbsp;<span style=\" color: #0000ff; \">Try<\/span>&nbsp;<br \/><span style=\" color: #008000; \"><span style=\" color: #008000; \">&nbsp;&nbsp;&nbsp;<br \/><span style=\" color: #008000; \">&nbsp;&nbsp; <\/span><\/span>&#8216;sh = Nothing<\/span>&nbsp;<br \/><span style=\" color: #008000; \"><span style=\" color: #008000; \">&nbsp;&nbsp; <\/span>&#8216;RS.Dispose()<\/span>&nbsp;<br \/><span style=\" color: #008000; \"><span style=\" color: #008000; \">&nbsp;&nbsp; <\/span>&#8216;RS = Nothing<\/span>&nbsp;<br \/><span style=\" color: #008000; \">&nbsp;&nbsp; <\/span>rsE.Dispose()&nbsp;<br \/><span style=\" color: #008000; \">&nbsp;&nbsp; <\/span>rsE = <span style=\" color: #0000ff; \">Nothing<\/span> <br \/><span style=\" color: #0000ff; \">End<\/span> <span style=\" color: #0000ff; \">Sub<\/span> <br \/><span style=\" color: #0000ff; \"><br \/>Protected<\/span> <span style=\" color: #0000ff; \">Sub<\/span> GetReportPDF _<br \/><span style=\" color: #008000; \">&nbsp;&nbsp;&nbsp;<span style=\" color: #008000; \">&nbsp;&nbsp; <\/span><\/span>(<span style=\" color: #0000ff; \">ByVal<\/span> sender <span style=\" color: #0000ff; \">As<\/span> <span style=\" color: #0000ff; \">Object<\/span>, <span style=\" color: #0000ff; \">ByVal<\/span> e <span style=\" color: #0000ff; \">As<\/span> System.<span style=\" color: #2b91af; \">EventArgs<\/span> )&nbsp;<br \/><span style=\" color: #008000; \">&nbsp;&nbsp; <\/span><span style=\" color: #0000ff; \">Dim<\/span> rsE <span style=\" color: #0000ff; \">As<\/span> <span style=\" color: #0000ff; \">New<\/span> ReportExecutionService()&nbsp;<br \/><span style=\" color: #008000; \">&nbsp;&nbsp; <\/span>rsE.Credentials = System.Net. <span style=\" color: #2b91af; \">CredentialCache<\/span>.DefaultCredentials&nbsp;<br \/><span style=\" color: #008000; \">&nbsp;&nbsp; <\/span><span style=\" color: #0000ff; \">Dim<\/span> result <span style=\" color: #0000ff; \">As<\/span> <span style=\" color: #0000ff; \">Byte<\/span>() = <span style=\" color: #0000ff; \">Nothing<\/span>&nbsp;<br \/><span style=\" color: #008000; \">&nbsp;&nbsp; <\/span><span style=\" color: #0000ff; \">Dim<\/span> reportPath <span style=\" color: #0000ff; \">As<\/span> <span style=\" color: #0000ff; \">String<\/span> = <span style=\" color: #a31515; \">&#8220;\/Tests\/GroupTotals2008R2&#8221;<\/span>&nbsp;<br \/><span style=\" color: #008000; \">&nbsp;&nbsp; <\/span><span style=\" color: #0000ff; \">Dim<\/span> format <span style=\" color: #0000ff; \">As<\/span> <span style=\" color: #0000ff; \">String<\/span> = <span style=\" color: #a31515; \">&#8220;PDF&#8221;<\/span>&nbsp;<br \/><span style=\" color: #008000; \"><br \/><span style=\" color: #008000; \">&nbsp;&nbsp; <\/span>&#8216; Dim parameters(2) As RSExec.ParameterValue &#8211; if needed,<\/span>&nbsp;<br \/><span style=\" color: #008000; \"><span style=\" color: #008000; \">&nbsp;&nbsp; <\/span>&#8216; set up whatever params you want.<\/span>&nbsp;<br \/><span style=\" color: #0000ff; \"><span style=\" color: #008000; \">&nbsp;&nbsp; <\/span>Try<\/span>&nbsp;<br \/><span style=\" color: #008000; \">&nbsp;&nbsp;&nbsp;<span style=\" color: #008000; \">&nbsp;&nbsp; <\/span><\/span>rsE.LoadReport(reportPath, <span style=\" color: #0000ff; \">Nothing<\/span> )&nbsp;<br \/><span style=\" color: #008000; \"><span style=\" color: #008000; \">&nbsp;&nbsp;&nbsp;<span style=\" color: #008000; \">&nbsp;&nbsp; <\/span><\/span>&#8216; if needed: rsE.SetExecutionParameters(parameters, Nothing)<\/span>&nbsp;<br \/><span style=\" color: #008000; \">&nbsp;&nbsp;&nbsp;<span style=\" color: #008000; \">&nbsp;&nbsp; <\/span><\/span>result = rsE.Render( _&nbsp;<br \/><span style=\" color: #008000; \">&nbsp;&nbsp;&nbsp;<span style=\" color: #008000; \">&nbsp;&nbsp;&nbsp;<span style=\" color: #008000; \">&nbsp;&nbsp; <\/span><\/span><\/span>format, <span style=\" color: #0000ff; \">Nothing<\/span>, <span style=\" color: #0000ff; \">Nothing<\/span>, <span style=\" color: #0000ff; \">Nothing<\/span>, <span style=\" color: #0000ff; \">Nothing<\/span>, <span style=\" color: #0000ff; \">Nothing<\/span>, <span style=\" color: #0000ff; \">Nothing<\/span>)&nbsp;<br \/><span style=\" color: #008000; \">&nbsp;&nbsp;&nbsp;<span style=\" color: #008000; \">&nbsp;&nbsp; <\/span><\/span>Response.ContentType = <span style=\" color: #a31515; \">&#8220;Application\/pdf&#8221;<\/span>&nbsp;<br \/><span style=\" color: #008000; \">&nbsp;&nbsp;&nbsp;<span style=\" color: #008000; \">&nbsp;&nbsp; <\/span><\/span>Response.OutputStream.Write(result, 0, result.Length)&nbsp;<br \/><span style=\" color: #008000; \">&nbsp;&nbsp;&nbsp;<span style=\" color: #008000; \">&nbsp;&nbsp; <\/span><\/span>result = <span style=\" color: #0000ff; \">Nothing<\/span>&nbsp;<br \/><span style=\" color: #008000; \">&nbsp;&nbsp; <\/span><span style=\" color: #0000ff; \">Catch<\/span> ex <span style=\" color: #0000ff; \">As<\/span> Exception&nbsp;<br \/><span style=\" color: #008000; \">&nbsp;&nbsp;&nbsp;<span style=\" color: #008000; \">&nbsp;&nbsp; <\/span><\/span>Response.Write(ex.Message())&nbsp;<br \/><span style=\" color: #008000; \">&nbsp;&nbsp; <\/span><span style=\" color: #0000ff; \">End<\/span> <span style=\" color: #0000ff; \">Try<\/span>&nbsp;<br \/><span style=\" color: #008000; \">&nbsp;&nbsp; <\/span>rsE.Dispose()&nbsp;<br \/><span style=\" color: #008000; \">&nbsp;&nbsp; <\/span>rsE = <span style=\" color: #0000ff; \">Nothing<\/span> <br \/><span style=\" color: #0000ff; \">End<\/span> <span style=\" color: #0000ff; \">Sub<\/span><\/p>\n<p>&nbsp;<\/p>\n<h3>Pretty similar to what we did before, only much, much simpler.&nbsp;<\/h3>\n<p>I&#8217;m wondering if it is the &#8220;session&#8221; stuff that tripped up Joe.&nbsp;&nbsp; In any case, we don&#8217;t need it any more because we&#8217;re not double-calling the report to do our preprocess run.&nbsp; I&#8217;ll revisit this subject if it is seems necessary for anybody with a different scenario they want to share and discuss.<\/p>\n<p>If not, I think it&#8217;s time for me to get back to work on XMLRSDocs.&nbsp;<\/p>\n<h3>Have I missed your question here?<\/h3>\n<p>I think I&#8217;ve pretty much cleared out my backlog of promised\/pending solutions for now.&nbsp; If you&#8217;ve asked me a question and I didn&#8217;t answer it, chances are I thought it was spam (it&#8217;s getting hard to wade through it all).&nbsp;<\/p>\n<p>&nbsp;Feel free to use the contact page to send me a message with details,rather than a comment, and I&#8217;ll do my best.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>As I mentioned last time, Joe Carey has been using my group totals techniques from a relatively old walkthrough here, which was complicated enough to be a two-parter (https:\/\/spacefold.com\/lisa\/?s=pagetotals&nbsp;will give you both parts).&nbsp; It&nbsp;could not have been made any shorter without leaving out vital bits.&nbsp; That&#8217;s because the whole thing was a giant kludge. Along<a class=\"more-link\" href=\"https:\/\/spacefold.com\/lisa\/2010\/09\/19\/group-totals-redux-updating-this-technique-in-rs-2008-r2\/\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5,6],"tags":[],"class_list":["post-76","post","type-post","status-publish","format-standard","hentry","category-reporting","category-sql-server"],"_links":{"self":[{"href":"https:\/\/spacefold.com\/lisa\/wp-json\/wp\/v2\/posts\/76","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/spacefold.com\/lisa\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/spacefold.com\/lisa\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/spacefold.com\/lisa\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/spacefold.com\/lisa\/wp-json\/wp\/v2\/comments?post=76"}],"version-history":[{"count":0,"href":"https:\/\/spacefold.com\/lisa\/wp-json\/wp\/v2\/posts\/76\/revisions"}],"wp:attachment":[{"href":"https:\/\/spacefold.com\/lisa\/wp-json\/wp\/v2\/media?parent=76"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/spacefold.com\/lisa\/wp-json\/wp\/v2\/categories?post=76"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/spacefold.com\/lisa\/wp-json\/wp\/v2\/tags?post=76"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}