FREE reporting in X# with Microsoft "Reporting Services" ...

Public forum to share code snippets, screen shorts, experiences, etc.
Post Reply
User avatar
Phil Hepburn
Posts: 743
Joined: Sun Sep 11, 2016 2:16 pm

FREE reporting in X# with Microsoft "Reporting Services" ...

Post by Phil Hepburn »

Hi Forum guys,

Well, for guys who like getting their money's worth, there is some good news from my efforts of this afternoon. For those with Visual Studio available to them.

For XSharp 'user folks', we can use the standard C# template tools to create with a Wizard a report which can reside in the C# Class Library of our solution, but be used in an X# main module of the application. See the image below :-
MSRS_XS_works03.jpg
MSRS_XS_works03.jpg (65.18 KiB) Viewed 563 times
Yes, it has been a bit fiddly to get it to work the first time, but now I know what to do it should be quick and easier next time. And I will record exactly what I do to make it work, again.

Before I comment further, lets see the Wizard in the 'New Item' dialog, as well as the results when we create and run the right X# code. First the Wizard :-
MSRS_XS_works01.jpg
MSRS_XS_works01.jpg (28 KiB) Viewed 563 times
And now the xBase code that we need to call, run, and show the report :-
MSRS_XS_works02.jpg
MSRS_XS_works02.jpg (91.51 KiB) Viewed 563 times
Obviously, we can see the report at the bottom of the second image - okay, its not fantastic looking, or even tidy - BUT - it all works fine. Which was the whole point of the exercise in the first place.

The data is gotten from an SQL Server database called "Adventure Works" and the standard version of '2012' was a MS download a couple of years back. Its free to hand around.

The code was taken from an MSDN sample written in C#, and all I have done is get it to work so that the X# code references the objects stored in the C# Class Library. It has to be done this way so that we can use the Wizard for placing a new report item entry into the C# ClassLibrary. We don't write any C# code as such.

I will be filling out my folder structure in 'ClickStartXSharp' eNotes on this topic later today.

Okay, the whole 'Reporting Services' thing seems a bit dated (old fashioned even) and a bit awkward - BUT - hey! its free. And you do have to use Visual Studio.

I will now try and make a report with some better looking data, as well as another from an 'in-memory' data object.

I have to say however, it is a much better user experience (to my mind) using a modern third party offering like DevExpress, than the FREE Microsoft product. It has taken me much longer to get some results and it was not really a pleasant experience, whereas the DevExpress exploration was good fun, and rewarding. Other modern third party tools may also be as rewarding.

Still, beggars can't be choosers ;-0)

So watch this space those who want "old lamps for new" - this is a joke on the famous line from the pantomime called Aladdin ("new lamps for old"). Something for nothing !?

Hope this interests a few guys needing reports.

Cheers,
Phil.
Wales, UK.
ic2
Posts: 1858
Joined: Sun Feb 28, 2016 11:30 pm
Location: Holland

FREE reporting in X# with Microsoft "Reporting Services" ...

Post by ic2 »

Hello Phil,

