Skip to content

Instantly share code, notes, and snippets.

Avatar

Lohith lohithgn

View GitHub Profile
View RadHtmlChart.aspx
<telerik:RadHtmlChart runat="server" Width="800px" Height="500px">
<Appearance>
<FillStyle BackgroundColor="LightGray" />
</Appearance>
<ChartTitle Text="Server CPU Load By Days">
<Appearance Align="Center" BackgroundColor="White"
Position="Top" />
</ChartTitle>
<Legend>
<Appearance BackgroundColor="White" Position="Bottom" />
@lohithgn
lohithgn / StagingDB.Contacts.SQL
Created Nov 4, 2012
Reporting - Staging DB - Contacts Table
View StagingDB.Contacts.SQL
CREATE TABLE [dbo].[contacts]
(
[Id] [int] IDENTITY(1,1) NOT NULL,
[Name] [varchar](50) NOT NULL,
CONSTRAINT [PK_contacts] PRIMARY KEY CLUSTERED
(
[Id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
@lohithgn
lohithgn / gist:4012989
Created Nov 4, 2012
ReportSource as UriReportSource
View gist:4012989
var uriReportSource = new UriReportSource();
uriReportSource.Uri = "<URI of .TRDX file>";
reportViewer.ReportSource = uriReportSource;
reportViewer.RefreshReport();
@lohithgn
lohithgn / gist:4013016
Created Nov 4, 2012
.TRDX content as XML
View gist:4013016
<?xml version="1.0" encoding="utf-8"?>
<Report DataSourceName="ReportDataSource" Width="6.45833333333333in" Name="DemoReport" xmlns="http://schemas.telerik.com/reporting/2012/2">
<DataSources>
<SqlDataSource ConnectionString="stagingdb1" SelectCommand="select * from contacts" Name="ReportDataSource" />
</DataSources>
<Items>
<PageHeaderSection Height="0.28125in" Name="pageHeader">
<Items>
<TextBox Value="DemoReport" Size="6.41666666666667in, 0.200000027815501in" Location="0.0208333333333333in, 0.0208333333333333in" Name="reportNameTextBox" StyleName="PageInfo" />
</Items>
@lohithgn
lohithgn / gist:4013046
Created Nov 4, 2012
XmlReportSource as ReportSource
View gist:4013046
XmlReportSource xmlReportSource = new XmlReportSource();
xmlReportSource.Xml = "<Contents of .TRDX file>";
reportViewer.ReportSource = xmlReportSource;
reportViewer.RefreshReport();
@lohithgn
lohithgn / gist:4013144
Created Nov 4, 2012
Report XML Serializer
View gist:4013144
XmlReaderSettings settings = new XmlReaderSettings();
settings.IgnoreWhitespace = true;
using (XmlReader xmlReader = XmlReader.Create(<.TRDX URI or .TRDX XML Content>, settings))
{
Telerik.Reporting.XmlSerialization.ReportXmlSerializer xmlSerializer =
new Telerik.Reporting.XmlSerialization.ReportXmlSerializer();
Telerik.Reporting.Report report = (Telerik.Reporting.Report)xmlSerializer.Deserialize(xmlReader);
(report.DataSource as SqlDataSource).ConnectionString = "<Connection String OR Connection String Name>";
reportViewer.Report = report;
reportViewer.RefreshReport();
@lohithgn
lohithgn / gist:4225547
Created Dec 6, 2012
Charting Example using Kendo UI ASP.NET MVC Wrapper
View gist:4225547
@(Html.Kendo().Chart()
.Name("Chart1")
.Title("Internet Users")
.Legend(configurator =>
{
configurator.Position(ChartLegendPosition.Right);
})
.Series(series =>
{
series.Column(chartData);
@lohithgn
lohithgn / Html5TextBox.cs
Last active Dec 12, 2015
Custom Web Control - HTML5 TextBox control for adding placeholder support
View Html5TextBox.cs
[DefaultProperty("Text")]
[ToolboxData("<{0}:Html5TextBox runat=server></{0}:Html5TextBox>")]
public class Html5TextBox : TextBox
{
string _placeholder = "enter value";
[Bindable(true)]
[Category("Appearance")]
[DefaultValue("enter value")]
[Localizable(true)]
@lohithgn
lohithgn / html5placeholder.html
Last active Dec 12, 2015
html5 place holder attribute example
View html5placeholder.html
<input type=”text”
name=”txtFirstName” id=”txtFirstName”
placeholder=”enter first name” />
@lohithgn
lohithgn / customcontrol1.cs
Created Feb 3, 2013
custom control class example
View customcontrol1.cs
[DefaultProperty("Text")]
[ToolboxData("<{0}:Html5TextBox runat=server></{0}:Html5TextBox>")]
public class Html5TextBox : TextBox
{
}