<%
@ Control Language="C#" AutoEventWireup="true" CodeBehind="TelerikReportViewer.ascx.cs"
Inherits="ArchG2.Portal.rg2SupportingControls.Misc.TelerikReportViewer" %>
<%
@ Register Assembly="Telerik.ReportViewer.WebForms, Version=3.0.9.430, Culture=neutral, PublicKeyToken=a9d7983dfcc261be"
Namespace="Telerik.ReportViewer.WebForms" TagPrefix="telerik" %>
<
asp:HiddenField ID="hdnExplicitHeight" runat="server" Value="0" />
<
div id="telerikViewer">
<telerik:ReportViewer ID="rptvw" runat="server" Height="300px" Width="100%"
oninit="rptvw_Init">
</telerik:ReportViewer>
</
div>
So I override the oninit and start exploring with debugger:
protected void rptvw_Init(object sender, EventArgs e)
{
string flag = "";
try
{
// find the toolbar
flag =
"locate_toolbar";
Control ctlToolbar = rptvw.FindControl("ReportToolbar");
if (ctlToolbar == null) throw new ApplicationException("No toolbar; new Telerik version?");
// this is reverse engineered from telerik; might work
flag =
"create_controls";
Table tblHeight = new Table();
tblHeight.ID =
"PageHeight";
tblHeight.CssClass =
"ReportToolbarGroup";
Abr.CodeLibrary.Utils.
Global.MergeCssStyleAttributes(tblHeight.Attributes, "float:left;");
tblHeight.CellPadding = 0;
tblHeight.CellSpacing = 0;
TableRow rowHeight = new TableRow();
rowHeight.ID =
"row";
TableCell cellHeight = new TableCell();
cellHeight.ID =
"cell";
Label lblHeight = new Label();
lblHeight.ID =
"lblHeight";
lblHeight.AssociatedControlID =
"txtHeight";
lblHeight.Text =
"Height: ";
_txtHeight =
new TextBox();
_txtHeight.ID =
"txtHeight";
_txtHeight.Width =
Unit.Parse("5em");
LinkButton btnResize = new LinkButton();
btnResize.ID =
"btnResize";
btnResize.Text =
"Resize";
btnResize.Click +=
new EventHandler(btnResize_Click);
flag =
"add_controls";
cellHeight.Controls.Add(lblHeight);
cellHeight.Controls.Add(_txtHeight);
cellHeight.Controls.Add(btnResize);
rowHeight.Cells.Add(cellHeight);
tblHeight.Rows.Add(rowHeight);
ctlToolbar.Controls.Add(tblHeight);
}
catch (Exception ex)
{
LH.error(
"Problem at ", flag, ": ", ex);
NotifyError(
"Report: " + ex.Message);
}
//try
}
Reflection at first told me that the first child of the ReportToolbar control is of type Telerik.ReportViewer.WebForms.PageNavigationGroup. Too bad that type is not directly supported--it must be a private class. So I instead use good old F12 in the IE browser to turn on Dev Toolbar and take a peek at what Telerik actually generated, which was this:
<table class="ReportToolbarGroup" id="ctl_rptvw_ReportToolbar_NavGr" style="float: left;" cellSpacing="0" cellPadding="0">
Ah, says I, if they can generate a table then I can too! Which led to the code above and a LinkButton. (I could not use a regular Button, *someone* <ahem> put a style of "visible: false !important" on the generated input control. But the LinkButton works great, I get notified, I can respond to requested height changes and Bob's Yer Unkl.
In my btnResize_Click event, I simply set the Height of the wrapped report control (which, btw, I load dynamically from an ASCX property name hyuck hyuck) and I get the effect I want.
Score: 1 for us, zero for them.
(Telerik.ReportViewer.WebForms, Version=3.0.9.430, )
Its working fine in my lacol system but when i upload into server domain
it will through some error
http://www.isms.shreema.com/incidents.aspx
Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.
Parser Error Message: Could not load file or assembly 'Telerik.ReportViewer.WebForms, Version=3.0.9.430, Culture=neutral, PublicKeyToken=a9d7983dfcc261be' or one of its dependencies. The system cannot find the file specified.
Source Error:
|
My remote server(web hosters) allowed only in frame work 2.0 because when i upload all .cs files into remote server
i got one error in following namespace(its not supported)
using
System.Linq;
using
System.Xml.Linq;
So i removed that two namspace but i have problem in report viewer how to solve taht version problem
Regards
Abdul
4-Jan-2009 | 0 |
7-Jan-2009 | 3 |
9-Jan-2009 | 2 |
10-Jan-2009 | 1 |