<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" version="2.0">

<channel>
	<title>Perpetuum Software Blog » Dmitry Zhukov</title>
	
	<link>http://blogs.perpetuumsoft.com</link>
	<description>This blog is about proved and promising Microsoft technologies: .Net, ASP.Net, Silverlight, WPF, etc.</description>
	<lastBuildDate>Thu, 24 Mar 2011 10:39:14 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/PerpetuumSoftBlog/author/dmitry-zhukov" /><feedburner:info xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" uri="perpetuumsoftblog/author/dmitry-zhukov" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
		<title>Customization of ReportViewer and ReportDesigner Behavior by Using Actions</title>
		<link>http://blogs.perpetuumsoft.com/reporting/reportviewerreportdesignercustomizatio/</link>
		<comments>http://blogs.perpetuumsoft.com/reporting/reportviewerreportdesignercustomizatio/#comments</comments>
		<pubDate>Thu, 24 Mar 2011 10:35:48 +0000</pubDate>
		<dc:creator>Dmitry Zhukov</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[Reporting]]></category>
		<category><![CDATA[.net reporting]]></category>
		<category><![CDATA[reporting tool]]></category>

		<guid isPermaLink="false">http://blogs.perpetuumsoft.com/?p=839</guid>
		<description><![CDATA[It is possible to configure ReportViewer&#8217;s and ReportDesigner&#8217;s behavior by using Actions.
In order to override an action you need to write the Action.Executing event handler and set the &#8216;true&#8217; value for the e.Handled flag. Then you need to implement the necessary behavior.
reportDesigner.Actions&#91;&#93;.Executing += new PerpetuumSoft.Reporting.Windows.Forms.Action.ExecutingEventHandler&#40;ActionName_Executing&#41;;
…
void ActionName_Executing&#40;object sender, PerpetuumSoft.Reporting.Windows.Forms.ExecutingEventArgs e&#41;
&#123;
&#160; e.Handled = true;
&#160; …
&#125;
If you need [...]]]></description>
			<content:encoded><![CDATA[<p>It is possible to configure ReportViewer&#8217;s and ReportDesigner&#8217;s behavior by using Actions.</p>
<p>In order to override an action you need to write the Action.Executing event handler and set the &#8216;true&#8217; value for the e.Handled flag. Then you need to implement the necessary behavior.</p>
<div class="codecolorer-container csharp default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="csharp codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">reportDesigner<span style="color: #008000;">.</span><span style="color: #0000FF;">Actions</span><span style="color: #008000;">&#91;</span><span style="color: #008000;">&#93;</span><span style="color: #008000;">.</span><span style="color: #0000FF;">Executing</span> <span style="color: #008000;">+=</span> <span style="color: #008000;">new</span> PerpetuumSoft<span style="color: #008000;">.</span><span style="color: #0000FF;">Reporting</span><span style="color: #008000;">.</span><span style="color: #0000FF;">Windows</span><span style="color: #008000;">.</span><span style="color: #0000FF;">Forms</span><span style="color: #008000;">.</span><span style="color: #0000FF;">Action</span><span style="color: #008000;">.</span><span style="color: #0000FF;">ExecutingEventHandler</span><span style="color: #008000;">&#40;</span>ActionName_Executing<span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span><br />
…<br />
<span style="color: #6666cc; font-weight: bold;">void</span> ActionName_Executing<span style="color: #008000;">&#40;</span><span style="color: #6666cc; font-weight: bold;">object</span> sender, PerpetuumSoft<span style="color: #008000;">.</span><span style="color: #0000FF;">Reporting</span><span style="color: #008000;">.</span><span style="color: #0000FF;">Windows</span><span style="color: #008000;">.</span><span style="color: #0000FF;">Forms</span><span style="color: #008000;">.</span><span style="color: #0000FF;">ExecutingEventArgs</span> e<span style="color: #008000;">&#41;</span><br />
<span style="color: #008000;">&#123;</span><br />
&nbsp; e<span style="color: #008000;">.</span><span style="color: #0000FF;">Handled</span> <span style="color: #008000;">=</span> <span style="color: #0600FF; font-weight: bold;">true</span><span style="color: #008000;">;</span><br />
&nbsp; …<br />
<span style="color: #008000;">&#125;</span></div></div>
<p>If you need to handle the action after it is executed, you need to write the Action.Execute event handler and set the &#8216;true&#8217; value for the e.Handled flag. Then you need to implement the necessary behavior after that.</p>
<p><span id="more-839"></span></p>
<div class="codecolorer-container csharp default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="csharp codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">reportDesigner<span style="color: #008000;">.</span><span style="color: #0000FF;">Actions</span><span style="color: #008000;">&#91;</span><span style="color: #008000;">&#93;</span><span style="color: #008000;">.</span><span style="color: #0000FF;">Execute</span> <span style="color: #008000;">+=</span> <span style="color: #008000;">new</span> EventHandler<span style="color: #008000;">&#40;</span>ActionName_Execute<span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span><br />
…<br />
&nbsp; &nbsp; <span style="color: #6666cc; font-weight: bold;">void</span> ActionName _Execute<span style="color: #008000;">&#40;</span><span style="color: #6666cc; font-weight: bold;">object</span> sender, EventArgs e<span style="color: #008000;">&#41;</span><br />
&nbsp; &nbsp; <span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; …<br />
&nbsp; &nbsp; <span style="color: #008000;">&#125;</span></div></div>
<p>In order to execute Action you need to use the following code:</p>
<div class="codecolorer-container csharp default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="csharp codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">reportDesigner<span style="color: #008000;">.</span><span style="color: #0000FF;">Actions</span><span style="color: #008000;">&#91;</span><span style="color: #008000;">&#93;</span><span style="color: #008000;">.</span><span style="color: #0000FF;">ExecuteAction</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span></div></div>
<p>All possible Actions for the ReportDesigner:<br />
&#8220;SelectMode&#8221; – switches to object selection mode<br />
&#8220;PanMode&#8221; – switches to pan mode that allows a user to scroll content with mouse.<br />
&#8220;ZoomInMode&#8221; – switches to zoom in scale mode<br />
&#8220;ZoomOutMode&#8221; – switches to zoom out scale mode<br />
&#8220;WindowZoomMode&#8221; – switches to scaling of selected area mode<br />
&#8220;DynamicZoomMode&#8221; – switches to dynamic scaling mode<br />
&#8220;CustomZoom&#8221; – opens the window that allows a user to set custom scale<br />
&#8220;Zoom25&#8243; – sets scale to 25%<br />
&#8220;Zoom50&#8243; – sets scale to 50%<br />
&#8220;Zoom75&#8243; – sets scale to 75%<br />
&#8220;Zoom100&#8243; – sets scale to 100%<br />
&#8220;Zoom125&#8243; – sets scale to 125%<br />
&#8220;Zoom150&#8243; – sets scale to 150%<br />
&#8220;Zoom200&#8243; – sets scale to 200%<br />
&#8220;Zoom300&#8243; – sets scale to 300%<br />
&#8220;Zoom500&#8243; – sets scale to 500%<br />
&#8220;DocumentProperties&#8221; – shows properties of a document<br />
&#8220;PageProperties&#8221; – shows properties of the selected page<br />
&#8220;Open&#8221; – shows the &#8216;Open Document&#8217; dialog<br />
&#8220;Save&#8221; – saves changes to a document<br />
&#8220;SaveAs&#8221; – shows the &#8216;Save Document&#8217; dialog<br />
&#8220;Undo&#8221; – removes pending changes from a workarea.<br />
&#8220;Redo&#8221; – reverses the undo or advances the buffer to a more current state.<br />
&#8220;NewDocument&#8221; – creates a new document<br />
&#8220;AddPage&#8221; – adds a page to a document<br />
&#8220;DeletePage&#8221; – deletes a page from the document<br />
&#8220;CopyPage&#8221; – copies a page in a document<br />
&#8220;DeleteObjects&#8221; – deletes the selected elements<br />
&#8220;CutObjects&#8221; – cuts the selected elements<br />
&#8220;CopyObjects&#8221; – copies the selected elements to the clipboard<br />
&#8220;PasteObjects&#8221; – pastes elements to the clipboard<br />
&#8220;SendToBack&#8221; – sends the element to the back of the all the elements of the container<br />
&#8220;BringToFront&#8221; &#8211; brings the element to the front of all the elements of the container<br />
&#8220;MoveBack&#8221; – moves the position of the element to one level back<br />
&#8220;MoveForward&#8221;– moves the position of the element to one level forward<br />
&#8220;ShowGrid&#8221; – shows grid on the page<br />
&#8220;SnapToGrid&#8221; – snaps an element sizes and position to the grid<br />
&#8220;LayoutBands&#8221; – automatically aligns the sections vertically<br />
&#8220;DataSources&#8221; – activates the DataSourceTree element<br />
&#8220;Preview&#8221; – preview of the generated report<br />
&#8220;CheckScript&#8221; – checks the scripts correctness in the report template<br />
&#8220;ShowObjectBounds&#8221; – shows bounds of the elements<br />
&#8220;ShowAlignForm&#8221; – shows alignment form for selected elements<br />
&#8220;ShowRulers&#8221; –shows/hides rulers<br />
&#8220;WholePage&#8221; – shows the whole page<br />
&#8220;PageWidth&#8221; –scales page by width<br />
&#8220;ActualSize&#8221; – scales to 100%<br />
&#8220;About&#8221; – opens the window with information about the product<br />
&#8220;SelectLanguage&#8221; – opens the window that allows a user to select localization language</p>
<p>All the possible Actions for the ReportViewer:<br />
&#8220;Print&#8221; – prints a document<br />
&#8220;Load&#8221; – opens a document<br />
&#8220;Save&#8221; – saves a document<br />
&#8220;Export&#8221; – exports a document<br />
&#8220;Pan&#8221; – switches to pan mode that allows a user to scroll content with mouse.<br />
&#8220;DynamicZoom&#8221; &#8211; dynamical scaling<br />
&#8220;ZoomIn&#8221; – switches to zoom in scale mode<br />
&#8220;ZoomOut&#8221; – switches to zoom out scale mode<br />
&#8220;ZoomRectangle&#8221; switches to scaling of the selected area mode<br />
&#8220;CustomZoom&#8221; – opens the window that allows user to set custom scale<br />
&#8220;Zoom25&#8243; – sets scale to 25%<br />
&#8220;Zoom50&#8243; – sets scale to 50%<br />
&#8220;Zoom75&#8243; – sets scale to 75%<br />
&#8220;Zoom100&#8243; – sets scale to 100%<br />
&#8220;Zoom125&#8243; – sets scale to 125%<br />
&#8220;Zoom150&#8243; – sets scale to 150%<br />
&#8220;Zoom200&#8243; – sets scale to 200%<br />
&#8220;Zoom300&#8243; – sets scale to 300%<br />
&#8220;Zoom500&#8243; – sets scale to 500%<br />
&#8220;Content&#8221; – opens bookmark tree in a document<br />
&#8220;Find&#8221; – searches for text within a document<br />
&#8220;FindNext&#8221; – continues a search that was begun with the Find Action.<br />
&#8220;WholePage&#8221; – shows the whole page<br />
&#8220;PageWidth&#8221; – scales page by width<br />
&#8220;ActualSize&#8221; – scales to 100%<br />
&#8220;Forward&#8221; – moved forward through the navigation history<br />
&#8220;Backwards&#8221; – moves backward through the navigation history<br />
&#8220;FirstPage&#8221; – goes to the first page of a report<br />
&#8220;PrevPage&#8221; – goes to the previous page of a report<br />
&#8220;NextPage&#8221; – goes to the next page of a report<br />
&#8220;LastPage&#8221; – goes to the last page of a report<br />
&#8220;GotoPage&#8221; – opens the window that allows a user to move to the specified page<br />
&#8220;EditReport&#8221;  – opens a document editor<br />
&#8220;RefreshReport&#8221; – causes the current report in the Report Viewer to be processed and rendered<br />
&#8220;SinglePage&#8221; – displays a report in per page view mode<br />
&#8220;ContinuedPage&#8221; – displays a report in continuous view mode<br />
&#8220;About&#8221; – opens the window with information about the product</p>
<p>You may find the example within our Samples Center: Reports -&gt; Using -&gt; Custom Viewer.</p>
<p>In order to create your own designer form, you may use some of the following components:<br />
ReportDesigner – component of the template editor<br />
DesignerErrorList – component for displaying errors in scripts of the template<br />
DesignerPropertyGrid – component for displaying properties of the selected objects<br />
DesignerDataSourcesTree – component for displaying connected data sources<br />
DesignerDocumentTree – component for displaying document structure as the tree<br />
DesignerStatusBar – status bar for the designer</p>
<p><a href="http://www.perpetuumsoft.com/Support/CustomDesignerForm.zip"><strong>Please see the example of fully implemented form of the designer&#8230;</strong></a></p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.perpetuumsoft.com/reporting/reportviewerreportdesignercustomizatio/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

