Hi,
I am trying to use subreports in the following way: a parent report contains A LIST and for every item in the list I would like to show a subreport.
This is parent report list load:
public
void
ReportNeedDataSource(
object
sender, System.EventArgs e)
{
DataSource = applicationReport;
if
((applicationReport !=
null
) && (applicationReport.Questionaire !=
null
))
{
stepsList.DataSource = applicationReport.Questionaire.Steps;
}
}
And in the subreport NeedDataSource event handler, I would like to get list item object since it is called for every stepList.DataSource item for filling some subreport fields.
What would be the best aproach to accomplish this?
Best regards,
Costin
Hello!
Is is possible to pass a variable into a userfunction, when not using Reportparameters that have been setup inside the Design mode?
Right now I am passing parameters from the associated webpage via a sqldatasource all set up programatically on the aspx page, and that part works fine. But now I would like to send variables into userfunctions located inside the code behind page for the report. Still not using the design mode, but all should be via programming.
web aspx page:
Dim sqlDataSource1 As New SqlDataSource()
sqlDataSource1.ProviderName = "System.Data.SqlClient"
sqlDataSource1.ConnectionString = "Data Source= etc"
sqlDataSource1.SelectCommand = strSQL
Dim parFakturaNrStart As New Telerik.Reporting.Parameter()
parFakturaNrStart.Value = "112112"
sqlDataSource1.Parameters.Add("@parFakturaNrStart", DbType.String, parFakturaNrStart.Value)
Dim parFakturaNrEnd As New Telerik.Reporting.Parameter()
parFakturaNrEnd.Value = "112312"
sqlDataSource1.Parameters.Add("@parFakturaNrEnd", DbType.String, parFakturaNrEnd.Value)
Me.ReportViewer1.Report = New basic_report
Dim report As Telerik.Reporting.Report = DirectCast(Me.ReportViewer1.Report, Telerik.Reporting.Report)
report.DataSource = sqlDataSource1
' code here to send to the userfunction
This part takes care of the main report itself and works just fine. That is, the main report renders on the webpage without a problem.
But what do I have to do on the aspx page and/or reports code behind page, in order to send variables or a "parameter" to be picked up by the User function in its Expression?
Inside Edit Expression dialog:
{MyTelerikReportsClassLib.basic_report.getAllInvoicesInSelectionForDisplay(outgoing_variable1, outgoing_variable2)}
Report code behind page:
Function getAllInvoicesInSelectionForDisplay(incoming_variable_here1 as string, incoming_variable_here2 as string )
' further code here
' actually another SQL query to output its result at the end of this function
Return something
End Function
Please advise how to do this.
Best regards
Lars
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');
CREATE
PROCEDURE
sp_GetReportbarcode
(
@KIDID
INT
)
AS
SELECT
TEMP_BARCODE
FROM
KIDS_DETAILS
WHERE
KIDID = @KIDID
KidsModelExtended selectedkid = lstkids.SelectedItem
as
KidsModelExtended;
if
(selectedkid !=
null
)
{
int
Kidid = selectedkid.iKidid;
args.ParameterValues[
"KIDID"
] = Kidid;
}
I upgrade to q1 2011 and get this error
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.
Compiler Error Message: CS0433: The type 'Telerik.ReportViewer.WebForms.ReportViewer' exists in both 'c:\WINDOWS\assembly\GAC_MSIL\Telerik.ReportViewer.WebForms\5.0.11.316__a9d7983dfcc261be\Telerik.ReportViewer.WebForms.dll' and 'c:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\42723e18\d4dd882e\assembly\dl3\59e46166\76f760b8_fde0cb01\Telerik.ReportViewer.WebForms.DLL'
Source Error:
|