0

I would like to include ReportViewer control in the Parametric Search portlet rendering ASCX file.

I placed RDLC file in the content repository and it is being retrieved properly as binary steam

<%
....

//retrieve rdlc file 

string Path = "/Root/Global/renderers/ReportFiles/Report1.rdlc"

Node node = Node.LoadNode(Path);
var binaryData = node.GetBinary("Binary");
System.IO.Stream stream = binaryData.GetStream();

//setup report
ReportViewer1.ProcessingMode = ProcessingMode.Local;
ReportViewer1.LocalReport.LoadReportDefinition(stream);
ReportDataSource datasource = new ReportDataSource("Results", dsResults.Tables[0]);
ReportViewer1.LocalReport.DataSources.Add(datasource);

%>
<div id="rptvwr">
    <asp:ScriptManagerProxy ID="ScriptManagerProxy1" runat="server">
    </asp:ScriptManagerProxy>

    <rsweb:ReportViewer ID="ReportViewer1" runat="server" Width="600">
  </rsweb:ReportViewer>
</div>

This results in 'Illegal characters in path' error message.

After I changed my code around a bit and I now have the following situation:

  • when I use <asp:Scriptmanager> tag required by ReportViewer control, I receive an error message that only one ScriptManager per page is allowed

  • when I use <asp:ScriptManagerProxy> tag, I receive an error message stating

    Portlet Error: The Report Viewer Web Control requires a System.Web.UI.ScriptManager on the web form.

Mr Lister
  • 45,515
  • 15
  • 108
  • 150

1 Answers1

3

There can be only one ScriptManager control on the page, and SenseNet already generates one automatically, you cannot do much about it. Actually it is a custom control called SNScriptManager (it inherits from the default scriptmanager control) that the pagetemplate manager puts into the generated master page automatically. So you cannot put another one manually in your ascx.

You can still add additional scripts using the ScriptManagerProxy control if you want to, according to MSDN. Or you can use the built-in sn:ScriptRequest control that SenseNet offers, it helps with bundling - but of course all this applies only if you know exactly what scripts you have to add.

Maybe the ReportViewer control looks for the default script manager and does not like the custom (inherited) one used by SenseNet (I hope this is not the case).

(it is unclear from your question what happens if you do not add the sm proxy or any other tag, because the last two bullet points both start with "when I use tag..." - which tag do you mean here?)

Is the first error message ('illegal characters in path') still relevant? If yes, can you please add more details, e.g. a stack trace from event viewer?

Miklós Tóth
  • 1,490
  • 13
  • 19