Page 1 of 3

Create report in class library

Posted: Tue Feb 18, 2014 11:02 am
by ProIT
Hi there

I use Quartz.NET to run a task every 4 hours. So I created a class library with the job. In this job I need to create a report and export it as pdf.

Output type: Class library
Target framework: .NET 4.0
Referenced assemblies:
- Stimulsoft.Base
- Stimulsoft.Editor
- Stimulsoft.Report
- Stimulsoft.Report.Check
- Stimulsoft.Report.Design
- Stimulsoft.Report.Helper

Here my code to create the StiReport Object:

Code: Select all

//Create Report
StiReport report = new StiReport();
                                               
//load report layout
if (File.Exists(Path.Combine(Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location), "GasOrderLayout.mrt")))
{
  report.Load(Path.Combine(Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location), "GasOrderLayout.mrt"));
}
else
{
  logger.Error("Unable to load report layout");
}
//Load datasource
report.RegBusinessObject("Orders", orders);
report.Dictionary.SynchronizeBusinessObjects();
//Create report
report.Render(false);
However I can't create a report. Every time I try to run the job it crashes at the following line:

Code: Select all

StiReport report = new StiReport();
Image

Isn't it possible to create a report in a class library?

Thanks for any help!
Mike Hachen

Re: Create report in class library

Posted: Wed Feb 19, 2014 6:49 am
by HighAley
Hello, Mike.

It's possible to create a report in a class library.
We didn't test our product with Quartz.NET. How do you run this task? Could you send us any sample?

Thank you.

Re: Create report in class library

Posted: Wed Feb 19, 2014 6:59 am
by ProIT
Hello Aleksey

Thank you for your reply. I have made a zip file with a sample solution. http://www.proitag.ch/public/sti/StiReportsSolution.zip

In this sample I don't use Quatz.NET but I guess that Quatz.NET isn't relevant for this problem.

Thank you for your help!
Mike Hachen

Re: Create report in class library

Posted: Wed Feb 19, 2014 11:58 am
by HighAley
Hello, Mike.

Sorry, but we couldn't reproduce your issue.
Your project works right without any error.
We have got the report exported to PDF.

Thank you.

Re: Create report in class library

Posted: Wed Feb 19, 2014 12:28 pm
by ProIT
Hello Aleksey

ok, that's strange... I use version 2013.2.1700 of your report engine (as trial version) in Visual Studio 2013 Premium. Could that be the problem?

Thanks, Mike Hachen

Re: Create report in class library

Posted: Thu Feb 20, 2014 7:59 am
by HighAley
Hello.

We run your project in Visual Studio 2013 with our latest and 2013.2.1700 assemblies. There wasn't any error.
What error do you get running this project? Please, send us full error stack.

Thank you.

Re: Create report in class library

Posted: Thu Feb 20, 2014 8:12 am
by ProIT
Hello Aleksey

There was no error stack. The only error message I got was "vshost.exe has stopped working".

I downloaded your latest version and now it works like a charm!

Thank you for your help.
Mike Hachen

Re: Create report in class library

Posted: Thu Feb 20, 2014 12:04 pm
by HighAley
Hello, Mike.

Great!
Let us know if you have any problems with our product.

Thank you.

Re: Create report in class library

Posted: Tue Aug 12, 2014 2:17 pm
by ProIT
Hi there

I updated to the latest Version of your product and now I have the same issue again! I'm not able to create an object of StiReport. I always get a message: "vshost.exe has stopped working".

So what can be the problem? I uninstalled Stimulsoft, reinstalled Stimulsoft, cleaned all directories without any success... I tried the same on a different pc, same result! Any ideas?

Thank you, Mike

Re: Create report in class library

Posted: Wed Aug 13, 2014 6:08 am
by HighAley
Hello.

Could you specify what configuration do you run the project with?
Sorry but we couldn't reproduce your issue.
What version of Windows do you use? 32 or 64 bit?

We have found this advice on the MSDN Forum:
Under project properties, please "enable unmanaged code debugging" and try .
Thank you.