Report in Xojo Web App

Can Anyone tell me the process of create report in Xojo web Application using HTML Viewer & Sqlite Database. If anyone Can Then Pls help me.

Your looking to create an HTML Report or view an HTML Report?

Create a report in PDF Format & data provided to report from SQLite Database. If there is any solution then pls help me on this topic.

I tried with valentina reporting tools but i can’t succeed. So if there is any other way to create report in a xojo web app then pls tell me.

Xojo does not have built in PDF creation; however, I have used the following in the past:

  1. BK Shorts used with MBS DynaPDF

  2. generate the HTML Report and use something like wkhtmltopdf to generate pdf file.

now a days… I go with recommendation 1.

Thanks… If you have any code written for report creation then share with me. It helps me a lot.

The code I have written doesn’t belong to me but my employer; however, Bob and Christian have done a terrific job in providing example projects as well has user manuals.

for wkhtmltopdf, here is a link User Manual that covers options that can be used. the one thing to note though… if you go with wkhtmltopdf, you are bounded by how HTML would print to a printer and will need to tailor your HTML file to be print friendly.

If however, you are looking to generate an HTML file and display to an HTML Viewer without PDF… then you could easily generate an XML file and transform it with XSL to create an HTML file for viewing.

I use valentina Rep on web works fine
Is no perfect but works

Is there is any site where i can get more information for create report in XOJO Web application. Because i have to give a pdf report format in my project & i didn’t get any suitable example from any where.
Although i got example on Valentina tools but it uses the valentina server database where i have to provide data from local sqlite database to report & then print this as a pdf. So if there is a better solution then pls help me on this topic. Because only for the report part i can’t submit my project to my college.

Can you tell me the process of how to use valentina report with local sqlite database @Alexis Colon Lugo.

Can anyone tell me the process of how to use valentina report with local sqlite database

Looks like the creator of Valentina Reports has an example: WebOnSQLite Example

I do aproject using the example but i got error as a NilException. Is there is any way to create report in XOJO web application then pl give me the examples with some code.

Session.projectPath = GetFolderItem(“WebRep_GasDB.vsp”)

Session.mProject = new VProject(Session.projectPath)

Session.mProject.Open()

if Session.mProject <> nil then
Session.vCounts = Session.mProject.ReportCount()
end if

if TxtCaja.Text.Trim<>"" Then

Session.SqlStr="Select  invoicedt.cajareg,departamento.name as name ,sum(extprice) as sTotal, sum(citytaxv)+sum(statetaxv) as TotalTax, sum(citytaxv+statetaxv) +sum(extprice) As TotalFin , sum(qty) as sQty From invoicedt Left JOIN" _
+" departamento on invoicedt.departamento=departamento.id Where cajareg=" + TxtCaja.Text.Trim + " and tipo='V' and grupacc<>101 GROUP BY departamento.name,invoicedt.cajareg Order By departamento.name "

try
  mReport = Session.mProject.MakeNewReport(  "Ventas_Dep_Rep", Session.RepStrConn, Session.SqlStr  )
catch e as VException
  dim errNumber as Integer = e.ErrorNumber
  dim errString as String = e.Message
end


try
  
  data = mReport.PrintToBuffer( EVReportPrintType.kToPDF, 1)
  
Exception err as VException
  dim errNumber as Integer = err.ErrorNumber
  dim errString as String = err.Message
end

Session.mPDF = New WebFile
Session.mPDF.MimeType = "application/pdf"
Session.mPDF.ForceDownload = True
Session.mPDF.FileName = "report.pdf"
Session.mPDF.Data = data

ShowURL( Session.mPDF.URL )

TxtCaja.Text=""

else
MsgBox " Entre el Numero de Caja "
TxtCaja.SetFocus
end if

Session.projectPath = GetFolderItem(“WebRep_GasDB.vsp”)

Session.mProject = new VProject(Session.projectPath)

Session.mProject.Open()

if Session.mProject <> nil then
Session.vCounts = Session.mProject.ReportCount()
end if

if TxtCaja.Text.Trim<>"" Then

Session.SqlStr="Select  invoicedt.cajareg,departamento.name as name ,sum(extprice) as sTotal, sum(citytaxv)+sum(statetaxv) as TotalTax, sum(citytaxv+statetaxv) +sum(extprice) As TotalFin , sum(qty) as sQty From invoicedt Left JOIN" _
+" departamento on invoicedt.departamento=departamento.id Where cajareg=" + TxtCaja.Text.Trim + " and tipo='V' GROUP BY departamento.name,invoicedt.cajareg Order By departamento.name "

try
  mReport = Session.mProject.MakeNewReport(  "Ventas_Dep_Rep", Session.RepStrConn, Session.SqlStr  )
catch e as VException
  MsgBox "MakeNew " + Session.RepStrConn
  dim errNumber as Integer = e.ErrorNumber
  dim errString as String = e.Message
end


try
  
  data = mReport.PrintToBuffer( EVReportPrintType.kToHTML, 1 )
  
Exception err as VException
  MsgBox "View " + Session.RepStrConn
  dim errNumber as Integer = err.ErrorNumber
  dim errString as String = err.Message
end

HTMLViewer1.LoadPage( data )

TxtCaja.Text=""
TxtCaja.SetFocus

Else
MsgBox “Entre el Numero de Caja”
TxtCaja.SetFocus
end if

@ Alexis Colon Lugo Can you share me the screen means how to design the report locally in valentina studio

How to Obtain the path for the local sqlite database in valentina report.?

dim db_lite_location as FolderItem = getFolderItem("").Parent.Child( “reports_db.sqlite” )

// Extract path as string:
dim db_lite_path as string = db_lite_location.ShellPath

// -----------------------------------------------------------
// ShellPath returns us escaped POSIX Path. We need NOT escaped.
// In your own code you should use free plugin http://code.google.com/p/macoslib/
// to get not escaped path.
// In this example we will just replace "\ " to " " to not depend on third party plugin.
//
db_lite_path = ReplaceAll( db_lite_path, "\ ", " " )

// Produce datasource-string
mDataSource_SQLite = “sqlite://” + db_lite_path

https://www.youtube.com/playlist?list=PLBEF9A637E1EDD4E9

https://www.youtube.com/playlist?list=PLBEF9A637E1EDD4E9