Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
291 views
I have a fairly simple page where a user selects report parameters, clicks a button, then a Report Viewer is displayed(visible=false on page load)...

I get this error after the user clicks the button:

Microsoft JScript runtime error: Sys.InvalidOperationException: Could not find UpdatePanel with ID 'ctl00_ctl00_MainContent_ReportMainContent_ReportViewer1_ReportViewer'. If it is being updated dynamically then it must be inside another UpdatePanel.

I know it has to do with the Report Viewer being invisible at first, but I'm not sure how to use RadAjax and still hide the Report Viewer until I am ready to use it?  Below is the HTML and code behind for the button click.

Environment
Windows 7
Visual Studio 2010
ASP.NET 4.0
Latest Build for Telerik Controls(2011.1.413.40)
IE 8

thanks

mark

HTML

<P><%@ Page Title="" Language="C#" 
MasterPageFile="~/Modules/Reports/ReportMasterPage.master"<BR>    
AutoEventWireup="true" CodeBehind="AnalystBreakdownList.aspx.cs" 
Inherits="CreativeAffairsWebApp.Modules.Reports.AnalystBreakdownList" %></P>
<P><%@ Register Assembly="Microsoft.ReportViewer.WebForms, Version=10.0.0.0, 
Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"<BR>    
Namespace="Microsoft.Reporting.WebForms" TagPrefix="rsweb" 
%><BR><asp:Content ID="Content1" ContentPlaceHolderID="ReportHeadContent" 
runat="server"><BR></asp:Content><BR><asp:Content ID="Content2" 
ContentPlaceHolderID="ReportMainContent" 
runat="server"><BR>    <telerik:RadAjaxPanel 
ID="RadAjaxPanel1" runat="server" LoadingPanelID="RadAjaxLoadingPanel1" 
Width="100%"><BR>        <table 
style="width: 100%;" 
class="form"><BR>            
<tr><BR>                
<td><BR>                    
<table border="0" cellpadding="0" 
cellspacing="0"><BR>                        
<tr><BR>                            
<td><BR>                                
<asp:Label ID="Label1" runat="server" Text="As Of Date:" 
CssClass="formLabel"></asp:Label><BR>                                
<telerik:RadDatePicker ID="txtReportDate" 
runat="server"><BR>                                    
<Calendar Skin="WebBlue" UseColumnHeadersAsSelectors="False" runat="server" 
UseRowHeadersAsSelectors="False"<BR>                                        
ViewSelectorText="x"><BR>                                    
</Calendar><BR>                                    
<DateInput runat="server" DateFormat="M/d/yyyy" 
DisplayDateFormat="M/d/yyyy"><BR>                                    
</DateInput><BR>                                    
<DatePopupButton HoverImageUrl="" ImageUrl="" 
/><BR>                                
</telerik:RadDatePicker><BR>                            
</td><BR>                            
<td><BR>                                
&nbsp;&nbsp;&nbsp;&nbsp;<BR>                                
<telerik:RadButton ID="RadButton1" runat="server" Text="Run Report" 
OnClick="Button1_Click"><BR>                                
</telerik:RadButton><BR>                            
</td><BR>                        
</tr><BR>                    
</table><BR>                    
<br 
/><BR>                
</td><BR>            
</tr><BR>        
</table><BR>        <table 
width="100%"><BR>                
<tr><BR>                    
<td 
class="style1"><BR>                        
<asp:Panel ID="reportPanel" runat="server" 
Visible="false"><BR>                            
<rsweb:ReportViewer ID="ReportViewer1" runat="server" Width="100%" 
Height="600px"<BR>                                
PageCountMode="Actual" ShowParameterPrompts="False" 
BackColor="White"><BR>                            
</rsweb:ReportViewer><BR>                        
</asp:Panel><BR>                        
<BR>                    
<BR>                    
</td><BR>                
</tr><BR>            
</table><BR>    
</telerik:RadAjaxPanel><BR>        
<BR>    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" 
runat="server" Skin="Default"><BR>    
</telerik:RadAjaxLoadingPanel><BR>    
<BR></asp:Content></P>

Code behind for button click:

 

