Last post Aug 26, 2011 05:01 AM by Nishantg
Aug 19, 2011 07:44 AM|MyronCope|LINK
using report builder 2.0
I was adding an assembly to a report and it looks like the assembly is added but now that I have done that I am trying to add a class to the assembly. My class name is "databaseClass" so in the "add or remove classes" section of report props (report props
-> References) I have the following:
Class Name: DatabaseClass
Instance Name: ObjDBClass
and I'm getting the error when I save the report:
Error in class instance declaration for class DatabaseCode: [BC30002] Type 'DatabaseCode' is not defined.
So I am not sure I understand what is supposed to be in the "Instance" field. The name instance suggests that it should be an object. So my question is what is supposed to be in the Instance field?
Should I instantiate the database class and then reference that instance there? If yes where should that be done in the assembly?
I instantiated an object of the type DatabaseClass in my assembly called objDBClass and tried putting that into the instance but that does not work.
I am no longer getting the first error above because for the class field in the "add or remove class" I am using the folowing syntax:
so it looks like the assembly and class have been added.
However when I try to run a test on a hello world program where the syntax is like this (assinging Hello World text to a textbox)
When I try to save the report it's giving me an error
The Value expression for the textrun ‘Textbox1.Paragraphs.TextRuns’ contains an error: [BC30456] 'DatabaseClass' is not a member of 'MyCustomAssembly'.
I'm a vb.net coder but what I found is that when I create a sample c# assembly with a static class, add reference to c# assembly, dont add any class in the report Props (dont think it will let you because it does not see constructure for the class) and then
call the function it will work, expression syntax
This has no error, works well and returns my stupid "hello world" test but I want to do this in vb.net?
I want to do the same with vb.net but vb.net does not have static class option.
any ideas about this?
Aug 26, 2011 05:01 AM|Nishantg|LINK
I am not sure why you are not able to make an object of your class. But its not that you can not make Static class in VB.NET. For that you just need to make all the function and variable as Static.
Public Shared Function Hell() As String
Like the above function you can create a static class.
I hope this will help you.