NAV Crashes when trying to open report designer

anil_mujagicanil_mujagic Member Posts: 91
Hi,

Today I created a simple report which mostly contains text labels and few variables. I used already prepared portions of text from a word document and pasted it in Caption property of labels and also in Source Expression property of textboxes.

When report was done I saved it and ran it, but as I forgot to assign a value to one of the date variables that I use, report completed with error. So I opened object designer again, found this report and clicked Design button... Navision crashed...

Tried to export object as a text file to find out what is the problem, but with no success, crash again.

I exported object in fob file and import it in NAV5 SP1 (I'm currently on NAV4 SP2) but this version also crashes if I try to open report designer.

Does anyone know what could be the problem?

Comments

  • DenSterDenSter Member Posts: 8,305
    I have two questions:
    1- do you get any error message when it crashes?
    2- What did you put into the captions?
  • anil_mujagicanil_mujagic Member Posts: 91
    DenSter wrote:
    I have two questions:
    1- do you get any error message when it crashes?
    2- What did you put into the captions?

    No, I don't get any error messages. It just stops responding and then dialog, with option to send info about error, shows up.

    I selected 2-3 short sentences of text from Word document and pasted it into caption property. It was just simple text but maybe there were some special characters that are pasted and now are causing all the truble.
  • DenSterDenSter Member Posts: 8,305
    You are still not sharing what you put in the caption.
  • anil_mujagicanil_mujagic Member Posts: 91
    DenSter wrote:
    You are still not sharing what you put in the caption.

    This is an example of text that I put in the caption:

    Svi troškovi koji nastanu nakon tog dana padaju na vaš teret (startni honorar advokatske kancelarije je 1.000 KM, na koji se dodaju svi ostali troškovi, uključujući i njihove dnevnice, zatim sudski troškovi i takse...).
  • DenSterDenSter Member Posts: 8,305
    I tried pasting that into a label and it worked fine. It also let me put it as the SourceExpr of a textbox without a problem. I don't know what could cause the issue, as it seems that it allows this to happen for me. Something tells me that pasting that into textboxes and labels is not the only thing that is going on.

    The way I would approach this is to take the original report, and do one label at a time. Paste what you need where you need it, one control at a time. Paste, Compile, Save, close the object, reopen it. That way you can see exactly at what point it starts causing errors.
  • anil_mujagicanil_mujagic Member Posts: 91
    It seems that length of Source Expression of the text box can't be longer than 255 chars. When I paste following text and save, then when opening designer NAV crashes:
    STRSUBSTNO('Ovim putem vas želimo još jednom podsjetiti na ovu obavezu, te vas istovremeno obavještavamo, ukoliko najkasnije %1 ne budemo imali uplatu ukupnog navedenog iznosa (doznačenu na naš račun), da ćemo %2 dostaviti zahtjev za protest vaše bankovne garancije, bez odlaganja i bez novih prolongiranja.', dNajkasnije, dNajkasnije + 1)

    BUT, if I paste text which is 255 chars long then it is ok:
    STRSUBSTNO('Ovim putem vas želimo još jednom podsjetiti na ovu obavezu, te vas istovremeno obavještavamo, ukoliko najkasnije %1 ne budemo imali uplatu ukupnog navedenog iznosa (doznačenu na naš račun), da ćemo %2 dostaviti ', dNajkasnije, dNajkasnije + 1)

    If I add one more character, after saving and reopening I get this in Source Expression:
    Wrong Expression

    If I add ten more characters, after saving and reopening I get this in Source Expression:
    Wrong Expre + 1)


    If I paste following text (255 chars between ''):

    STRSUBSTNO('Ovim putem vas želimo još jednom podsjetiti na ovu obavezu, te vas istovremeno obavještavamo, ukoliko najkasnije %1 ne budemo imali uplatu ukupnog navedenog iznosa (doznačenu na naš račun), da ćemo %2 dostaviti zahtjev za protest vaše bankovne garancije ,', dNajkasnije, dNajkasnije + 1)

    I get this:
    WrdNajkasnije, dNajkasnije + 1)


    It seems that Source Expression is limited to 255 chars max, but why it allows me to enter more than 255 chars if it can't read it later?!

    Is it a bug or normal behaviour?

    UPDATE:
    I solved this by using Text constant where I placed the text, and used that constant in Source Expression. I should do that in the first place #-o
    Basically whenever one hits the limit of something, it is probably bad design that causes the problem :lol:
  • DenSterDenSter Member Posts: 8,305
    It is normal behavior. The SourceExpr property is intended to hold a reference to a variable or a field in a table. I was surprised it even holds as many as 255 characters.

    Good work figuring this one out, and thanks for sharing it with us. Your solution of using a text constant is a very good choice =D>
  • David_SingletonDavid_Singleton Member Posts: 5,479
    It seems that Source Expression is limited to 255 chars max, but why it allows me to enter more than 255 chars if it can't read it later?!

    Is it a bug or normal behaviour?

    I am not certain, but I think this stems from a bug in an earlier version of NAV. Basically in that version, if you had a normal user license, lets say you have a table and a form. You have code that references a field in the table. You open the table and delete the field. Now open the form and obviously you get a "Variable not found error" but this would place the cursor on the code with the error. Basically like hitting F9, so now you have full access to start writing code, which of course should not be possible without a full developer license.

    So the next version changed this that an error like this would just give an error and bomb out. As I said it sounds like something similar. I know that a similar issue happens if you have a line of C/SIDE that references fields, and is at the limit of line length. If you change the name of the field and increase it, and then the line is longer than the limit, then it just kills the line and the object is a mess.
    David Singleton
  • anil_mujagicanil_mujagic Member Posts: 91
    DenSter wrote:
    It is normal behavior. The SourceExpr property is intended to hold a reference to a variable or a field in a table. I was surprised it even holds as many as 255 characters.
    I do not agree that it is normal behaviour to allow entering more than 255 chars in source expression property if it will not be readable later and if it will cause object corruption.
    They should fix this somehow, or at least notify user that entering more than 255 chars could/will cause object corruption.
  • David_SingletonDavid_Singleton Member Posts: 5,479
    DenSter wrote:
    It is normal behavior. The SourceExpr property is intended to hold a reference to a variable or a field in a table. I was surprised it even holds as many as 255 characters.
    I do not agree that it is normal behaviour to allow entering more than 255 chars in source expression property if it will not be readable later and if it will cause object corruption.
    They should fix this somehow, or at least notify user that entering more than 255 chars could/will cause object corruption.

    How?
    There just isn't anyway to know. For example the case I mentioned above. How can the compiler knowthat in the future you will increase the length of the contents of a variable?
    David Singleton
  • DenSterDenSter Member Posts: 8,305
    You said:
    Is it a bug or normal behaviour?
    And I replied:
    DenSter wrote:
    It is normal behavior.
    Whether it should be like that or not is open for debate, and I might even agree with you that it should not happen that way. I don't always like it that the compiler doesn't catch everything, but it is normal behavior :mrgreen:
  • djswimdjswim Member Posts: 277
    Svi troškovi koji nastanu nakon tog dana padaju na vaš teret (startni honorar advokatske kancelarije je 1.000 KM, na koji se dodaju svi ostali troškovi, uključujući i njihove dnevnice, zatim sudski troškovi i takse...).

    Stop letting your cat run across your keyboard :D
    "OMG ALL MY DATA IS GONE"
    "Show All..."
    "Oh..."
Sign In or Register to comment.