Hi,
I'm using the ReportViewer with MVC2! the structure of the page is:
<Master Page>
<tree node with report list>
<reportViewer>
</Master Page>
the reportViewer is render via a html.RenderPartial method. The problem occurs that the ID of the controls get rendered like this:
intNumber_etc
and then in the code I get something like that:
this will fail because you can't create a var in javascript starting with an integer! The generation of the int instead of the ctl is due that the WebForm Control doesn't have a parent Page (as I rendered it thourght html.RenderPartial)
I could put it in the master page and everything will work but I wanted to load each report in Ajax. That's why the reportViewer is in a ViewUserControl and would get called when the user selects a diferent report! Is there any way to prefix the ID ? Or to ban numbers from appearing in the ID?
A better solution would be that the ReportViewer object would be able to change the report through a Javascript method! That will make things much more easier!
what is the right approach? I know that in .NET 4 you can fix the ID to be static but telerik framework is counting on that ID beeing generated on a parent basis and I get some errors as well!
any help would be really apreciated!
regards,
jose
I'm using the ReportViewer with MVC2! the structure of the page is:
<Master Page>
<tree node with report list>
<reportViewer>
</Master Page>
the reportViewer is render via a html.RenderPartial method. The problem occurs that the ID of the controls get rendered like this:
intNumber_etc
and then in the code I get something like that:
var 6_ReportViewerControl = new ReportViewer('6_ReportViewerControl','6_ReportViewerControl_ReportToolbar','6_ReportViewerControl_ReportArea_WaitControl','6_ReportViewerControl_ReportArea_ReportCell','6_ReportViewerControl_ReportArea_PreviewFrame','6_ReportViewerControl_ParametersAreaCell', '6_ReportViewerControl_ReportArea_ErrorControl', '6_ReportViewerControl_ReportArea_ErrorLabel', '6_ReportViewerControl_CP', '/EmmaConsultant/Telerik.ReportViewer.axd', 'en-GB', 'en-GB', '5a8d02c91e0547138a03882a8f255652', 'Percent', '100', '', '6_ReportViewerControl_EditorPlaceholder', '6_ReportViewerControl_CalendarFrame', '6_ReportViewerControl_ReportArea_DocumentMapCell', {CurrentPageToolTip:'Current Page',ExportButtonText:'Export',ExportToolTip:'Export',ExportSelectFormatText:'Export to the selected format',FirstPageToolTip:'First page',LabelOf:'of',LastPageToolTip:'Last page',ProcessingReportMessage:'Generating report...',NextPageToolTip:'Next page',ParametersToolTip:'Click to close parameters area|Click to open parameters area',DocumentMapToolTip:'Hide document map|Show document map',PreviousPageToolTip:'Previous page',PrintToolTip:'Print',RefreshToolTip:'Refresh',NavigateBackToolTip:'Navigate back',NavigateForwardToolTip:'Navigate forward',ReportParametersSelectAllText:'<
select
all>',ReportParametersSelectAValueText:'<
select
a value>',ReportParametersInvalidValueText:'Invalid value.',ReportParametersNoValueText:'Value required.',ReportParametersNullText:'NULL',ReportParametersPreviewButtonText:'Preview',ReportParametersFalseValueLabel:'False',ReportParametersInputDataError:'Please input data for all parameters.',ReportParametersTrueValueLabel:'True',ZoomToPageWidth:'Page Width',ZoomToWholePage:'Full Page'}, '6_ReportViewerControl_ReportArea_ReportArea', '6_ReportViewerControl_ReportArea_SplitterCell', '6_ReportViewerControl_ReportArea_DocumentMapCell', true, true, 'PDF');
this will fail because you can't create a var in javascript starting with an integer! The generation of the int instead of the ctl is due that the WebForm Control doesn't have a parent Page (as I rendered it thourght html.RenderPartial)
I could put it in the master page and everything will work but I wanted to load each report in Ajax. That's why the reportViewer is in a ViewUserControl and would get called when the user selects a diferent report! Is there any way to prefix the ID ? Or to ban numbers from appearing in the ID?
A better solution would be that the ReportViewer object would be able to change the report through a Javascript method! That will make things much more easier!
what is the right approach? I know that in .NET 4 you can fix the ID to be static but telerik framework is counting on that ID beeing generated on a parent basis and I get some errors as well!
any help would be really apreciated!
regards,
jose