Hi all,
What is the best way to create reports with FX? I am looking to create HTML or
PDF reports.
Any ideas?
Many thanks
Stuart
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://rubyforge.org/pipermail/fxruby-users/attachments/20090308/516c3d66/attachment.html>
On Mar 8, 2009, at 11:30 AM, Stuart Clarke wrote:> What is the best way to create reports with FX? I am looking to > create HTML or PDF reports. > > Any ideas?Not sure exactly what you have in mind, but have you looked at Ruport (http://rubyreports.org/)? FOX (and therefore) doesn''t have any capability for generating or displaying HTML or PDF documents. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/fxruby-users/attachments/20090308/7a0bd0bb/attachment.html>
Hi, We are simply MS Access for reporting in our software. This is absolutely not cross-platform, but it works, and works well. With a few COM calls, you can integrate MS Access into your application. And thanks to the MS Access runtime, you don''t need a licence of MS Access on each computer. Philippe Lang Attik System http://www.attiksystem.ch/beerp/beerp-the-fxruby-erp/ <http://www.attiksystem.ch/beerp/beerp-the-fxruby-erp/> _____ De : fxruby-users-bounces at rubyforge.org [mailto:fxruby-users-bounces at rubyforge.org] De la part de Stuart Clarke Envoy? : dimanche, 8. mars 2009 17:31 ? : fxruby-users at rubyforge.org Objet : [fxruby-users] Reporting with FX Hi all, What is the best way to create reports with FX? I am looking to create HTML or PDF reports. Any ideas? Many thanks Stuart -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/fxruby-users/attachments/20090309/0f094bf4/attachment.html>
Ok thanks, I will check that out.
Also, I am writing a help file for the GUI which I want to be a compiled html
file. I want to launch this file in its native format (outside of fox), how
would I do this this with FX. To clarify, when a user clicks the help button a
help sheet will appear either chm or a PDF in adobe pdf reader.
Thanks for your help.
Stuart
--- On Sun, 8/3/09, Lyle Johnson <lyle at lylejohnson.name> wrote:
From: Lyle Johnson <lyle at lylejohnson.name>
Subject: Re: [fxruby-users] Reporting with FX
To: fxruby-users at rubyforge.org
Date: Sunday, 8 March, 2009, 10:30 PM
On Mar 8, 2009, at 11:30 AM, Stuart Clarke wrote:
What is the best way to create reports with FX? I am looking to create HTML or
PDF reports.
Any ideas?
Not sure exactly what you have in mind, but have you looked at Ruport
(http://rubyreports.org/)?
FOX (and therefore) doesn''t have any capability for generating or
displaying HTML or PDF documents._______________________________________________
fxruby-users mailing list
fxruby-users at rubyforge.org
http://rubyforge.org/mailman/listinfo/fxruby-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://rubyforge.org/pipermail/fxruby-users/attachments/20090309/c120fbaf/attachment.html>
On Mon, Mar 9, 2009 at 6:23 AM, Stuart Clarke <stuart_clarke86 at yahoo.com> wrote:> Also, I am writing a help file for the GUI which I want to be a compiled > html file. I want to launch this file in its native format (outside of fox), > how would I do this this with FX. To clarify, when a user clicks the help > button a help sheet will appear either chm or a PDF in adobe pdf reader.Right. I haven''t used it, but for a nice cross-platform approach I think you''d want to check out Jeremy Hinegardner''s Launchy: http://copiousfreetime.rubyforge.org/launchy/ Hope this helps, Lyle
Stuart Clarke wrote:> Ok thanks, I will check that out. > > Also, I am writing a help file for the GUI which I want to be a compiled > html file. I want to launch this file in its native format (outside of > fox), how would I do this this with FX. To clarify, when a user clicks > the help button a help sheet will appear either chm or a PDF in adobe > pdf reader.I''ve never used it but the launchy gem seems to be a popular way to open external apps in a cross-platform way. -- vjoel : Joel VanderWerf : path berkeley edu : 510 665 3407
Joel VanderWerf wrote:> Stuart Clarke wrote: >> Ok thanks, I will check that out. >> >> Also, I am writing a help file for the GUI which I want to be a >> compiled html file. I want to launch this file in its native format >> (outside of fox), how would I do this this with FX. To clarify, when a >> user clicks the help button a help sheet will appear either chm or a >> PDF in adobe pdf reader. > > I''ve never used it but the launchy gem seems to be a popular way to open > external apps in a cross-platform way.Oops, now I realize Lyle said exactly the same thing earlier... Btw, this is more of a ruby question than a fxruby question. You may get more opinions if you ask on the ruby-talk list. But it may be worthwhile to take a look at launchy first. -- vjoel : Joel VanderWerf : path berkeley edu : 510 665 3407
Hi,
I even have a class for you:
------------------
require ''win32ole''
module Output
# Singleton class used in order to manipulate MS Access
class Access
private_class_method :new
@@access = nil
# Returns a valid Access class
def Access.open(database)
@database = File.expand_path(database)
self
end
# Destroys any remaining Access internal reference
def Access.close
@@access.quit
rescue
#puts "Could not close the MS Access OLE object."
end
# Creates a fresh MS Access OLE Automation server.
def Access.init
Access.close
@@access = WIN32OLE.new(''Access.Application'')
@@access.OpenCurrentDatabase(@database)
end
# Runs the command. The first parameter is the name of the function, and
# the other parameters are the parameters of the function
def Access.run_command(command, *param)
begin
@@access.run(command, *param)
rescue
#puts "MS Access call failed. It might have been closed meanwhile,
so we do a second attempt after initializing MS Access again."
Access.init
@@access.run(command, *param)
end
rescue
Access.close
raise _("Win32 OLE error: could not run the command.")
end
# Prints a MS Access report on the default printer
# without showing the print dialog.
def Access.print_report(report, where = "")
# We try closing the Access report.
begin
Access.close_report(report)
rescue
#puts "Closing MS Access call failed."
end
# We try printing the MS Access report.
begin
@@access.DoCmd.OpenReport(report, 0, "", where)
rescue
#puts "MS Access call failed. It might have been closed meanwhile,
so we do a second attempt after initializing MS Access again."
Access.init
@@access.DoCmd.OpenReport(report, 0, "", where)
end
rescue
Access.close
#raise _("Win32 OLE error: could not print the Access report.")
end
# Shows a MS Access report without printing it.
def Access.show_report(report, where = "")
# We try closing the Access report.
begin
Access.close_report(report)
rescue
#puts "Closing MS Access call failed."
end
# We try showing the MS Access report.
begin
@@access.DoCmd.OpenReport(report, 2, "", where)
@@access.visible = true
rescue
#puts "MS Access call failed. It might have been closed meanwhile,
so we do a second attempt after initializing MS Access again."
Access.init
@@access.DoCmd.OpenReport(report, 2, "", where)
@@access.visible = true
end
rescue
Access.close
#raise _("Win32 OLE error: could not show the Access report.")
$app.endWaitCursor()
FXMessageBox.error($wrk, MBOX_OK, _("Error"), "Le report
est vide, impossible de l''afficher.")
$app.beginWaitCursor()
end
# Closes a MS Access report.
def Access.close_report(report)
@@access.DoCmd.close(3, report)
end
end
end
------------------
You can use it that way:
db = Access.open("reporting.mdb")
db.run_command("get_document_bvr_store", @id.val)
db.show_report("document_bvr")
... where "get_document_bvr_store" is a function like:
------------------
Option Compare Database
Option Explicit
Const GUIL = """"
Const APOST = "''"
Public Sub get_document_bvr_store(document As String)
On Error GoTo get_document_bvr_storeError
Dim MyDatabase As DAO.Database
Dim MyQueryDef As DAO.QueryDef
Dim query As String
setMouseWait
query = "get_document_bvr"
Set MyDatabase = CurrentDb()
If (QueryExists(query)) Then MyDatabase.QueryDefs.Delete query
Set MyQueryDef = MyDatabase.CreateQueryDef(query)
MyQueryDef.Connect = "ODBC;DSN=soagesmat;"
MyQueryDef.SQL = "SELECT * FROM public." &
"""" & query & """" &
"(" & document & ");"
MyQueryDef.ReturnsRecords = True
MyQueryDef.Close
Set MyQueryDef = Nothing
MyDatabase.Close
Set MyDatabase = Nothing
get_document_bvr_storeExit:
setMouseNormal
Exit Sub
get_document_bvr_storeError:
MsgBox "Error in get_document_bvr_store."
Resume get_document_bvr_storeExit
End Sub
---------------------
This function modifies a query at run-time. This query is used as a datasource
for the report you want to open.
Regards,
Philippe
________________________________
De : Stuart Clarke [mailto:stuart_clarke86 at yahoo.com]
Envoy? : lundi, 9. mars 2009 20:14
? : Philippe Lang
Objet : RE: [fxruby-users] Reporting with FX
Hi,
Thanks for the reply. Do you have any documentation on this? Sounds interesting.
Regards
Stuart
--- On Mon, 9/3/09, Philippe Lang <philippe.lang at attiksystem.ch> wrote:
From: Philippe Lang <philippe.lang at attiksystem.ch>
Subject: RE: [fxruby-users] Reporting with FX
To: stuart_clarke86 at yahoo.com, fxruby-users at rubyforge.org
Date: Monday, 9 March, 2009, 8:40 AM
Hi,
We are simply MS Access for reporting in our software. This is absolutely not
cross-platform, but it works, and works well. With a few COM calls, you can
integrate MS Access into your application. And thanks to the MS Access runtime,
you don''t need a licence of MS Access on each computer.
Philippe Lang
Attik System
http://www.attiksystem.ch/beerp/beerp-the-fxruby-erp/
<http://www.attiksystem.ch/beerp/beerp-the-fxruby-erp/>
________________________________
De : fxruby-users-bounces at rubyforge.org [mailto:fxruby-users-bounces at
rubyforge.org] De la part de Stuart Clarke
Envoy? : dimanche, 8. mars 2009 17:31
? : fxruby-users at rubyforge.org
Objet : [fxruby-users] Reporting with FX
Hi all,
What is the best way to create reports with FX? I am looking to create HTML or
PDF reports.
Any ideas?
Many thanks
Stuart