Skip to content

Instantly share code, notes, and snippets.

View sAbakumoff's full-sized avatar

Sergey Abakumoff sAbakumoff

View GitHub Profile
static void ProcessReportComponent(IReportComponent component)
{
if (component == null)
return;
if (component is IReportComponentContainer)
{
var container = component as IReportComponentContainer;
foreach (var comp in container.Components)
{
ProcessReportComponent(comp as IReportComponent);
// introduce extension method:
public static class VieweExtensions
{
public static bool IsSidebarVisible(this Sidebar sidebar)
{
return
sidebar.ParametersPanel.Visible | sidebar.SearchPanel.Visible |
sidebar.ThumbnailsPanel.Visible | sidebar.TocPanel.Visible;
}
Sub ActiveReport_DataInitialize
rpt.fields.add("rptDate")
rpt.fields.add("rptTitle")
rpt.fields.add("header1")
rpt.fields.add("statedesc")
rpt.fields.add("cuname")
rpt.fields.add("camel")
rpt.fields.add("asinum")
rpt.fields.add("yearendshares")
rpt.fields.add("depositrequired")
Dim rowsCounter As Integer = 0
Dim dr as DataRow
Sub ActiveReport_FetchData(eof)
rpt.fields("rptDate").value = Now()
rpt.fields("rptTitle").value = "FOR " & asOfDate & " USING " & camel & " CAMEL SCORE"
'rpt.fields("header1").value = dataclass.GetParm("year") & " DEPOSIT"
rpt.fields("header1").value = "DEPOSIT"
If rowsCounter < ds.Tables(0).Rows.Count Then
eof = false
dr = ds.Tables(0).Rows.Item(rowsCounter)
SELECT Movie.MovieID, Movie.Title, Movie.Length, Movie.YearReleased, Movie.UserRating, Movie.MPAA, MoviePerson.MoviePersonID, MoviePerson.FirstName+" "+MoviePerson.LastName AS CastName, CrewTitle.CrewTitleID, CrewTitle.Title AS CrewTitle, Genre.GenreID, Genre.GenreName
FROM CrewTitle INNER JOIN ((Genre INNER JOIN (Movie INNER JOIN MovieGenres ON Movie.MovieID = MovieGenres.MovieID) ON Genre.GenreID = MovieGenres.GenreID) INNER JOIN (MoviePerson INNER JOIN MovieCrew ON MoviePerson.MoviePersonID = MovieCrew.CastID) ON Movie.MovieID = MovieCrew.MovieID) ON CrewTitle.CrewTitleID = MovieCrew.TitleID
WHERE (((Movie.MovieID)=[?]))
ORDER BY Movie.MovieID, MoviePerson.MoviePersonID, CrewTitle.CrewTitleID, Genre.GenreID;
var navigationBar = viewer1.Toolbar.NavigationBar;
navigationBar.Visible = false;
var items = navigationBar.Items.Cast<ToolStripItem>().ToList();
viewer1.Toolbar.MainBar.Items.AddRange(items.ToArray());
private void view_Click(object sender, EventArgs e)
{
var rpt = (GrapeCity.ActiveReports.PageReport)designer1.Report;
rpt.ConfigurationProvider = new DefaultConfigurationProvider();
var pageDocument = new GrapeCity.ActiveReports.Document.PageDocument(rpt);
this.viewer1.LoadDocument(pageDocument);
}
private void Form1_Load(object sender, EventArgs e)
{
var rpt = new PageReport(new FileInfo("report.rdlx"));
var doc = new PageDocument(rpt);
var xml = new XmlRenderingExtension();
var settings = new Settings {Encoding = "UTF-8"};
var streamProvider = new CustomStreamProvider(new DirectoryInfo("."), "report.xml");
doc.Render(xml, streamProvider, settings);
}
{"columns":[],"data":[],"stats":{"contains_updates":true,"nodes_created":14,"nodes_deleted":0,"properties_set":14,"relationships_created":14,"relationship_deleted":0,"labels_added":14,"labels_removed":0,"indexes_added":0,"indexes_removed":0,"constraints_added":0,"constraints_removed":0},"plan":{"root":{"operatorType":"EmptyResult","runtime-impl":"INTERPRETED","planner-impl":"RULE","DbHits":0,"Rows":0,"version":"CYPHER 2.3","planner":"RULE","runtime":"INTERPRETED","identifiers":[],"children":[{"operatorType":"Merge(Into)","ExpandExpression":"(u)-[ UNNAMED210:Follows]->(me)","Rows":14,"DbHits":57,"identifiers":[" UNNAMED210","f","me","u"],"children":[{"operatorType":"UpdateGraph","DbHits":70,"Rows":14,"UpdateActionName":"MergeNode","LegacyExpression":"f","Index":":User(login)","identifiers":["f","me","u"],"children":[{"operatorType":"Eager","Rows":14,"DbHits":0,"identifiers":["f","me"],"children":[{"operatorType":"UNWIND","Rows":14,"DbHits":0,"identifiers":["f","me"],"children":[{"operatorType":"SchemaIndex",
@sAbakumoff
sAbakumoff / DisksMoveSolution.cs
Created December 27, 2012 04:56
There are K pegs. Each peg can hold discs in decreasing order of radius when looked from bottom to top of the peg. There are N discs which have radius 1 to N; Given the initial configuration of the pegs and the final configuration of the pegs, output the moves required to transform from the initial to final configuration. You are required to do …
public class Solution
{
private static IEnumerable<string> ReadInputLine()
{
var input = Console.ReadLine();
return input == null ? null : input.Split(' ');
}
private delegate bool Parse<T>(string str, out T result);