Telerik Forums
Reporting Forum
2 answers
144 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
246 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
161 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
118 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
314 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
114 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
130 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.1K+ 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
1 answer
95 views
Hi,
I have HtmlTextBoxes in various areas in my reports/subreports and they show up rendered completely fine in the report viewer. However, when I export to PDF or RTF they show up as plain text with the markup visible. Is this just a limitation of this product or is there something I'm doing wrong. The text is just say wrapped in tags that your documentation says it's supposed to support (e.g., OL, LI, and EM).   I appreciate any help you can offer.
Thanks!
Steve
Telerik team
 answered on 24 Mar 2011
2 answers
92 views

Partial Public Class Example
    Inherits Telerik.Reporting.Report
    Public Sub New()
        InitializeComponent()

        init()
    End Sub

    Public Sub init()
        Dim dt As New DataTable
        dt.Columns.Add("index")
        dt.Columns.Add("premium")

        For i As Integer = 1 To 50
            Dim dr As DataRow
            dr = dt.NewRow
            dr.Item("index") = i.ToString
            dr.Item("premium") = i.ToString + "å…ƒ"
            dt.Rows.Add(dr)
        Next

        Crosstab1.DataSource = dt

        Dim filter1 As New Telerik.Reporting.Data.Filter()
        filter1.Expression = "= RowNumber() mod 5"
        filter1.Operator = Telerik.Reporting.Data.FilterOperator.Equal
        filter1.Value = "0"

        Dim item As New FormattingRule
        item.Filters.Add(filter1)
        item.Style.BackgroundColor = Color.Yellow

        TextBox4.ConditionalFormatting.Add(item)
    End Sub
End Class

1.According to the code ,my first question is why i set the datasource of Crosstab1,it only show the first row in the datatable?the datatable has 50 rows
2.My second question is why the ConditionalFormatting doesn't work on my reporting,i have already set the FormattingRule,but it still not work
Remark:I use telerik-2010-Q1 package

Please tell me how to do under telerik reporitng?or it's bugs?thank you!

Svetoslav
Telerik team
 answered on 24 Mar 2011
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?