Thank you for posting in the MSDN newsgroup.
From your description, I understand you're developing a custom Reporting
service reportviewer control(used in webpage), and your reportviewer
control is using the reporting Service's webservice methods to load the
report and render it. However, you found that there is some issue with the
loaded report's status management when we perform multiple "ToggleItem"
call on a certain report(identify through ExecutionInfo), correct? If
anything I didn't quite get, please feel free to let me know.
Again thanks for your detailed description and demo application which makes
the test quite simplified. I've performed some tests upon the test code you
provided on my local side. I did encounter the same behavior when running
the code against the sample report. Also, I've performed some other tests
through the "ReportExecutionService.LoadReport" method(used for existing
report on server rather than dynamically generated through
"ReportExecutionService.LoadReportDefinition") and found that the issue is
specific to the dynamically generated report. When I perform the test
(call multiple ToggleItems with separate ReportExecutionService instances
), the previous ToggleItem status can be persisted and reflect in the next
rendered report. Here is my new test through
"ReportExecutionService.LoadReport" method loaded report.
=========================================
void NewProcessReport()
{
LocalReportService2005.ReportingService2005 rs = new
LocalReportService2005.ReportingService2005();
rs.Credentials = System.Net.CredentialCache.DefaultCredentials;
rs.Url = "http://localhost/reportserver/reportservice2005.asmx";
Property pName = new Property();
pName.Name = "Name";
Property pDesc = new Property();
pDesc.Name = "Description";
Property[] properties = new Property[2];
properties[0] = pName;
properties[1] = pDesc;
string reportName = "/AdventureWorks Sample Reports/Company
Sales";
LocalReportExecution2005.ReportExecutionService res = new
LocalReportExecution2005.ReportExecutionService();
res.Url =
"http://localhost/reportserver/ReportExecution2005.asmx";
res.Credentials = System.Net.CredentialCache.DefaultCredentials;
string histroyID = null;
ExecutionInfo ei = new ExecutionInfo();
string format = "HTML4.0"; // "HTML";
string historyID = null;
string devInfo =
@"<DeviceInfo><Toolbar>True</Toolbar><Section>1</Section><HTMLFragment>False
</HTMLFragment></DeviceInfo>";
string encoding;
string mimeType;
string extension;
string[] streamIDs = null;
LocalReportExecution2005.Warning[] warnings = null;
byte[] rptOut = null;
bool resToggle = false;
FileStream stream = null;
try
{
//first load
ei = res.LoadReport(reportName,histroyID);
rptOut = res.Render(format, devInfo, out extension, out
encoding, out mimeType, out warnings, out streamIDs);
stream = File.Create(@"D:\temp\sqldir\ssrs\newreport.htm",
rptOut.Length);
stream.Write(rptOut, 0, rptOut.Length);
stream.Close();
ei = res.GetExecutionInfo();
//toggle 7
res.Dispose();
res = new LocalReportExecution2005.ReportExecutionService();
res.Url =
"http://localhost/reportserver/ReportExecution2005.asmx";
res.Credentials =
System.Net.CredentialCache.DefaultCredentials;
res.ExecutionHeaderValue = new ExecutionHeader();
res.ExecutionHeaderValue.ExecutionID = ei.ExecutionID;
res.ToggleItem("7");
rptOut = res.Render(format, devInfo, out extension, out
encoding, out mimeType, out warnings, out streamIDs);
stream = File.Create(@"D:\temp\sqldir\ssrs\newreport1.htm",
rptOut.Length);
stream.Write(rptOut, 0, rptOut.Length);
stream.Close();
ei = res.GetExecutionInfo();
//toggle 11
res.Dispose();
res = new LocalReportExecution2005.ReportExecutionService();
res.Url =
"http://localhost/reportserver/ReportExecution2005.asmx";
res.Credentials =
System.Net.CredentialCache.DefaultCredentials;
res.ExecutionHeaderValue = new ExecutionHeader();
res.ExecutionHeaderValue.ExecutionID = ei.ExecutionID;
res.ToggleItem("11");
rptOut = res.Render(format, devInfo, out extension, out
encoding, out mimeType, out warnings, out streamIDs);
stream = File.Create(@"D:\temp\sqldir\ssrs\newreport2.htm",
rptOut.Length);
stream.Write(rptOut, 0, rptOut.Length);
stream.Close();
//toggle 27
res.Dispose();
res = new LocalReportExecution2005.ReportExecutionService();
res.Url =
"http://localhost/reportserver/ReportExecution2005.asmx";
res.Credentials =
System.Net.CredentialCache.DefaultCredentials;
res.ExecutionHeaderValue = new ExecutionHeader();
res.ExecutionHeaderValue.ExecutionID = ei.ExecutionID;
res.ToggleItem("27");
rptOut = res.Render(format, devInfo, out extension, out
encoding, out mimeType, out warnings, out streamIDs);
stream = File.Create(@"D:\temp\sqldir\ssrs\newreport3.htm",
rptOut.Length);
stream.Write(rptOut, 0, rptOut.Length);
stream.Close();
}
catch (Exception ex)
{
MessageBox.Show(ex.ToString());
}
}
=================================
In the MSDN document about the "ReportExecutionService.LoadReportDefinition
Method", it said that
"Reports instantiated with the LoadReportDefinition method are temporary.
They are not represented in the report server namespace, and are discarded
when the server session expires. "
I'm suspecting the cause may be such temporary report won't have the same
status management like existing reports on reportserver.
Anyway, I'll perform some further research in my internal database to see
whether this is a known behavior.
Thanks,
Steven Cheng
Microsoft MSDN Online Support Lead
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
As for the further test on the webform reportviewer control, would you also
provide me the detailed code snippet (you manipulate the reportviewer to
loadReportdefinition and then render it)? I've just performed some test
through the ReportViewer.ServerReport.LoadReportDefinition method, however,
it will always report the following error
"Execution 'xxxxxxxxxxxxxxxx' cannot be found
Have you ever encountered this error? Also, based on my investigation on
the reportViewer control's internal code, it also use the ReportService2005
and ReportexecutionEngine webservice to perform the task (such as Load
Report or LoadReportDefinition).
Looking forward to your response.
Regards,
using
System;using
System.Data;using
System.Configuration;using
System.Collections;using
System.Web;using
System.Web.Security;using
System.Web.UI;using
System.Web.UI.WebControls;using
System.Web.UI.WebControls.WebParts;using
System.Web.UI.HtmlControls;using
System.IO;using
System.Xml;using
ReportViewerDemo.ReportExecution2005;using
ReportViewerDemo.ReportService2005;namespace
ReportViewerDemo{
public partial class RSReportViewer : System.Web.UI.Page{
private const string REPORT_SERVER_DNS = "rdserver"; private static string ReportingServiceURL = "http://{0}/reportserver/reportservice2005.asmx"; private static string ReportExecution2005URL = "http://{0}/reportserver/ReportExecution2005.asmx";
protected ReportingService2005 _rs = new ReportingService2005(); protected ReportExecutionService _res = new ReportExecutionService();
static RSReportViewer()
{
ReportingServiceURL =
string.Format(ReportingServiceURL, REPORT_SERVER_DNS);ReportExecution2005URL =
string.Format(ReportExecution2005URL, REPORT_SERVER_DNS);}
protected void Page_Load(object sender, EventArgs e){
ReportViewer1.ProcessingMode = Microsoft.Reporting.WebForms.
ProcessingMode.Remote;ReportViewer1.ServerReport.ReportServerUrl =
new Uri( string.Format("http://{0}/reportserver/", REPORT_SERVER_DNS));PrepareReport(
"/AdventureWorks Sample Reports/Copy of Company Sales", ReportViewer1);}
private void PrepareReport(string reportName, Microsoft.Reporting.WebForms.ReportViewer rv)
{
_rs.Credentials = System.Net.
CredentialCache.DefaultCredentials;_rs.Url = ReportingServiceURL;
_res.Credentials = System.Net.
CredentialCache.DefaultCredentials;_res.Url = ReportExecution2005URL;
_res.ExecutionHeaderValue =
new ExecutionHeader(); try{
byte[] b = _rs.GetReportDefinition(reportName);doc.Load(strm);
doc.Save(strmOut);
strmOut.Position = 0;
// must call thisrv.ServerReport.LoadReportDefinition(strmOut);
System.Diagnostics.
Debug.WriteLine(rv.ServerReport.GetExecutionId());
strm.Close();
strmOut.Close();
}
catch (Exception ex){
System.Diagnostics.
Debug.WriteLine(ex.ToString()); throw ex;}
}
}
}
This is a quick note to let you know that I am performing research on this
issue and will get back to you as soon as possible. I appreciate your
patience.
Sincerely,
Wei Lu
Microsoft Online Community Support
This is a quick note to let you know that I could re-produce this issue and
I still need some time to perform research and try to found a resolution. I
appreciate your patience.
Sincerely,
Wei Lu
Microsoft Online Community Support
==================================================
Regards-
"Wei Lu [MSFT]" <we...@online.microsoft.com> wrote in message
news:PePrp%23dlGH...@TK2MSFTNGXA01.phx.gbl...
Any help would be appreciated.
Thanks,
Abe
I have done some researching on this issue. I found that the session
created in the Report Temp database by LoadReportDefinition method will be
different with the LoadReport method.
This issue is most like that the LoadReportDefinition method does not hold
the report session.
I still need some time to contact with the development team to check
whether we could get a workaround.
Any help is appreciated, thank you.
Dave
HTMLFragment |
Indicates whether an HTML fragment is created in place of a full HTML document. An HTML fragment includes the report content in a TABLE element and omits the HTML and BODY elements. The default value is false. If you are rendering to HTML using the Render method of the SOAP API, you need to set this device information to true if you are rendering a report with images. Rendering using SOAP with the HTMLFragment property set to true creates URLs containing session information that can be used to properly request images. The images must be uploaded resources in the report server database. (ILN: I am seeing different behavior ...) |
Toolbar |
Indicates whether to show or hide the toolbar. The default of this parameter is true. If the value of this parameter is false, all remaining options (except the document map) are ignored. If you omit this parameter, the toolbar is automatically displayed for rendering formats that support it. The Report Viewer toolbar is rendered when you use URL access to render a report. The toolbar is not rendered through the SOAP API. However, the Toolbar device information setting affects the way that the report is displayed when using the SOAP Render method. If the value of this parameter is true when using SOAP to render to HTML, only the first section of the report is rendered. If the value is false, the entire HTML report is rendered as a single HTML page. (ILN: I am seeing different behavior ...) |
Thank you for the followup.
Due to some urgent issue I was absent perviously and our member Wei has
continued to help you on this issue. I was told that Wei has helped
leverage some other engineers from our product team to work with on this
issue offline. Have they helped you made any further progress or have you
informed this finding to them, I think they can help find more information
on this behavior you find.
Sincerely,
Steven Cheng
Microsoft MSDN Online Support Lead
This posting is provided "AS IS" with no warranties, and confers no rights.
However, in SP1, everytime the parameters are set, the report execution
is reset. This causes toggling and sorting to fail.
The workaround was to only set parameters when they have changed. I am
still curious as to why this functionality has changed in SP1 as it was
undocumented. Is it a new feature or bug? I am currently working with
support on this.
Dave
Thank you for your feedback.
Have you tried the suggestion that InvalidLastName posted?
I have provide the information to the PSS support and they will follow up
with you. Thank you!