Reports as Source Code

Stimulsoft Reports.NET discussion
Post Reply
russr999
Posts: 15
Joined: Wed Feb 25, 2015 9:13 pm

Reports as Source Code

Post by russr999 »

Hi,

Really need some help...hoping somebody can help me. :|
I know how to save my reports as source code (File > Save As > VB Class *.vb)
I have now added these classes to a class library and complied as a DLL (called Reportlist)...all good here.
I have added the DLL to my main project.

Can somebody please tell me how I can call and show (preview) or export the report :roll:
I was going to use code like:
Dim report As StiReport = new Reportlist.Reports.HSO
Is this correct? and how do I then load the report or export it?

My DLL is called Reportlist and the namespace is called reports and the class HSO

Thanks
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Re: Reports as Source Code

Post by Alex K. »

Hello,

For loading a report from the assembly the following code is used:
C#:

Code: Select all

StiReport report = StiReport.GetReportFromAssembly("report.dll");
VB.NET:

Code: Select all

Dim Report As StiReport = StiReport.GetReportFromAssembly("report.dll")
Thank you.
russr999
Posts: 15
Joined: Wed Feb 25, 2015 9:13 pm

Re: Reports as Source Code

Post by russr999 »

Hi Aleksey,

I have not saved the report as a DLL.
I have saved the report as a vb class file.
I have put 5 class files inside my own librbary file (dll) not generated by stimulsoft designer.
How can I call the correct class for the report I want from my file?

eg: my project is set up as follows:
ReportList.vbproj
My Project
References
HSO.vb
Report2.vb
Report3.vb
Report4.vb

where each .vb file is a class and is a unique report.


Hope that makes more sense.

Thanks
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Re: Reports as Source Code

Post by Alex K. »

Hello,

You can use the following code:

Code: Select all

Dim report As Reports.Report = New Reports.Report
'..
report.RegData(demoDataSet)
report.Dictionary.Synchronize()
'report("Variable1") = 
'report("Variable2") = 
report.Show()
Thank you.
Post Reply