Code Monkey home page Code Monkey logo

Comments (11)

KirillKornienko avatar KirillKornienko commented on May 18, 2024 1

continues with problem FastReport.Utils.CompilerException: (153,103): Error CS0117: Please, don't use the method 'NewLine'

Hello! It's ScriptSecurity: https://www.fast-report.com/en/blog/360/show/
Disable FastReport.Utils.Config.EnableScriptSecurity property

from fastreport.

marcianobandeira avatar marcianobandeira commented on May 18, 2024 1

i disabled FastReport.Utils.Config.EnableScriptSecurity = false;
but, the error persists
FastReport.Utils.CompilerException: (153,103): Error CS0117: Please, don't use the method 'NewLine'

from fastreport.

Detrav avatar Detrav commented on May 18, 2024

What is the line feed character in your system? FR uses the default LF as a line feed.

from fastreport.

tushroy avatar tushroy commented on May 18, 2024

@fediachov @Detrav Wouldn't text.Replace("<br>", "\r\n") be considered with text.Replace("<br>", Environment.NewLine) to solve the issue on all platform?

from fastreport.

Detrav avatar Detrav commented on May 18, 2024

No, it isn't the problem. Our text engine is built on the \n symbol as line separator, it is made for compatibility of reports from different operating systems.

For example, you create a report on the windows operating system or MacOS or Android or any other. The text is converted and stored in a universal form with a \n separator, it will allow to prepare a report on any operating system.

This method converts <br/> tags into our internal separator. After that, our engine breaks the text in rows.

// This line text is replaced
text = text.Replace("<br>", "\r\n");
// This line text is splitted
string[] lines = text.Split(new char[] { '\n' });

from fastreport.

WAmadeus avatar WAmadeus commented on May 18, 2024

What is the line feed character in your system? FR uses the default LF as a line feed.

Windows uses CR+LF, Linux only LF

from fastreport.

WAmadeus avatar WAmadeus commented on May 18, 2024

No, it isn't the problem. Our text engine is built on the \n symbol as line separator, it is made for compatibility of reports from different operating systems.

For example, you create a report on the windows operating system or MacOS or Android or any other. The text is converted and stored in a universal form with a \n separator, it will allow to prepare a report on any operating system.

This method converts <br/> tags into our internal separator. After that, our engine breaks the text in rows.

// This line text is replaced
text = text.Replace("<br>", "\r\n");
// This line text is splitted
string[] lines = text.Split(new char[] { '\n' });

The problem is not the report itself but with strings build dynamically.

For example, I have a class's property getter that returns an address. The resulting string is build using StringBuilder.AppendLine("Street 1").AppendLine("City 1") that appends CR+LF on Windows and only LF on Linux. The report is exported correctly on Windows, but the same report on Linux doesn't have line breaks.

from fastreport.

Detrav avatar Detrav commented on May 18, 2024

That is why the internal separator from the FR does not go outside.

from fastreport.

Detrav avatar Detrav commented on May 18, 2024

Iā€™m closing this issue because it has been inactive for a few weeks. This probably means that it is not reproducible or it has been fixed in a newer version.

Please reopen if you still encounter this issue with the latest stable version.

Thank you!

from fastreport.

marcianobandeira avatar marcianobandeira commented on May 18, 2024

continues with problem FastReport.Utils.CompilerException: (153,103): Error CS0117: Please, don't use the method 'NewLine'

from fastreport.

KirillKornienko avatar KirillKornienko commented on May 18, 2024

i disabled FastReport.Utils.Config.EnableScriptSecurity = false;
but, the error persists
FastReport.Utils.CompilerException: (153,103): Error CS0117: Please, don't use the method 'NewLine'

Can you send your code?

from fastreport.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    šŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. šŸ“ŠšŸ“ˆšŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ā¤ļø Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.