B4J Question jNxtReportsB4J, try next report 9.1, OutFile problem in PDF

magi6162

Well-Known Member
Licensed User
I use this code: (I use it in a web application with ABMaterial)
B4X:
'    Dim os As String = GetSystemProperty("os.name", "").ToLowerCase
    Dim filesep As String
    If os.Contains("win") Then
        filesep="\"
    Else
        filesep="/"
    End If
    Dim orig As String = "www" & filesep & ABMShared.AppName & filesep
 
    Private reportparams As Map
    Dim nr As jNxtReportsB4J
    Dim jdbcUrl As String
    jdbcUrl = ABMShared.MySQLConnectionString("localhost","3306","xxxxxxxx")
 
    Dim orig As String = "www" & filesep & ABMShared.AppName & filesep
    reportparams.Initialize
    reportparams.Put("ReportFolder" , File.DirApp & filesep & orig & "reports"                    )
    reportparams.Put("ReportName"   , "cartolina"                                                 )
    reportparams.Put("ReportOutName", File.DirApp & filesep & orig & "pdf" & filesep & "cartolina")
    reportparams.Put("ReportOutType", "PDF"                                                       )
    reportparams.Put("DriverClassDB", "com.mysql.jdbc.Driver"                                     )
    reportparams.Put("UrlDB"        , jdbcUrl & "?useSSL=false&user=xxxxx&password=xxxxx"       )
 
    Dim inputlist As List
    inputlist.initialize
    inputlist.Add(reportparams.Get("ReportFolder" ))
    inputlist.add(reportparams.Get("ReportName"   ))
    inputlist.add(reportparams.Get("ReportOutName"))
    inputlist.add(reportparams.Get("ReportOutType"))
    inputlist.add(reportparams.Get("DriverClassDB"))
    inputlist.add(reportparams.Get("UrlDB"        ))

    nr.reportPrepAndRun(inputlist)
 

Attachments

  • Cattura9.PNG
    Cattura9.PNG
    21.3 KB · Views: 230
  • Cattura10.PNG
    Cattura10.PNG
    8.8 KB · Views: 241
Last edited:

Harris

Expert
Licensed User
PDF format does not adjust columns to fit the page automatically - as opposed to HTML output.
Try to print HTML output. It will not automatically adjust cols to fit printed page...

You will have to use fixed column widths according to your page size (Four Arrow Icon top left on Layout Perspective).
Adjust col widths accordingly and wrap text if required. You may adjust page padding to make left/right margins smaller if required.
 
Upvote 0

magi6162

Well-Known Member
Licensed User
Excuse my approximate English.
I was referring to fonts ...:rolleyes: (I can not change it, always use the default one (at least with the PDF)
However seen (wow! ... 93 mb) I will work with NR 9.1.
I beg your pardon from now if I bore you to death ...;)
 
Upvote 0

magi6162

Well-Known Member
Licensed User
lucky you..
In the designer, I change the font, but when I run the report and create the PDF, I do not use the font I chose in design mode.
I do not know if I managed to get away well.
 
Upvote 0

Harris

Expert
Licensed User
What font are you using... (size, B/I) etc...
I am creating a report in NR right now so I can try your font and see what happens on my end...
 
Upvote 0

Harris

Expert
Licensed User
You are correct! I have never noticed this since I always use Arial for my reports...
Does not matter what font you choose, in PDF, it is always Arial.
HTML does respect your selected font.

You could search the NR forum to see if anyone has posted this issue - or post the issue yourself.
Thanks
 
Upvote 0

Harris

Expert
Licensed User
Here is something else to watch out for in NR..

Expression:
$C_trl1id +" "+ $C_trl2id ' This will ADD the two fields together (42,047) - even thou they are specified as STRING values, but happen to be of numeric values...
$C_trl1id +" . "+ $C_trl2id ' This will show the proper result (21023 . 21024) since a period (" . ") was introduced into the concat... Drove me bonkers trying to figure out what the heck the issue was initially...
 
Upvote 0
Top