<P>protected void Button1_Click(object sender, EventArgs 
e)<BR>        
{<BR>            
ReportViewer1.ProcessingMode = 
ProcessingMode.Remote;<BR>                        
<BR>            
ReportViewer1.ServerReport.ReportServerUrl = new 
Uri(ReportUtils.GetReportServerURL());<BR>            
ReportViewer1.ServerReport.ReportPath = 
ReportUtils.GetReportPath("AnalystBreakdownList");</P>
<P>            
ReportParameterCollection par = new 
ReportParameterCollection();<BR>            
ReportParameter username = new ReportParameter("UserName"
Utils.SessionValues.GetLoggedUserName());<BR>            
par.Add(username);</P>
<P>            
ReportParameter asOfDate = new ReportParameter("AsOfDate"
txtReportDate.SelectedDate.ToString());<BR>            
par.Add(asOfDate);</P>
<P>            
ReportViewer1.ServerReport.SetParameters(par);</P>
<P>            
reportPanel.Visible = 
true;<BR>            
//ReportViewer1.Visible = true;</P>
<P>            
ReportViewer1.ServerReport.Refresh();<BR>        
}</P>


Maria Ilieva
Telerik team
 answered on 09 May 2011
1 answer
76 views
Hi.

I am using file explorer in my app.
file explorer cntrl desgin  is nt showing properly while loading the page.once i click upload and close immedietly then desgin s cmng properly.

Do i need to set any property?Please help me out.
i am trying from morng..

Thanks
Bhavani
Dobromir
Telerik team
 answered on 09 May 2011
3 answers
1.0K+ views
Hello,

I have a RadGrid which has GridNumericColumns declared like this:

<telerik:GridNumericColumn DataField="Feb" DataType="System.Int32"
 HeaderText="Feb" DecimalDigits="0" EditFormColumnIndex="0"
 SortExpression="Feb" UniqueName="Feb" FilterControlWidth="50px"   >
<HeaderStyle Width="80px" />
</telerik:GridNumericColumn>
 
It displays perfectly when in edit mode. It adds thousand separator. But, when Grid is in View mode, then it shows numeric value without thousand separator.

Is there quick and easy way to show thousand separator when grid is in view mode?

The same question would be for displaying numeric values in Chart series and axis when using Telerik.Reporting

Thanks
Tadas
Tadas
Top achievements
Rank 1
 answered on 09 May 2011
1 answer
136 views
in that i'm using radtabstrip.
using 6 tabs.one of the tab's radgrid

if the radgrid saved anything i'm going to getting the value id from that ragrid .
how't possible

Thanks,
Mohamed
Mira
Telerik team
 answered on 09 May 2011
5 answers
213 views
I am new to RadCharts so hopefully there's a simple answer to this. After pro grammatically creating a bar chart and binding it to a datasource as below, if the series has too many items all of my labels are disappearing. Why is this happening and how do I correct it?

Correct Chart with less items screenshot
Incorrect Chart with too many items

