Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document Builder got an issue when i clicking on Create Document or Generate Document button #3

Open
naveen7177 opened this issue Oct 21, 2021 · 31 comments

Comments

@naveen7177
Copy link

Hi,
i follow the given below link example code
https://api.onlyoffice.com/docbuilder/integratingdocumentbuilder
I integrated above example code and it executed successfully, but when i am clicking on "Create document" getting any issue .

I attached two Screen short please find below
1
2
Thank you

@ShockwaveNN
Copy link

Hi, which programming language example do you used? nodejs?

@naveen7177
Copy link
Author

naveen7177 commented Oct 21, 2021 via email

@ShockwaveNN
Copy link

I've checked node.js example and this seems fine

I think we do not checked or setup C# for quite long time and need time to figure out

@naveen7177
Copy link
Author

okay

@naveen7177
Copy link
Author

I attached project file once check it Thank you
DocumentBuilderMVC.zip

@ShockwaveNN
Copy link

DO you modified original source? Or it's same package

@naveen7177
Copy link
Author

naveen7177 commented Oct 21, 2021 via email

@ShockwaveNN
Copy link

Got it thanks, if you have better experience with c# than us - you can compare sources with nodejs and maybe figure out yourself why nodejs example is working and c# is not

@LinneyS LinneyS transferred this issue from ONLYOFFICE/DocumentServer Oct 22, 2021
@LinneyS
Copy link
Member

LinneyS commented Oct 22, 2021

return $.extend({}, getDefaults(), toastr.options);

An error in the specified line indicates that the jQuery script is not connected.

It connects here in this line

as bundle

bundles.Add(new ScriptBundle("~/bundles/jquery").Include(
"~/Scripts/jquery-{version}.js"));

Please check that the script came to the page, and the value of $ is defined.

@LinneyS
Copy link
Member

LinneyS commented Oct 22, 2021

@naveen7177
To call the builder script, fill in the lines Name, Company, Position/Title

@naveen7177
Copy link
Author

naveen7177 commented Oct 25, 2021

"~/Scripts/jquery-{version}.js")

i am follow the same but still issue is persisting .
directly i am calling "Scripts and js" file into Layout page like below

<script src="~/Scripts/toastr.js"></script> <script src="~/Scripts/script.js"></script> <script src="~/Scripts/jquery-3.6.0.min.js"></script> I Attached Layout page Screen shot page.

image

@naveen7177
Copy link
Author

@naveen7177 To call the builder script, fill in the lines Name, Company, Position/Title

Sorry, I'm not getting which Builder script you are talking about
and where to fill the lines Name, Company, Position/Title
Thank you.

@ShockwaveNN
Copy link

We recheked our example and it's working fine

Could you show any JS error in browser console when you calling it?

And I see you've made modifications in script, please revert it all back - on our end everything works fine without any modifications

@naveen7177
Copy link
Author

1.when i click on "Create Document" showing the error like below screen shot
image

2.instead of using Bundles i am directly calling Scripts and css in Layout page. other things are as it is

@ShockwaveNN
Copy link

Sorry, I'm out of ideas, everything works fine for us

BTW this example is rather simple and I think from code your should get general idea how to use it

@naveen7177
Copy link
Author

Hi ,
now execution is working fine the error message is solved . but elements are not replacing for Create document i am changing the Name,Company,Title but values are not replacing

@naveen7177
Copy link
Author

this function return the "null"

public static string ReadTextFromEmbeddedResource(Assembly assembly, string resourceName)
{
var result = string.Empty;

        using (var stream = assembly.GetManifestResourceStream(resourceName))
        {
            if (stream != null)
            {
                using (var sr = new StreamReader(stream))
                {
                    result = sr.ReadToEnd();
                }
            }
        }

        return result;
    }

@ShockwaveNN
Copy link

ShockwaveNN commented Oct 25, 2021

Just to be sure - which version of DocumentBuilder did you've installed?

DocumentBuilder iteslef, application, not test example

@naveen7177
Copy link
Author

documentBuilder version is 6.4.1.49

@ShockwaveNN
Copy link

Sorry, now I'm out of ideas - maybe setup node.js example and compare execution results

Or any other example which will work on Linux - at least we will be able to do some docker version to make sure that it'll work even on your system

@naveen7177
Copy link
Author

Screenshot (2)
how to update document builder

@ShockwaveNN
Copy link

I'm not good with c# code, but I think this is version of example page, not DocumentBuilder itself

@naveen7177
Copy link
Author

you said example code is working fine.
but same example code i am implementing everything is working fine but i filed with another Name, Company and Title but in document not reflecting
i need your support , how to update document builder version in my visual studio

@ShockwaveNN
Copy link

but same example code i am implementing everything is working fine but i filed with another Name, Company and Title but in document not reflecting

We'll have a look once again

how to update document builder version in my visual studio
documentBuilder version is 6.4.1.49

This is the latest version

@naveen7177
Copy link
Author

  1. 3
    2.Screenshot (2)
    In the 1st screen shot, while i am clicking on create document button it is hitting the highlighted line. The variable "templateText" returning null value as the function "ReadTextFromEmbeddedResource" returning null values.
    hence,
    var inputText = customerData.Aggregate(templateText,
    (current, substitution) =>
    current.Replace(substitution.Key, substitution.Value));
    The values/elements are not substituting with new values

@l8556
Copy link
Member

l8556 commented Oct 26, 2021

you said example code is working fine. but same example code i am implementing everything is working fine but i filed with another Name, Company and Title but in document not reflecting

Hi! I have checked c# mvc on Windows 10 and everything works correctly.

csharp_mvc.mp4

@naveen7177
Copy link
Author

Okay,
using (var stream = assembly.GetManifestResourceStream(resourceName))
{
if (stream != null)
{
using (var sr = new StreamReader(stream))
{
result = sr.ReadToEnd();
}
}
}

what is the value returned by stream variable in your system? actually in My system it is returning null value.
Could you please confirm .
Thank you

@l8556
Copy link
Member

l8556 commented Oct 28, 2021

what is the value returned by stream variable in your system? actually in My system it is returning null value.
Could you please confirm .

In my system, when creating a document, the variable "stream " has the value "System.IO.UnmanagedMemoryStream"
Screenshot_2
log
.

@naveen7177
Copy link
Author

Screenshot (14)
but my stream value showing null .
can you please tell me what is the issue

@ShockwaveNN
Copy link

Sorry, we just QA team with @l8556 and don't have underlying knowledge, especially in C#

Maybe @LinneyS have some ideas

@SergeyKorneyev
Copy link

Hi @naveen7177
You could try downloading and checking out the C# MVC example from the following page instead of Github: https://api.onlyoffice.com/docbuilder/integratingdocumentbuilder.
But, overall, what you're asking is help with C#, which has nothing to do directly with the Document Builder.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants