Crystal Reports Assistance Request

9 views
Skip to first unread message

Lance Larsen

unread,
Jun 10, 2010, 4:30:30 PM6/10/10
to madd...@googlegroups.com
Ok, wanted to reach out to the group to see if others have more experience with Crystal Reports than I...
 
So, here's the sitauation...
 
1) I'm much more used to SRSS (SQL Reporting) - but using Crystal is required for this one - as on the business side they have an individual that is building the reports.
 
2) So, we have an ASP.NET project -- and I want to be able to have the user click on a Report name -- that list of reports being pulled from a database.
 
3) When the user clicks on the report, it doesn't display to the user immediately - it gets queued for processing - and uploaded into my FileRepository application (essentially a attachments database exposed through a WebService).  The user then goes to a generated reports page - and that pulls the reports from the FileRepository application - thus for the FDA everything that is generated is logged first.
 
4) I'm thinking that I build another WebService - that would handle the "generate" report request - and then it would then take that generated report and stick it into the FileRepository.
 
So --- what I'm really looking for help from those that may have already done this is...
 
1) How to (outside of the Crystal Reports viewer) call and generate a report in the code behind, and then allow me to do something with it - i.e. stick it in the attachments db, or email it, etc. 
 
2) If anyone has ( or has seen ) a good example of retrieveing RPT files from a DB as well - that would be cool...
 
Thanks in advance...
 
Back to searching for better examples...
 
....Lance :)

Adam

unread,
Jun 11, 2010, 9:06:22 AM6/11/10
to MadDotNet
Disclosure: I am anti-crystal, so this reply will have more then a few
cheap shots at it, along with some sarcasm ;)

So one person's inability to use something other then crystal is going
to cost the state tens of thousands of dollars in lost developer
productivity? Heh, sorry, I always get a kick out of these kinds of
things.

I know you can invoke a crystal report from a VBScript, because that's
how things were done on my wife's team before I led her to the
promised land of SSRS. I'll see if I can get something from her
(assuming they didn't burn the server that crystal was installed on).

I'd be more concerned with the user experiance. If I click on a link
to view a report, I expect it right away (this isn't even a SSRS vs.
Crystal thing), and I wouldn't want to have to goto another page and
search for my generated report.

Could you do something whereby you get the data required for the
report (snapshot) and use it to generate a report immediantly, while
at the same time sending the data off to your processing module to
satisfy the archiving process? In re-reading your post, that sounds
what you're trying to do with the second (new) web service.

Do the reports need to be generated when the user requests, or could
they be generated nightly ahead of time?

Adam

unread,
Jun 11, 2010, 9:35:02 AM6/11/10
to MadDotNet
So I got the script files I was talking about. Basically they are
creating an instance of the crystal runtime, opening the report,
exporting the data as an xls and then e-mailing that. So I guess you'd
be looking at exporting to PDF and uploading the PDF to your
repository. Maybe throw in some AJAX on the web page to display a
"Your report is being prepared" message that then redirects to the PDF
once it's been uploaded to the repository.

And for the non SSRS people out there, most of this functionality is
built into to SSRS and exposed via a web service. With Crystal, you
have to re-invent the wheel a bit. Not the end of the world, but if
you are using SQL server already, kind of silly to pay for crystal
licenses.

------------------------------------------------------------------------------------------------------------------------------

Set AppCrystal = WScript.CreateObject("CrystalRuntime.Application")

Set CrystalReport = AppCrystal.OpenReport("C:\SomeFolder
\SomeReport.rpt")

'Set Export options
Set CrystalOptions = CrystalReport.exportOptions

'There are lots of options, see documentation
With CrystalOptions
.DestinationType = 1
.FormatType = 36
End With

CrystalOptions.DiskFileName = "C:\SomeExportLocation
\ExportedFile_UniqueIdentiferGoesHere.xls"

'Run the report and export the data based on export options set above
CrystalReport.Export False
> > ....Lance :)- Hide quoted text -
>
> - Show quoted text -

Aaron Hoffman

unread,
Jun 11, 2010, 10:52:23 AM6/11/10
to MadDotNet
There is definitely a way to generate a report on the server (in code
behind), but unfortunately, I no longer have access to the code that
performed that. I do remember that it was part of the Crystal Reports
library, so it is out-of-the-box functionality.

I remember that you first had to open the report (for us the .RPT
report files were on the disk but if you read in from a DB it should
not be to difficult to simulate something like that), then call a
method on the Crystal Reports "Engine" (might have been what it was
called) sending in the Report File, the DataSet to bind to, and the
output format. The method would return a byte array containing the
generated .PDF report.


On Jun 10, 3:30 pm, Lance Larsen <lancewlar...@gmail.com> wrote:

Lance Larsen

unread,
Jun 11, 2010, 11:13:13 AM6/11/10
to madd...@googlegroups.com
Firstly - thanks for the feedback Adam/Aaron :)
 
I've figured out how to do it the way Aaron is referring to (mostly) -- the issue with that for me is that the other individual who is making the reports sets all the database connections, etc through the Crystal Wizard -- and if I were to do it the way to which you're referring (as far as I understand it) - I'd have to build all the datasources, etc loosing all the configurations that are built in.
 
Adams solution is intriguing, as I would not loose the built in datasource -- trying to convert the following to C# though...
 
Set AppCrystal = WScript.CreateObject("CrystalRuntime.Application")
 
Reading that I should either be using something like...
 
object obj = Activator.CreateInstance(Type.GetTypeFromProgID("Some.Application"));

That or add the COM objects as a reference...
 
Still working through those -- if anyone figures it out before I, let me know.
 
Discussions like these are why this list is such a great resource for the members of the group, collectively small efforts build to a large reward for everyone overall. :)
 
Thx.
 
...Lance
 
--
You received this message because you are subscribed to the Google Groups "MadDotNet" group.
To post to this group, send email to madd...@googlegroups.com.
To unsubscribe from this group, send email to maddotnet+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/maddotnet?hl=en.


Jim Tankersley Jr

unread,
Jan 8, 2015, 11:35:58 PM1/8/15
to madd...@googlegroups.com
FYI,

http://www.windowsgames.co.uk/slay.html

Sean O'Connor's Games: Slay
Reply all
Reply to author
Forward
0 new messages