Page 1 of 1

Exception when rendering report with business objects

Posted: Fri Nov 20, 2015 10:20 am
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.

Re: Exception when rendering report with business objects

Posted: Fri Nov 20, 2015 10:49 am
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.

Re: Exception when rendering report with business objects

Posted: Fri Nov 20, 2015 11:35 am
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.

Re: Exception when rendering report with business objects

Posted: Fri Nov 20, 2015 1:40 pm
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.

Re: Exception when rendering report with business objects

Posted: Mon Nov 23, 2015 11:19 am
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.

Re: Exception when rendering report with business objects

Posted: Mon Nov 23, 2015 11:11 pm
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.

Re: Exception when rendering report with business objects

Posted: Thu Nov 26, 2015 2:15 pm
by hgm
Hi Ivan,

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

Thanks,
George.

Re: Exception when rendering report with business objects

Posted: Thu Nov 26, 2015 5:15 pm
by Andrew
George,

Thank you letting us know about this.

Have a nice day!