Archive for the ‘C#’ Category

Customization of ReportViewer and ReportDesigner Behavior Using Actions

Dmitry Zhukov

It is possible to configure ReportViewer’s and ReportDesigner’s behavior by using Actions.
In order to override an action you need to write the Action.Executing event handler and set the ‘true’ value for the e.Handled flag. Then you need to implement the necessary behavior.

reportDesigner.Actions["ActionName"].Executing += new PerpetuumSoft.Reporting.Windows.Forms.Action.ExecutingEventHandler(ActionName_Executing);

void ActionName_Executing(object sender, PerpetuumSoft.Reporting.Windows.Forms.ExecutingEventArgs e)
{
e.Handled = true;

}

If you need to handle the action after it is executed, you need to write the Action.Execute event handler and set the ‘true’ value for the e.Handled flag. Then you need to implement the necessary behavior.

(more…)

March 24th, 2011

How to Highlight PivotTable Cells in Report Sharp-Shooter.

Vitaliy Korney

Let’s imagine that we have already done all the instructions from the Report Sharp-Shooter Getting Started (page 60), which describes how to create PivotTable.

PivotTable properties connected with styles can be flexible configured, but all the cases can’t be covered. Sometimes we need a possibility to highlight cells, which satisfy some condition, set the style for a specific subgroup inside XDimension/YDimension. It’s quite evident that such settings can’t be considered during the component development as they depend on the user needs.

Well-aware users know that we can use CellCreating event, which is raised when a cell is created.

For example, we need to highlight Fact cells, which have values more than the average Fact Value.

For this purposes we need:

  1. To calculate average Fact value;
  2. To change style for the Fact cell, which satisfies our condition.

(more…)

February 21st, 2011

How to use widgets in Report Sharp-Shooter

Andrew Kazyrevich

Saying that reports aren’t always eye catchy is a bit of an understatement. Sometimes they’re just dull and dreary pieces of writing, boring data spread across columns and rows. Those who don’t need it, escape to the next page.

But what if you want more than a mere glimpse from a hasty reader? What if you want to propel the ideas behind the data? Emphasize its importance?

Then a table is not enough – you need widgets.

Problem statement

In this post I’ll show a publicly available report and explain how to re-create it with Sharp-Shooter. So here goes our poster child: a NASA plot that reveals a rapid decline in the number of astrophysics missions. The dotted line means “today”, and it’s evident that the plethora of space observatories we’ve been enjoying lately, is pretty much going to stop by 2014:

Why re-creating this very report? First off, it’s interesting data about something that concerns your humble correspondent :) Secondly, it’s a challenging task to do in Sharp-Shooter. While building this plot, we’d have to solve several problems, e.g.:

  • How to display composite headers and footers?
  • How to use bindings in Instrument Designer?
  • How to display and position images?
  • ..and a few others

Below go step by step instructions on creating the above report in Sharp-Shooter, and you can also go ahead and download the full solution here.

(more…)

February 2nd, 2011

How to build interactive sorting and grouping using Report Sharp-Shooter scripting engine.

Marketing Dept

by Fakhru Rahman, Perpetuum Software customer

Scripting engine in Report Sharp-Shooter allow us to create interactive report.
In this example we will create report in which the user can sort and group via script on the fly.

In order to do this, I have created an extended ReportViewer, you can download the source code here.

This is how our final report looks:

(more…)

December 21st, 2010