Html code for the chart
            <telerik:RadChart ID="RadChart1" runat="server" Height="550px"
                SeriesOrientation="Horizontal" Width="900px" Skin="DeepBlue"
                IntelligentLabelsEnabled="True">
                <Appearance>
                    <FillStyle FillType="ComplexGradient">
                        <FillSettings>
                            <ComplexGradient>
                                <telerik:GradientElement Color="26, 120, 179" />
                                <telerik:GradientElement Color="35, 189, 254" Position="0.5" />
                                <telerik:GradientElement Color="26, 120, 179" Position="1" />
                            </ComplexGradient>
                        </FillSettings>
                    </FillStyle>
                    <Border Color="0, 66, 110" Width="5" />
                </Appearance>
 
                <Legend>
                    <Appearance Dimensions-Margins="1px, 2%, 12%, 1px"
                        Position-AlignedPosition="BottomLeft" Position-Auto="False" Position-X="5"
                        Position-Y="500">
                        <ItemAppearance>
                            <FillStyle FillType="Solid" MainColor="Transparent">
                            </FillStyle>
                        </ItemAppearance>
                        <ItemTextAppearance TextProperties-Color="White">
                        </ItemTextAppearance>
                        <FillStyle GammaCorrection="False" MainColor="Transparent">
                        </FillStyle>
                        <Border Color="76, 255, 255, 255" />
                    </Appearance>
                    <TextBlock Visible="True">
                        <Appearance Position-AlignedPosition="BottomLeft"
                            TextProperties-Color="LightSkyBlue">
                            <FillStyle MainColor="Transparent" FillType="Solid">
                            </FillStyle>
                        </Appearance>
                    </TextBlock>
                </Legend>
                <PlotArea>
                    <EmptySeriesMessage Visible="True">
                        <Appearance Visible="True">
                        </Appearance>
                        <TextBlock Visible="true" Text="No Therapeutic Areas Discussed">
                        </TextBlock>
                    </EmptySeriesMessage>
                    <XAxis>
                        <Appearance Color="98, 183, 226" MajorTick-Color="98, 183, 226">
                            <MajorGridLines Color="98, 183, 226" Width="0" />
                            <TextAppearance TextProperties-Color="White">
                            </TextAppearance>
                        </Appearance>
                        <AxisLabel>
                            <Appearance Position-Auto="false" Position-X="750"
                                Position-Y="605" Dimensions-Paddings="1px, 1px, 10%, 1px"
                                RotationAngle="270">
                            </Appearance>
                            <TextBlock Text="Percentage of Surveys" Visible="true">
                                <Appearance TextProperties-Color="LightSkyBlue">
                                </Appearance>
                            </TextBlock>
                        </AxisLabel>
                    </XAxis>
                    <YAxis AutoScale="False" MaxItemsCount="10" MaxValue="100" MinValue="0"
                        Step="10" Visible="False">
                        <Appearance Color="98, 183, 226" MajorTick-Color="98, 183, 226"
                            MinorTick-Color="98, 183, 226">
                            <MajorGridLines Color="120, 209, 248" />
                            <MinorGridLines Color="120, 209, 248" Width="0" />
                            <LabelAppearance Dimensions-AutoSize="False" Dimensions-Height="0px" Position-AlignedPosition="Right"
                                Dimensions-Width="0px">
                            </LabelAppearance>
                            <TextAppearance TextProperties-Color="White">
                            </TextAppearance>
                        </Appearance>
                        <AxisLabel Visible="True">
                            <Appearance Visible="True" RotationAngle="0">
                            </Appearance>
                            <TextBlock>
                                <Appearance TextProperties-Color="LightSkyBlue" Dimensions-AutoSize="False"
                                    Dimensions-Height="16px" Dimensions-Width="160px" AutoTextWrap="False">
                                </Appearance>
                            </TextBlock>
                        </AxisLabel>
                        <Items>
                            <telerik:ChartAxisItem>
                            </telerik:ChartAxisItem>
                            <telerik:ChartAxisItem Value="10">
                            </telerik:ChartAxisItem>
                            <telerik:ChartAxisItem Value="20">
                            </telerik:ChartAxisItem>
                            <telerik:ChartAxisItem Value="30">
                            </telerik:ChartAxisItem>
                            <telerik:ChartAxisItem Value="40">
                            </telerik:ChartAxisItem>
                            <telerik:ChartAxisItem Value="50">
                            </telerik:ChartAxisItem>
                            <telerik:ChartAxisItem Value="60">
                            </telerik:ChartAxisItem>
                            <telerik:ChartAxisItem Value="70">
                            </telerik:ChartAxisItem>
                            <telerik:ChartAxisItem Value="80">
                            </telerik:ChartAxisItem>
                            <telerik:ChartAxisItem Value="90">
                            </telerik:ChartAxisItem>
                            <telerik:ChartAxisItem Value="100">
                            </telerik:ChartAxisItem>
                        </Items>
                    </YAxis>
 
<YAxis2>
<AxisLabel>
<Appearance RotationAngle="0"></Appearance>
</AxisLabel>
</YAxis2>
 
                    <Appearance Dimensions-Margins="19%, 90px, 12%, 25%"
                        Corners="Rectangle, Rectangle, Rectangle, Rectangle, 5"
                        Position-Auto="False" Position-X="225" Position-Y="104.5">
                        <FillStyle MainColor="50, 255, 255, 255" SecondColor="Transparent">
                        </FillStyle>
                        <Border Color="97, 180, 223" />
                    </Appearance>
                </PlotArea>
                <ChartTitle>
                    <Appearance Dimensions-Margins="4%, 10px, 14px, 6%">
                        <FillStyle MainColor="">
                        </FillStyle>
                    </Appearance>
                    <TextBlock Text="">
                        <Appearance TextProperties-Color="White" TextProperties-Font="Verdana, 14pt">
                        </Appearance>
                    </TextBlock>
                </ChartTitle>
            </telerik:RadChart>


C# code to build the chart from a sqldatareader
string strNValue = Convert.ToString(prmNValue.Value);
SqlDataReader dr = cmd.ExecuteReader();
 
RadChart1.PlotArea.XAxis.DataLabelsColumn = "TherapArea";
 
RadChart1.DataSource = dr;
RadChart1.DataBind();
 
RadChart1.Visible = true;
 
