Telerik Forums
Reporting Forum
2 answers
362 views

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

Costin Morariu
Top achievements
Rank 1
 answered on 25 Mar 2011
1 answer
146 views

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

Hrisi
Telerik team
 answered on 25 Mar 2011
2 answers
182 views
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:

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


Jose Granja
Top achievements
Rank 1
 answered on 25 Mar 2011
3 answers
283 views
Is there any way to detect that you are in preview mode in code behind file?

What I really want to do is set the DataSource = null in the report class constructor in run-time (so that the NeedDataSource event runs).  But in preview I would like to use the default data source.  Right now I have to comment / uncomment code to achieve this.

I thought I could put an "if in design mode" similar to the following, but wondered if there is a way to detect this in the code?

if (GetIsInDesignerPreviewMode(this))
            this.DataSource = null;

Thanks for your feedback and recommendations.
Zawer
Top achievements
Rank 1
 answered on 25 Mar 2011
1 answer
185 views
I've got a Report, and it passes a parameter to another report using the Navigate to Report action.

How do I specify a Label?

For instance my value is  Field.[Category ID]  , but my label is Field.[Category Description]

This is being used with a cross tab wizard consuming a cubedatasource.
Blasty
Top achievements
Rank 1
 answered on 25 Mar 2011
0 answers
147 views
Good Day All

I have a Silverlight App that uses Telerik Reports. I can see my report. basicaly my report display a Barcode and i get the Barcode generated Value from the Database and i filter the Data. i am using SQLDatasource and i have a stored Procedure that is defined like this

CREATE PROCEDURE sp_GetReportbarcode
(
@KIDID INT
)
AS
SELECT  TEMP_BARCODE  
FROM KIDS_DETAILS
WHERE KIDID = @KIDID


and i am passing a Parameter from my silverlight page like this

KidsModelExtended selectedkid = lstkids.SelectedItem as KidsModelExtended;
if (selectedkid != null)
{
    int Kidid = selectedkid.iKidid;
    args.ParameterValues["KIDID"] = Kidid;
}
i  have debugged the code and it does and pass the Correct value to the parameter , but when i run my app, i only see a header of the Report not a barcode because it seems like the value has not been passed as depicted in the Screenshot. So to see if the SQlDatasource Control was configured correctly , i passed a value on the parameter on the control and i ran it and it brought me a barcode as depicted below.

Thanks







Vuyiswa
Top achievements
Rank 2
 asked on 25 Mar 2011
2 answers
347 views

I upgrade to q1 2011 and get this error

Compilation 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:

Line 208:        
Line 209:        [System.Diagnostics.DebuggerNonUserCodeAttribute()]
Line 210: private global::Telerik.ReportViewer.WebForms.ReportViewer @__BuildControlReportViewer1() {Line 211:            global::Telerik.ReportViewer.WebForms.ReportViewer @__ctrl;
Line 212:         

mshooot
Top achievements
Rank 1
 answered on 25 Mar 2011
0 answers
136 views
When i am trying to create a subreport, it is starting from next page instead of the first page even though i have enough space on the first page.
Is there any property or setting which would allow the subreport to continue from same page?
Saurabh Nandu
Top achievements
Rank 1
 asked on 25 Mar 2011
0 answers
164 views
Hi,
Im new to telerik.reporting
and im trying to load my dataset and binding in report, but im not able to see any data in viewer.. these are the below steps im doing..

.aspx page

 <telerik:ReportViewer Width="100%" Height="100%" ID="ReportViewer1" runat="server" ></telerik:ReportViewer>

.aspx.cs

protected void Page_Load(object sender, EventArgs e)
        {
            Telerik.Reporting.Report report1 = new Telerik.Reporting.Report();
            report1.DataSource = GetDataset();
            ReportViewer1.Report = report1;            
        }

        private DataTable GetDataset()
        {
            DataSet ds = new DataSet();
            DataTable dt = new DataTable();
            DataRow dr;

            DataColumn id = new DataColumn("ID");
            DataColumn name = new DataColumn("Name");
            dt.Columns.Add(id);
            dt.Columns.Add(name);
            dr = dt.NewRow();
            dr["ID"] = 1;
            dr["Name"] = "Jeyaraman";
            dt.Rows.Add(dr);
            dr = dt.NewRow();
            dr["ID"] = 2;
            dr["Name"] = "Axiom";
            dt.Rows.Add(dr);

            ds.Tables.Add(dt);
            return dt;
        }

Plz guide me to fix the issue...

Thanks in advance
Jeyaraman.S
jai
Top achievements
Rank 1
 asked on 24 Mar 2011
2 answers
1.2K+ views
Hi,
I have a stored procedure that is creating a temp table to get data from, temp table is required because of some complex logic with different tables involved in data fetch.
I am having a probem of no columns listed in data view on design time, while using wizard after fetching data in sqldatasource.
When trying to build a datasource using the stored procedure, After successfuly fetching data in data source and finishing fetch process when wizard try to start report design steps, I get error as
http://screencast.com/t/lG0QjXLZ
Error Message: 'Invalid object name '#temptablename'.'
In order to design report (drag and drop to work properly in the report design), I need the data view to show all the columns return by stored procedure to show the columns currently it does not because it obviously does not understand temp tables.
I don't know but once data is returned by the stored procedure, should not it cache that data for design?
OR else i have to create some real tables for design time support (it will require a lot of overhead work as i have to change so many stored procedures) and once report designing is done and use temp for run-time only?

Regards
Richard
Top achievements
Rank 1
 answered on 24 Mar 2011
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?