Interesting! The problem for most of the VO users is I think that they have to change so much stuff if they want to move that doing nothing is the most likely outcome. For me VS itself is a major reason. Yesterday for example I invested some time to find out why on earth I kept finding spaces between my code and a comment line while everything was set to Tabs. Turned out to be one of the many deficits in VS, even in the latest VS 2017 I read (still using VS 2015 and not planning to install VS 2017 again for now - so I haven't checked). VS just can't keep tabs. VO can and it's again a proof that the old VO is so much productive than any new VS version. Unfortunately.

Apart from my repulsion against VS, confirmed multiple times each hour I work in it, your report experiments are as I wrote very interesting. Even with tons of legacy Report Pro reports, anything newer is probably better. May I remind the readers that Syncfusion, which has a free community version (when your company has < $ million turnover, <6 programmers) and that includes reporting : https://help.syncfusion.com/report-plat ... ng-started

Dick
User avatar
Phil Hepburn
Posts: 743
Joined: Sun Sep 11, 2016 2:16 pm

FREE reporting in X# with Microsoft "Reporting Services" ...

Post by Phil Hepburn »

Hi Dick (and others),

I am also 'stuck' on VS 2015 for reasons I won't go into right now. Most practical and sensible and that VS 2017 seems 100% broken on my office PC

You may be right about VS and issues we developer guys have when used to using VO repository and Chris's lovely XIDE.

But if we are going to frequent the world of .NET then this is part of the price we have to pay.

The problem is that third party modern software tools, and frameworks, are built for .NET users coding in C#, and so they are VERY much geared to VS I'm afraid. So to 'tap into' these we need to be able to use VS it would seem.

I downloaded the Syncfusion stuff last time somebody on the Forum suggested it was FREE - and installed it too. My problem in researching for Cologne and the conference in April, is that the Toolbox in VS gets VERY full and clogged up when we try to install and use more than one Third Party offering / product.

For the above reason I cleared up my VS toolbox by actually cleaning off 'VS 2015' all together and refreshing with a new install. Now I have only DevExpress and Microsoft tools, and the VS IDE seems to skip along - much more responsive. So at least I can research two properly.

Unfortunately this means I can't immediately look at Infragistics or Syncfusion, (or others I list in my eNotes), which is what I would like to do, and had planned. I will do this after April perhaps, when I return from Cologne.

It takes a LOT of work to check-out one third party product, when it comes to Reporting - it is a complex issue indeed. However, if all else goes wrong etc., etc., I have found that for me DevExpress seems to offer a good solution for me as an app developer and integrating functionality into my .NET apps, and if nothing else 'Reporting Services' from MS is FREE, even if it looks a bit dated.

Personally, I think that a quality third party product is worth the investment as their tools are very complex under the hood - ALSO - some offer built in support along with the licence fee - the support from DevExpress guys has been first class so far. I can't say about others for the above reasons. YOu can create a support ticket directly from the menu bar in VS - very nice and easy.

Can any other X# guys try out 'Syncfusion' for me and the Forum ? If they haven't too much in their Toolbox.

By the way, the good news with Reporting is that we can quite happily run reports from one product alongside reports from others - no need to change what is already working, but efforts on new reports can be done the new ways. There do seem to be some nice benefits from doing and looking 'modern'.

Hope some of this makes sense to you guys. I 'took on' a lot on when I said I would do a session on "Printing and Reporting" in .NET and what works in X# as well. I am glad I did however, as I have learned a great deal by doing so.

Cheers,
Phil.
ic2
Posts: 1858
Joined: Sun Feb 28, 2016 11:30 pm
Location: Holland

FREE reporting in X# with Microsoft "Reporting Services" ...

Post by ic2 »

Hello Phil,

I fully agree with all you wrote in the reply (that's not always the case :whistle: )
Just after my posting I found a Microsoft blogsite where a MS guy tried to convince everyone to update from VS 2013 to VS 2015 and explains how to get "legacy" code also working in newer versions. He has updated the article for VS 2017 and asks users who do not want to update to mail him why not. I may give VS 2017 a try again and see if, with what he wrote, I can get Vulcan 4 to work ( as long as I have not converted all to X#). I'll report back.

About Syncfusion: I found conversion problems in their RTF control when saving/loading to/from HTML, which was my objective to use it. Their support responsiveness has been great so far but not all problems were solved after the first patch. However, they directly responded again so I am fairly optimistic. I hope to contribute a bit more about our Syncfusion experience in a while.

About VS: Indeed you get lots of controls, lots of DLL's and code - it's incredible how many megabytes , files and directories even a simple .C# solution yields. Not much one can do about it.

Dick
User avatar
Phil Hepburn
Posts: 743
Joined: Sun Sep 11, 2016 2:16 pm

FREE reporting in X# with Microsoft "Reporting Services" ...

Post by Phil Hepburn »

Hi Dick,

yes, all very sensible that you write, and interesting too!

Since your last post you have motivated me to try and get a working Syncfusion install up and running. And I seem to have done it !

I have an account with them (SyncFusion) from when I followed your post in November time.

As you can see from the attached image I have a Virtual Machine running VS 2017 - a clean installation - and in that I have now managed to install the 'SyncFusion' WPF and Reporting controls.

I had to use a VM because my main operating system won't allow a VS 2017 install even though I have cleaned it off completely doing things the right way it would seem. Spent ages on this but MS seem to have screwed things - obviously they did not get us to test the installer for them ;-0)

I will look at this guys approach in the article that you mention, as I would like to have it installed on my working desktop platform, without need to resort to VM's. However, the VM platform does seem OK and I have internet and browser facilities.

Here is what you motivated me to do :-
DickForumSyncF_01.jpg
DickForumSyncF_01.jpg (105.55 KiB) Viewed 563 times
And a test C# app in WPF creates this References content :-
DickForumSyncF_02.jpg
DickForumSyncF_02.jpg (61.04 KiB) Viewed 563 times
Thanks for the encouragement :whistle: :pinch: :blink: :silly:

Please try and record or make a note of anything which may be helpful for me to say to conference attendees in April. Remember, it is the Reporting that I am interested it, not so much any GUI controls other than those for Printing/Reporting.

Cheers for now,
Phil.
Wales, UK.
User avatar
robert
Posts: 4518
Joined: Fri Aug 21, 2015 10:57 am
Location: Netherlands

FREE reporting in X# with Microsoft "Reporting Services" ...

Post by robert »

Dick,

I think the tabs/space after generated comment characters are not the responsibility of Visual Studio, but of the authors of the Language Service that runs inside VS.
VS itself is very flexible and allows many languages and has no idea about comment characters for the various languages.

For some languages tabs/spaces are ignored. For other languages these are an essential part of the language, like for example Python where the tab/space at the beginning of a line of code is used to define a block of statements. IF statements in Python have no ENDIF.
They simply assume that all lines that are indented under it are part of the statement block. I am not sure if I personally like that, but this is simply a fact.

If you see incorrect tab/space characters in C# then this is a problem from the C# language team.
If you see incorrect tab/space characters in Vulcan then you have a problem. It will never be fixed.
If you see incorrect tab/space characters in X# then you know who to report it to, I think.

Robert
XSharp Development Team
The Netherlands
robert@xsharp.eu
User avatar
Chris
Posts: 4899
Joined: Thu Oct 08, 2015 7:48 am
Location: Greece

FREE reporting in X# with Microsoft "Reporting Services" ...

Post by Chris »

Hi Dick,
Dick wrote: Yesterday for example I invested some time to find out why on earth I kept finding spaces between my code and a comment line while everything was set to Tabs. Turned out to be one of the many deficits in VS, even in the latest VS 2017 I read (still using VS 2015 and not planning to install VS 2017 again for now - so I haven't checked). VS just can't keep tabs.
Oh, come on, you know that I am not exactly the most pro-VS person in the world :), but I don't see what you are describing. Even in the X# VS2017 integration, the VS editor holds tabs just fine.

There's a setting in ToolsOptionsText EditorXSharpTabs that let's you choose the tab size and if you want the editor to insert real tabs or spaces instead, maybe you have set that to spaces? I just tried with tabs, inserted several of them in many places, closed and reopened the file and they are still there as expected. I assume the same happens to the c# text editor, too.

Chris
Chris Pyrgas

XSharp Development Team
chris(at)xsharp.eu
User avatar
Chris
Posts: 4899
Joined: Thu Oct 08, 2015 7:48 am
Location: Greece

FREE reporting in X# with Microsoft "Reporting Services" ...

Post by Chris »

Robert,
Robert van der Hulst wrote: If you see incorrect tab/space characters in Vulcan then you have a problem. It will never be fixed.
Glad to see that your trip to the limits of the earth has not affected your naughtiness :)

Chris
Chris Pyrgas

XSharp Development Team
chris(at)xsharp.eu
Post Reply