Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    zewar96
    @zewar96
    Is it better to post in here or on the Forums? I already posted my question on the forum (https://forum.jsreport.net/topic/1665/jsreport-types-missing) but i am not sure which is monitored more
    Jan Blaha
    @pofider
    Hi, I answer on forum
    zewar96
    @zewar96
    @pofider Thank you. i will use that and not clog up both with the same question.
    Hussain
    @hussainb

    Hi... I am trying to access the $pdf object in my handlebars template so that I can write conditional logic for the PDF header based on the pageNumber..... but I am unable to manage to get the $pdf variable working... it probably seems to stay undefined... I tried different ways but I am not able to make it work... PLEASE SOMEONE KINDLY HELP ME..

    more info: using jsreport-core https://github.com/jsreport/jsreport-core in nodejs

    mohamedmonirshabana
    @mohamedmonirshabana
    how i can add fix header and footer to jsreport when data increase add another page
    mohamedmonirshabana
    @mohamedmonirshabana
    i create report in jsreport studio i ake a design by html to generate PDF there is a part of HTML i need to fix it in all document like header and footer
    Jan Blaha
    @pofider
    I'm sorry but I am a bit lost in your question. Please try to reformulate it and elaborate more
    Bruce McElroy
    @visualbam
    Hello friends. I've updated from 2.6 to 2.10. I've set up a header/footer and use the options in studio to merge them. Then I set up toc to be merged in an afterRender function. This was working fine in 2.6. In 2.10, this breaks my page numbers in the toc. If I merge the toc via studio, it works as expected. I can't seem to tell why
    Jan Blaha
    @pofider
    Could you do a minimal zip with export that replicates this and upload it somewhere?
    Bruce McElroy
    @visualbam
    Sure thing! Will come back when I get a chance to do that!
    Bruce McElroy
    @visualbam

    I'm back! I was able to reproduce this using the toc template. Using 2.10.0 you'll notice that the page numbers don't display on the toc. If you run this using 2.6.0 and 1.5.1 pdf-utils, they display fine.

    https://playground.jsreport.net/w/visualbam/Tj6QHPJq

    Bruce McElroy
    @visualbam
    Curious if anyone was able to look at the issue I mentioned? Want to make sure it's not something I'm simply overlooking or using it in a non-intended way
    Jan Blaha
    @pofider
    Hi @visualbam
    I need to give it some more thoughts tomorrow, but I already give you some info. The problem you experience was introduced by this jsreport/jsreport#626
    because the script afterRender runs after the pdf utils, you don't see the hidden information and cannot calculate the pdf page numbers properly
    we were aware of this so we introduced the solution here
    at this moment it should probably work fine for you
    hepple
    @hepple
    Hi, trying to use the docx engine in dotnet core and dynamically passing in an asset but I'm getting an error. Any Ideas?
                string strDocx = _env.WebRootPath + "\\reports\\CV.docx";
                FileInfo fileInfoMain = new FileInfo(strDocx);
                if (fileInfoMain.Exists)
                {
                    FileStream fileStream = fileInfoMain.Open(FileMode.Open, FileAccess.Read);
                    using StreamReader reader = new StreamReader(fileStream);
                    strDocx = await reader.ReadToEndAsync().ConfigureAwait(true);
                    await fileStream.DisposeAsync().ConfigureAwait(true);
                }
                strDocx = strDocx.Replace(Environment.NewLine, string.Empty, StringComparison.InvariantCulture);
    
                Asset myAsset = new jsreport.Types.Asset();
                myAsset.Content = strDocx;
    
                jsreport.Types.Report report = await _jsReportMvcService.RenderAsync(new RenderRequest()
                    {
                        Template = new Template
                        {
    
                            Engine = Engine.Handlebars,
                            Recipe = Recipe.Docx,
                            Docx = new Docx {
                                TemplateAsset = myAsset
                            }
    
                        },
                        Data = null
                    })
                    .ConfigureAwait(true);
    hepple
    @hepple
    Updated the code a bit but still getting an error
    string strDocx = _env.WebRootPath + "\\reports\\CV.docx";
                FileInfo fileInfoMain = new FileInfo(strDocx);
                if (fileInfoMain.Exists)
                {
                    FileStream fileStream = fileInfoMain.Open(FileMode.Open, FileAccess.Read);
                    using StreamReader reader = new StreamReader(fileStream);
                    strDocx = await reader.ReadToEndAsync().ConfigureAwait(true);
                    await fileStream.DisposeAsync().ConfigureAwait(true);
                }
    
                byte[] plainTextBytes = System.Text.Encoding.UTF8.GetBytes(strDocx);
                string strDocTemplate = Convert.ToBase64String(plainTextBytes);
    
    
                jsreport.Types.Report report = await _jsReportMvcService.RenderAsync(new RenderRequest()
                    {
                        Template = new Template
                        {
    
                            Engine = Engine.Handlebars,
                            Recipe = Recipe.Docx,
                            Docx = new Docx
                            {
                                TemplateAsset = new Asset
                                {
                                    Encoding = "base64",
                                    Content = strDocTemplate
                                }
                            }
    
                        },
                        Data = new
                        {
                            message = "Hello world"
                        }
                    })
                    .ConfigureAwait(true);
    Error is JsReportException: Unable to render template. Error while executing docx recipe. invalid comment length. expected: 2. found: 0
    hepple
    @hepple
    Cleadon
    @hep99_twitter
    Hi - are there any docs on how to create address labels in the word template?
    Nicholas D'Autremont
    @Groumph
    Hi, I am having issues with font sizes in jsreport dotnet. Is here a way to pass args down to chrome?
    puppeteer/puppeteer#2410 this has a potential fix I want to try.
    Jan Blaha
    @pofider
    Hi, try to set this environment variable
    chrome_launchOptions_args=--font-render-hinting=none
    before initializing jsreport
    Nicholas D'Autremont
    @Groumph
    Trying it out
    Nicholas D'Autremont
    @Groumph
    Added Environment.SetEnvironmentVariable("chrome_launchOptions_args", "--font-render-hinting=none");
    at the beginning of startup.cs before setting up jsreports. Did not change the fonts.
    Jan Blaha
    @pofider
    are you sure there wasn't jsreport already running? Do you use the "KillRunningProcesses()"?
    Nicholas D'Autremont
    @Groumph
    ILocalWebServerReportingService rs = new LocalReporting()
    .UseBinary(RuntimeInformation.IsOSPlatform(OSPlatform.Linux)
    ? jsreport.Binary.Linux.JsReportBinary.GetBinary()
    : JsReportBinary.GetBinary())
    .KillRunningJsReportProcesses()
    .Configure(cfg => cfg
    .AllowedLocalFilesAccess()
    .FileSystemStore()
    .BaseUrlAsWorkingDirectory())
    .AsWebServer()
    .Create();
            rs.StartAsync().Wait();
    
            services.AddJsReport(rs);
    currently on windows
    Jan Blaha
    @pofider
    ok, that should be ok
    Nicholas D'Autremont
    @Groumph
    Unless you can think of why font sizes are smaller than css/inline is set to. we are setting them as 9px but get 6.5.
    Jan Blaha
    @pofider
    could you put that minimal html/css to the playground and show the problem ?
    Nicholas D'Autremont
    @Groumph

    https://playground.jsreport.net/w/anon/Ud~X3Adi

    the 9px font is 6.5 and the 10px font is 7.5

    Jan Blaha
    @pofider
    how do you actually messure that font is 6.5?
    I am checking the pdf source, and there is the 9
    /F4 9 Tf
    1 0 0 -1 11 18 Tm
    <0037004b004c005600030056004b00520058004f00470003004500480003004900520051005700100056004c005d00480003001c> Tj
    ET
    this is basically saying use the 9px size for some code
    Nicholas D'Autremont
    @Groumph
    I am checking in ms word and our client is use adobe pro and seeing the same thing.
    We have a footer template, it shows as correct 9px in ms word and adobe pro.
    use = using
    Jan Blaha
    @pofider
    I think there is some kind of default 76dpi, so to get the px same in word, you can set to the chrome scale 1.34
    image.png
    but dont know the theory much, and need to go offline for today, good luck...