Exception when rendering report with business objects

Stimulsoft Reports.NET discussion
Post Reply
hgm
Posts: 7
Joined: Fri Nov 20, 2015 9:16 am

Exception when rendering report with business objects

Post by hgm »

I am having trouble rendering a stimulsoft report with my custom business object. I get a somehow strange exception:

“d:\temp\SYSTEM\mx1wctlk.0.cs(308,49) : error CS1519: Ungültiges Token ']' in Klasse, Struktur oder Schnittstellenmemberdeklaration.d:\temp\SYSTEM\mx1wctlk.0.cs(309,21) : error CS1519: Ungültiges Token '{' in Klasse, Struktur oder Schnittstellenmemberdeklaration.d:\temp\SYSTEM\mx1wctlk.0.cs(311,25) : error CS1519: Ungültiges Token '{' in Klasse, Struktur oder Schnittstellenmemberdeklaration.”

Designing the report with the same model works fine:

Code: Select all

    pModel = pService.GetReportModel();
    myReport.RegBusinessObject("Model", pModel);
    myReport.Dictionary.SynchronizeBusinessObjects(3);
    myReport.DesignWithWpf();
Only when I try to render the report I get the exception. Here the code used to render the report:

Code: Select all

            StiReport report = new StiReport();
            report.Load(templatePath);
            report.RegBusinessObject("Model", reportModel);
            report.Dictionary.SynchronizeBusinessObjects(3);

            report.Render(false);  // here is where the Exception ocurres!!!

            var outputStream = new MemoryStream();
            report.ExportDocument(stiExportFormat, outputStream);
            outputStream.Position = 0;
            return outputStream;
Any idea what can be wrong? Can the model be the cause of this Exception? I need some help, I don’t know how to solve this problem.
Attachments
UnitBranchEvaluationModel.cs
The Model used for the report.
(2.92 KiB) Downloaded 198 times
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Exception when rendering report with business objects

Post by HighAley »

Hello.

It seems that there is something wrong in your report template.
Could you send us your report template for analysis?

Thank you.
hgm
Posts: 7
Joined: Fri Nov 20, 2015 9:16 am

Re: Exception when rendering report with business objects

Post by hgm »

Yes, I attached my Report which contains no design elements on it. It's just a blank report with a business object model as data source.
Attachments
UnitBranchEvaluation.mrt
Report with model as data source.
(10.22 KiB) Downloaded 253 times
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Exception when rendering report with business objects

Post by HighAley »

Hello.

Do you get the exception with this report?
If yes, then this is something else. Please, send us a simple VS project that reproduces the issue.

Thank you.
hgm
Posts: 7
Joined: Fri Nov 20, 2015 9:16 am

Re: Exception when rendering report with business objects

Post by hgm »

Hello

I created a simple VS-Solution in order to reproduce the Exception. The Solution has 3 small Projects:

- Model (Class Library): only used to create and provide the model (data) for the other 2 projects.
- StimulsoftDesigner (Windows Forms Application): used to call the Stimulsoft WPF-Designer in order to design the report. The model is set using the RegBusinessObject() method.
- StimulsoftForum (Console Application): used to set the report model, render the report and return the report as a Stream. It is here that I get the specified exception when calling report.Render(false). The report template was created with the designer in the solution StimulsoftDesigner and copied by hand in this solution.

I hope that we can solve the problem.
George.
Attachments
StimulsoftForum.zip
(66.66 KiB) Downloaded 191 times
Ivan
Posts: 960
Joined: Thu Aug 10, 2006 1:37 am

Re: Exception when rendering report with business objects

Post by Ivan »

Hello,
hgm wrote:I am having trouble rendering a stimulsoft report with my custom business object. I get a somehow strange exception:
“d:\temp\SYSTEM\mx1wctlk.0.cs(308,49) : error CS1519: Ungültiges Token ']' in Klasse, Struktur oder Schnittstellenmemberdeklaration.d:\temp\SYSTEM\mx1wctlk.0.cs(309,21) : .....
You use the 2014.1 version of our product.
In earlier versions of our product, not all types of columns were processed correctly. For example, the type Dictionary<int,double>, therefore incorrect data is stored in the report template.
This problem was solved in the 2015.2 release of our product.
hgm wrote:Only when I try to render the report I get the exception.
Please edit the ReferencedAssemblies property of the report and add the "Model.dll" assembly name to the list.

Thank you.
hgm
Posts: 7
Joined: Fri Nov 20, 2015 9:16 am

Re: Exception when rendering report with business objects

Post by hgm »

Hi Ivan,

ok, I updated the Report to 2015.2 and now everything works as expected.

Thanks,
George.
Andrew
Posts: 4109
Joined: Fri Jun 09, 2006 3:58 am

Re: Exception when rendering report with business objects

Post by Andrew »

George,

Thank you letting us know about this.

Have a nice day!
Post Reply