StrataFrame Forum

Report SharpShooter and C#

http://forum.strataframe.net/Topic22503.aspx

By Aaron Young - 3/27/2009

Hi,



I know there are lots of guys on here using SharpShooter with VB generated custom business binding sources. This will sound stupid but is anyone doing this in C# and does it work?



The reason I ask is because I have setup a C# generated custom BBS which I know is working as I have tested it on a grid. However, when I set it as the datasource for the ReportManager, then add an InlineReport and try and run the designer I get the error "Object reference not set to an instance of an object". I have examined the VB SimpleReportShooterSample and I can see no difference with what I have done other than I am using C#.



Can anyone confirm if they have it working with C# please?



Cheers,



Aaron
By Trent L. Taylor - 3/30/2009

There should not be any difference here as these are the same classes.  I know that this works in C# because I have just finished an internal product that is written in C# and we use SharpShooter for the reports.  All new development in house here is in C# so we have been using all aspects of recommended tools (including RSS).  In fact, I just used that tool to generate some invoices using C# and RSS together to send them out in the last few days.

You might post your stack trace so we can see what is going on.

By Edhy Rijo - 3/30/2009

Trent L. Taylor (03/30/2009)
... All new development in house here is in C# ...




Sorry, this totally unrelated question here, but why are you standardizing with C# now?
By Trent L. Taylor - 3/30/2009

There are several reasons.  The main one has to do with the design-time compiler.  The larger an application becomes the more Visual Studio will die in VB.NET.  So you have to separate out the projects more.  WHich is not THAT big of a deal, but it is just irritating.  If VB.NET would have act more like C# in this manner (wait for a build) it would resolve 90% of these design-time issues.
By Aaron Young - 3/30/2009

Hi Trent,



I think I have a work around although it is a real pain - it is also a Sharpshooter issue though so sorry for posting here.



For the benefit of anyone finding this in the future, I had a problem when adding a new inline report and selecting the document... button from the report manager. Instead of opening a blank report template (which the Getting Started help system says should happen), it instead threw an error. The solution was to manually copy and paste an xml document stream from one of the sample reports and assign to the inline report's "document" attribute. It also does this for file based reports. Not ideal and I doubt it is supposed to be done this way but that is what is happening. Sad



Sadly the Report Sharpshooter help file really needs some work. It looks like the building blocks are there for a powerful application but it is sadly lacking in many areas.



On a slightly related issue, I noticed that when I bound to a BBS and BO I was able to see my field list in Sharpshooter. However, when I bound to a custom BBS I was not able to see the field list. Is this correct or have I missed something? How to you bind to a field from a custom BBS?



Thanks,



Aaron
By Trent L. Taylor - 3/31/2009

Is this correct or have I missed something? How to you bind to a field from a custom BBS?

No.  This isn't right at all.  In fact, a CustomBBS just creates a single file wraper for a BBS.  Also, though I agree with the documentation of RSS, the other things that you are having to do is not right.  Could you post a sample showing what you are doing so I can take a look?  You are most likely just missing a step somewhere and this would be good to look at so that we can get you going down a more productive track.