RadChart1.PlotArea.YAxis.AxisLabel.Visible = true;
RadChart1.PlotArea.XAxis.AxisLabel.Visible = true;
RadChart1.PlotArea.YAxis.AxisLabel.TextBlock.Text = "Percentage of Surveys";
 
string strLegend = strManufacturer + " (n=" + strNValue + ")";
RadChart1.Legend.TextBlock.Text = strLegend;
 
RadChart1.Series[0].DefaultLabelValue = "#Y%";
 
dr.Close();
Evgenia
Telerik team
 answered on 09 May 2011
2 answers
155 views
Hi,

So I had Radgrid on my page full with data, then I am using Export to Excel method from Radgrid to generate excel file.
Then I save that file TestExcel.xsl on my computer.

The problem is : After that I am trying to open that saved excel file using connection, with that below, then it fires for exception.

_objXConn.ConnectionString = String.Format( _

"Provider=Microsoft.Jet.OLEDB.4.0;Data Source={0};Extended Properties=""Excel 8.0;HDR=Yes;IMEX=1""", _fullFilePath)

 

Exception:

 System.Data.OleDb.OleDbException: External table is not in the expected format.

There is no issue with the code when i try to open some other excel files with that connection.
Why is this happening? Can you help me?

Em4o
Top achievements
Rank 2
 answered on 09 May 2011
7 answers
1.6K+ views
Hi Guys,
Getting an error when I try to get control of radgrid edit template text box in code behind. I want to make edit template textbox  "visible = false"  when insert click(Add new record). Anybody can help me?

protected void ItemCommand(object sender, GridCommandEventArgs e)
        {
            if (e.CommandName == RadGrid.InitInsertCommandName)
            {
                (this.Page.FindControl("txtOpcode") as RadTextBox).Visible = false;
                //(RadGrid1.MasterTableView.FindControl("txtOpcode") as RadTextBox).Visible = false;                
            }

Error: Sys.WebForms.PageRequestManagerServerErrorException: Object reference not set to an instance of an object.

Shinu
Top achievements
Rank 2
 answered on 09 May 2011
3 answers
94 views
Telerik Support,

There is a problem to display Radeditor tool bar on my application, please check out the attachment. The thing is it doesn't happen all the time, only sometimes.

It really drives me crazy.

Please help

Alan
Dobromir
Telerik team
 answered on 09 May 2011
1 answer
132 views
Hi,

I have created visual web part using telerik control and i deploy it to SharePoint site. Then its raise error cant find telerik assemblies. So i copy telerik dll to SharePoint bin folder. But then its raise security issue. How can i fix it?


krds
lakmal
Stanimir
Telerik team
 answered on 09 May 2011
11 answers
235 views
Hi,

since there is absolutely no documentation about RadFileExplorer I have to ask the question here.

First of all - NO documentation means really NO.
I'm used from Silverlight that some controls are not describe in the "Controls" section of the help.
But at least there is help (even tho it is just "automatically generated content" in the class references).
But here I find nothing at all.

Anyhow - from the properties I found an event

OnItemCommand


But it seems as if this event is never fired.
My approach is to give the user a browser - after he selects a file I decide if this file should be downloaded, edited with a RadEditor or...

The Idea was - I handle the OnItemCommand.
And I guessed there is a "CommandName==Open" or something like this.
So the idea was:
....OnItemCommand(....) {
if(e.CommandName=="Open")    {
    if(IsFileEditable(e.Path))    {
      string strContent=ReadFile(e.Path);
      RadEditor1.Content=strContent.
      RadFileExplorer1.Visible=false;
      RadEditor1.Visible=true;
      SaveButton.Visible=true;
      CancelButton.Visible=true;
}
.....
BUT - the OnItemCommand handler never get's fired - and due to the missing documentation I have no idea how to solve this.

And YES I have seen the "FileExplorer" sample.
BUT: the things get handled on the client - I need them on the server.
AND: exactly the thing where the FileExplorer comes to play is not visible since this is done in some other APSX file - and this file is not listed in the sample.
So all I could see there was a pages which calls a dialog and from this it get's (with some kind of magic :)) the filepath.

Regards

Manfred
Dobromir
Telerik team
 answered on 09 May 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Cynthia
Top achievements
Rank 1
Iron
Toby
Top achievements
Rank 3
Iron
Iron
Iron
Danielle
Top achievements
Rank 1
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Iron
yw
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Cynthia
Top achievements
Rank 1
Iron
Toby
Top achievements
Rank 3
Iron
Iron
Iron
Danielle
Top achievements
Rank 1
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Iron
yw
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?