Skip to content

Instantly share code, notes, and snippets.

View lohithgn's full-sized avatar

Lohith lohithgn

View GitHub Profile
<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 November 4, 2012 16:59
Reporting - Staging DB - Contacts Table
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 November 4, 2012 18:42
ReportSource as UriReportSource
var uriReportSource = new UriReportSource();
uriReportSource.Uri = "<URI of .TRDX file>";
reportViewer.ReportSource = uriReportSource;
reportViewer.RefreshReport();
@lohithgn
lohithgn / gist:4013016
Created November 4, 2012 18:47
.TRDX content as XML
<?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 November 4, 2012 18:53
XmlReportSource as ReportSource
XmlReportSource xmlReportSource = new XmlReportSource();
xmlReportSource.Xml = "<Contents of .TRDX file>";
reportViewer.ReportSource = xmlReportSource;
reportViewer.RefreshReport();
@lohithgn
lohithgn / gist:4013144
Created November 4, 2012 19:11
Report XML Serializer
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 December 6, 2012 15:55
Charting Example using Kendo UI ASP.NET MVC Wrapper
@(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 December 12, 2015 02:48
Custom Web Control - HTML5 TextBox control for adding placeholder support
[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 December 12, 2015 02:48
html5 place holder attribute example
<input type=”text”
name=”txtFirstName” id=”txtFirstName”
placeholder=”enter first name” />
@lohithgn
lohithgn / customcontrol1.cs
Created February 3, 2013 11:33
custom control class example
[DefaultProperty("Text")]
[ToolboxData("<{0}:Html5TextBox runat=server></{0}:Html5TextBox>")]
public class Html5TextBox : TextBox
{
}