Page 1 of 1

Report expression throws when loading report

Posted: Mon Jun 06, 2011 1:45 pm
by Richard Brunet
1) Create a report or open an existing one in the designer.
2) Double-click on any field. A dialog with a tab labeled Expression opens up. The default expression looks like {ReportProjects_01.Filename} .
3) Append two pound signs to it : {ReportProjects_01.Filename##} and click OK to close the dialog.
4) Save the report.
5) The designer tries to load the report right after, and I get a web popup with the following exception message:

c:\Windows\Temp\eghttuns.0.cs(115,66) : error CS1040: Preprocessor directives must appear as the first non-whitespace character on a line.

Seems like the pound sign is mistakenly treated as a preprocessor directive.
Is there any workaround to avoid this error? A patch I can get or...
The test report ends up showing : Project 1 28/02/2011 19:00:00 Project1.ibw == ## InService

Report expression throws when loading report

Posted: Tue Jun 07, 2011 1:34 am
by Ivan
Hello,

Please try to use the following expression:

Code: Select all

    {ReportProjects_01.Filename}##
Thank you.

Report expression throws when loading report

Posted: Tue Jun 07, 2011 9:14 am
by Richard Brunet
Well, It won't throw if I do what you are proposing.
The thing is, the report should throw an error when trying to save it using the pound signs inside the braces as I show, instead of throwing when loading after it was saved. The problem is, a user could save a report with a malformed expression or invalid fieldname, that could make the report to throw an error when he tries to open it afterward.
I repeat, the user should get an error when first trying to save the report. I would expect a "FieldName Filename## does not exist" when trying to save, or something like that.
How could I do this check myself then before saving? I could perhaps do that check myself, I don't know. Your designer should in fact.


Report expression throws when loading report

Posted: Wed Jun 08, 2011 2:45 am
by Alex K.
Hello,

When you open a report the error does not occur, this error occurs during compilation.
To verify, before saving, you can run the Report Checker, when errors occur they will be shown.

Thank you.

Report expression throws when loading report

Posted: Wed Jun 08, 2011 9:26 am
by Richard Brunet
Compilation? Ok, I see. So, I presume there is a way to use this tool from our web application so that users can benefit from it. Right?
I still think that your report designer should do some basic checks before allowing a user to save his report. The report designer shouldn't allow saving a report with a bad expression... or at least a bad field name like {ReportProjects.Filename##}, since the user is allowed to put anything for the field name. Anyway, I'll try to find information on the Report Checker.