{"id":596,"date":"2012-04-05T09:38:36","date_gmt":"2012-04-05T07:38:36","guid":{"rendered":"http:\/\/www.capri-soft.de\/blog\/?p=596"},"modified":"2012-04-05T12:08:54","modified_gmt":"2012-04-05T10:08:54","slug":"adobe-flex-3-c-net-fluorinefx-balkendiagramme-tortendiagramme-und-liniendiagramme","status":"publish","type":"post","link":"https:\/\/www.capri-soft.de\/blog\/?p=596","title":{"rendered":"Adobe Flex 3 \/ C#.NET FluorineFX: Balkendiagramme, Tortendiagramme und Liniendiagramme"},"content":{"rendered":"<h1>Aufgabenstellung<\/h1>\n<p>Auf der Basis einer Datenbank-Abfrage werden Balkendiagramme, Tortendiagramme und Liniendiagramme mit Flex 3 und der Middleware FluorineFX, die auf einem Microsoft IIS Server l\u00e4uft, erstellt. <\/p>\n<h1>Ansatz<\/h1>\n<p>FluorineFX l\u00e4sst sich \u00fcber die Webseite http:\/\/www.fluorinefx.com\/download.html herunterladen und installieren.<br \/>\nEs handelt sich hierbei lediglich um eine Web-Anwendung, die auf dem Microsoft IIS Server mit dem Enterprise Manager eingebunden werden muss. <\/p>\n<h1>Vorraussetzungen<\/h1>\n<ul>\n<li>Installation von FluorineFX auf dem Microsoft IIS Server<\/li>\n<li>Installation von Adobe Flex<\/li>\n<li>Installation einer .NET Umgebung<\/li>\n<li>Konfiguration aller Komponenten<\/li>\n<\/ul>\n<h1>L\u00f6sung<\/h1>\n<h3>Beispiel<\/h3>\n<p><object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" width=\"630\" height=\"450\" codebase=\"http:\/\/download.macromedia.com\/pub\/shockwave\/cabs\/flash\/swflash.cab#version=6,0,40,0\"><param name=\"src\" value=\"https:\/\/www.capri-soft.de\/blog\/wp-content\/uploads\/2012\/04\/TouchScreenCube.swf\" \/><\/object><\/p>\n<h3>Code in FluorineFX<\/h3>\n<p>Der folgende Code wird in Visual Studion (Express) als Projekttyp Klassenbibliothek (oder FluorineFX Service Projekt) mit der Sprache C# genutzt. Die C# Klassenbibliothek wird im kompilierten Zustand (dll-Datei) in den Order &#8222;bin&#8220; im FluorineFX-Verzeichnis (welches als Website in IIS eingebunden wurde) kopiert. <\/p>\n<p>Die SQL-Anweisung sollte aus Performance-Gr\u00fcnden m\u00f6glichst stark aggregiert werden. Das Beispiel benutzt eine zweispaltige Struktur (ReportVO) und kann beliebig angepasst werden. <\/p>\n<p>C# Code:<\/p>\n<pre class=\"brush: jscript; title: ; notranslate\" title=\"\">\r\nusing System;\r\nusing System.Collections.Generic;\r\nusing System.Text;\r\nusing System.Collections;\r\nusing System.Data.SqlClient;\r\nusing FluorineFx; \/\/ Wichtig! FluorineFx.dll Verweis einbinden\r\n\r\nnamespace ITReportingServices\r\n{\r\n    &#x5B;RemotingService(&quot;ReportingService&quot;)]\r\n    public class ReportingService\r\n    {\r\n        public ArrayList getReport()\r\n        {\r\n            ArrayList reports = new ArrayList();\r\n\r\n            SqlConnection conn = \r\n            new SqlConnection(MyConfigurationManager.msSqlServerString);\r\n\r\n            try\r\n            {\r\n                conn.Open();\r\n                SqlCommand comm = new SqlCommand();\r\n                comm.Connection = conn;\r\n                comm.CommandText = &quot;SELECT MONTH(buchdatum) As Monat, &quot;+\r\n               &quot;sum(wert) AS Summe FROM costcenteraccounting &quot;+\r\n               &quot;WHERE (YEAR(buchdatum)) = 2011 &quot;+\r\n               &quot;AND costcenter=&#039;101008960&#039; &quot;+\r\n               &quot;GROUP BY (MONTH(buchdatum)), (YEAR(buchdatum))\t&quot;;\r\n                SqlDataReader reader = comm.ExecuteReader();\r\n                while (reader.Read())\r\n                {\r\n                    ReportVO vo = new ReportVO();\r\n                    vo.monat = reader.GetValue(0).ToString();\r\n                    vo.summe = reader.GetValue(1).ToString().Replace(&quot;,&quot;,&quot;.&quot;);\r\n                    reports.Add(vo);\r\n                }\r\n            }\r\n            catch (Exception e)\r\n            {\r\n                reports = new ArrayList();\r\n                ReportVO vo = new ReportVO();\r\n                vo.monat = e.Message;\r\n                vo.summe = e.Message;\r\n                reports.Add(vo);\r\n                return reports;\r\n            }\r\n            finally\r\n            {\r\n                conn.Close();\r\n            }\r\n\r\n            return reports;\r\n        }\r\n    }\r\n\r\n    public class ReportVO\r\n    {\r\n        public string monat;\r\n        public string summe;\r\n    }\r\n}\r\n<\/pre>\n<h3>Code in Adobe Flex<\/h3>\n<p>Das Model wird auf den .NET-Namespace gemappt.<\/p>\n<p>Model:<\/p>\n<pre class=\"brush: jscript; title: ; notranslate\" title=\"\">\r\npackage models\r\n{\r\n   &#x5B;RemoteClass(alias=&quot;ITReportingServices.ReportVO&quot;)]\r\n   public class ReportVO\r\n   {\r\n       public var monat:String;\r\n       public var summe:String;\t\t\r\n\t\t\r\n       public function ReportVO()\r\n       {\r\n       }\r\n   }\r\n}\r\n<\/pre>\n<p>Service in Flex-Code aufrufen:<\/p>\n<pre class=\"brush: jscript; title: ; notranslate\" title=\"\">\r\n&lt;!-- unter den Script-Teil in MXML schreiben --&gt;\r\n&lt;mx:RemoteObject id=&quot;reportingService&quot; \r\n                             destination=&quot;GenericDestination&quot;  \r\n                             source=&quot;ITReportingServices.ReportingService&quot; \r\n                             showBusyCursor=&quot;true&quot; \r\n                             fault=&quot;faultHandler(event)&quot; &gt;\r\n       &lt;mx:method name=&quot;getReport&quot; result=&quot;getReportHandler(event)&quot;\/&gt;\r\n&lt;\/mx:RemoteObject&gt;\t\r\n...\r\n\r\n\/\/ Das hier in mx:Script Teil\r\n&#x5B;Bindable] public var reports:ArrayCollection=new ArrayCollection();\r\n\r\npublic function creationComplete():void\r\n{\r\n    reportingService.getReport();\r\n}\r\n\t\t\t\r\npublic function getReportHandler(event:ResultEvent):void\r\n{\r\n     reports = event.result as ArrayCollection;\r\n}\r\n\t\t\t\r\npublic function faultHandler(event:FaultEvent):void\r\n{\r\n   Alert.show(event.fault.toString());\r\n}\r\n<\/pre>\n<h3>Diagramme<\/h3>\n<p>Balkendiagramm:<\/p>\n<pre class=\"brush: jscript; title: ; notranslate\" title=\"\">\r\n&lt;mx:ColumnChart dataProvider=&quot;{reports}&quot; \r\n                     height=&quot;100%&quot; width=&quot;100%&quot; id=&quot;columnchart1&quot;&gt;\r\n    &lt;mx:horizontalAxis&gt;\r\n      &lt;mx:CategoryAxis id=&quot;ca&quot; categoryField=&quot;monat&quot; title=&quot;Market sizes&quot; \/&gt;\r\n     &lt;\/mx:horizontalAxis&gt;\r\n     &lt;!-- horizontal axis renderer --&gt;\r\n     &lt;mx:horizontalAxisRenderers&gt;\r\n    \t&lt;mx:AxisRenderer axis=&quot;{ca}&quot; canDropLabels=&quot;false&quot; \/&gt;\r\n      &lt;\/mx:horizontalAxisRenderers&gt;\r\n      &lt;mx:series&gt;\r\n            &lt;mx:ColumnSeries displayName=&quot;Amount&quot; \r\n        \t\txField=&quot;monat&quot;\r\n        \t\tyField=&quot;summe&quot;\/&gt;\r\n       &lt;\/mx:series&gt;\r\n&lt;\/mx:ColumnChart&gt;\r\n&lt;mx:Legend visible=&quot;false&quot; dataProvider=&quot;{columnchart1}&quot;\/&gt;\t\t\r\n<\/pre>\n<p>Tortendiagramm:<\/p>\n<pre class=\"brush: jscript; title: ; notranslate\" title=\"\">\r\n&lt;mx:Label text=&quot;Linke Seite&quot; \/&gt;\r\n&lt;mx:PieChart id=&quot;pie2&quot; \r\n   width=&quot;100%&quot; height=&quot;100%&quot;\r\n   dataaProvider=&quot;{reports}&quot;  showDataTips=&quot;true&quot;&gt;\r\n      &lt;mx:series&gt; \r\n        &lt;!--Apply the Array of radii to the PieSeries.--&gt;\r\n\t&lt;mx:PieSeries field=&quot;summe&quot;\r\n                \t        nameField=&quot;monat&quot;\r\n                \t       labelPosition=&quot;callout&quot;\/&gt;\r\n      &lt;\/mx:series&gt;\r\n&lt;\/mx:PieChart&gt;\r\n  &lt;mx:Legend dataProvider=&quot;{pie2}&quot;\/&gt;\r\n<\/pre>\n<p>Liniendiagramm:<\/p>\n<pre class=\"brush: jscript; title: ; notranslate\" title=\"\">\r\n&lt;mx:LineChart width=&quot;100%&quot; height=&quot;100%&quot; \r\n\tid=&quot;myChart&quot; \r\n\tdataProvider=&quot;{reports}&quot; \r\n        \tshowDataTips=&quot;true&quot;&gt;\r\n   &lt;mx:horizontalAxis&gt;\r\n     &lt;mx:CategoryAxis dataProvider=&quot;{reports}&quot; \r\n                \t     categoryField=&quot;month&quot;\/&gt;\r\n    &lt;\/mx:horizontalAxis&gt;\r\n    &lt;mx:series&gt;\r\n       &lt;mx:LineSeries yField=&quot;summe&quot; \r\n                 \t  displayName=&quot;Summe&quot;\/&gt;       \r\n    &lt;\/mx:series&gt;\r\n&lt;\/mx:LineChart&gt;\r\n<\/pre>\n<iframe src=\"http:\/\/www.facebook.com\/plugins\/like.php?href=https%3A%2F%2Fwww.capri-soft.de%2Fblog%2F%3Fp%3D596&amp;layout=standard&amp;show_faces=true&amp;width=450&amp;action=like&amp;colorscheme=light\" scrolling=\"no\" frameborder=\"0\" allowTransparency=\"true\" style=\"border:none; overflow:hidden; width:450px;margin-top:5px;\"><\/iframe>","protected":false},"excerpt":{"rendered":"<p>Aufgabenstellung Auf der Basis einer Datenbank-Abfrage werden Balkendiagramme, Tortendiagramme und Liniendiagramme mit Flex 3 und der Middleware FluorineFX, die auf einem Microsoft IIS Server l\u00e4uft, erstellt. Ansatz FluorineFX l\u00e4sst sich \u00fcber die Webseite http:\/\/www.fluorinefx.com\/download.html herunterladen und installieren. Es handelt sich hierbei lediglich um eine Web-Anwendung, die auf dem Microsoft IIS Server mit dem Enterprise Manager &hellip; <a href=\"https:\/\/www.capri-soft.de\/blog\/?p=596\" class=\"more-link\"><span class=\"screen-reader-text\">Adobe Flex 3 \/ C#.NET FluorineFX: Balkendiagramme, Tortendiagramme und Liniendiagramme<\/span> weiterlesen <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[4,10],"tags":[],"class_list":["post-596","post","type-post","status-publish","format-standard","hentry","category-net","category-datenbanken"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p4yGeN-9C","jetpack_likes_enabled":true,"jetpack-related-posts":[],"_links":{"self":[{"href":"https:\/\/www.capri-soft.de\/blog\/index.php?rest_route=\/wp\/v2\/posts\/596","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.capri-soft.de\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.capri-soft.de\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.capri-soft.de\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.capri-soft.de\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=596"}],"version-history":[{"count":9,"href":"https:\/\/www.capri-soft.de\/blog\/index.php?rest_route=\/wp\/v2\/posts\/596\/revisions"}],"predecessor-version":[{"id":599,"href":"https:\/\/www.capri-soft.de\/blog\/index.php?rest_route=\/wp\/v2\/posts\/596\/revisions\/599"}],"wp:attachment":[{"href":"https:\/\/www.capri-soft.de\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=596"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.capri-soft.de\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=596"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.capri-soft.de\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=596"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}