|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
AT&T devCentral & BlackBerry(r) Webcast Series: BlackBerry and GPS -Build Location Awareness into your BlackBerry Applications, July 10th-1:00PM EST. Register Today!
|
|
#1
|
||||
|
||||
|
ROR and Crystal Report Viewer?
I have written an application in ROR, and have now come to the reporting piece. Reports will be written in Crystal and I'm wondering if ROR will allow me to utilize the Crystal Reports Viewer. Has anyone had any experience with this? Any opinions or advice always appreciated!
Thank you! |
|
#2
|
||||
|
||||
|
Crystal reports can be configured to read XML input and format it accordingly. Hence, you can use a rails handler to output your report data in XML format and that should allow crystal reports to read from it.
__________________
Up the Irons What Would Jimi Do? Smash amps. Burn guitar. Take the groupies home. "Death Before Dishonour, my Friends!!" - Bruce D ickinson, Iron Maiden Aug 20, 2005 @ OzzFest Down with Sharon Osbourne Puzzle of the Month solved by sizeablegrin, etienne141 and L7Sqr, superior C/C++ programmers of the month |
|
#3
|
|||
|
|||
|
ROR and Crystal Report Viewer
Quote:
My reports use xml schemas (xsd) and they get fed at runtime using .net dataset. I know this is possible in .net but how is it possible in ROR? How is the xml data fed to these reports in Ruby. Plus what about the report viewer? sumeet chadddha |
|
#4
|
||||
|
||||
|
If you're using RoR, the part that gets the data should be a method in the model/ directory. For instance:
Code:
class MyData < ActiveRecord::Base
def self.getmydata(key)
find(:all, :conditions => ["field1 = ?", key])
end
end
Then, your controller class would look something like this: Code:
class mycontroller < ActionController
def xml_output
id = params[:id]
@data = MyData.getmydata(id)
end
end
and your view template for xml_output.rhtml could look something like this: Code:
<data>
<% for item in @data %>
<item>
<id><%= item.id %></id>
<name><%= h(item.name) %></name>
<desc><%= h(item.desc) %></desc>
</item>
<% end %>
</data>
|
![]() |
| Viewing: Dev Shed Forums > Programming Languages > Ruby Programming > ROR and Crystal Report Viewer? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|