FastReport icon indicating copy to clipboard operation
FastReport copied to clipboard

TextObject not creating properly on web designer

Open StefanDamchevski opened this issue 5 years ago • 9 comments

Hello!

So as you can see in the video, the first time I add the text object the designer says that it was created, but in the frx file a text object was not added, you can see that when I load the same report again. Later on I add the text field again and press preview so that the designer tries to add the text object while processing the report. So pressing save again after seems to create the text object.

https://user-images.githubusercontent.com/58256222/107207458-9bb7f280-6a00-11eb-9c75-09f2608899ab.mp4

How to save my text object without previewing the report before save?

Thanks in advance!!

StefanDamchevski avatar Feb 08 '21 10:02 StefanDamchevski

Hi! There is a bug that I fixed like this:

DesignerController.cs.txt

`namespace FastReport.Web.Controllers { class DesignerController : BaseController //here is a unimportant piece of code

    public DesignerController() : base()
    {
        RegisterHandler("/designer.saveReport", () =>
        {
            if (!FindWebReport(out WebReport webReport))
                return new NotFoundResult();

            if (webReport.DesignerSaveMethod == null)
            {
                // old saving way by self-request
                return webReport.DesignerSaveReport(Context);
            }
            else
            {
                _ = ReadStringDataManual(Request.Body, webReport);

                // save by using a Func
                string msg = string.Empty;
                int code = 200;
                /*
                string report = webReport.Report.SaveToString();
                try
                {
                    msg = webReport.DesignerSaveMethod(webReport.ID, webReport.ReportFileName, report);
                }
                catch(Exception ex)
                {
                    code = 500;
                    msg = ex.Message;
                }
                */

                var result = new ContentResult()
                {
                    StatusCode = code,
                    ContentType = "text/html",
                    Content = msg
                };
                return result;
            }
        });

`

RedKot73 avatar Feb 19 '21 13:02 RedKot73

Hello! This bug fixed. We will release an updated version of the package in the near future

KirillKornienko avatar Feb 19 '21 14:02 KirillKornienko

@KirillKornienko Can you be more precise about the release date?

StefanDamchevski avatar Feb 22 '21 08:02 StefanDamchevski

After insert a RTF element and save report, then loading I get the message: "Can't find object RichObject"

RedKot73 avatar Feb 23 '21 12:02 RedKot73

@RedKot73 Try the latest FastReport.OpenSource.Web package 2021.1.20

KirillKornienko avatar Feb 26 '21 08:02 KirillKornienko

@KirillKornienko I don't see version 2021.1.20, latest available is 2021.1.16

Didn't finish writing my correction:

` public async Task ReadStringDataManual(Stream ABodyStrm, WebReport AWebReport) { using (StreamReader vReader = new StreamReader(ABodyStrm, Encoding.UTF8)) { var vBody = "\n" + await vReader.ReadToEndAsync(); return AWebReport.DesignerSaveMethod(AWebReport.ID, AWebReport.ReportFileName, System.Web.HttpUtility.HtmlDecode(vBody)); } } /////////

            if (webReport.DesignerSaveMethod == null)
            {
                // old saving way by self-request
                return webReport.DesignerSaveReport(Context);
            }
            else
            {
                _ = ReadStringDataManual(Request.Body, webReport);

`

RedKot73 avatar Feb 26 '21 16:02 RedKot73

@RedKot73 https://www.nuget.org/packages/FastReport.OpenSource.Web/2021.1.20

KirillKornienko avatar Feb 27 '21 06:02 KirillKornienko

@KirillKornienko Will the sources for the updated package be available?

RedKot73 avatar Feb 27 '21 09:02 RedKot73

@KirillKornienko Will the sources for the updated package be available?

Sources are updated

KirillKornienko avatar Mar 10 '21 12:03 KirillKornienko