Can I Use Crystal Reports WITHOUT a Template (.rpt) file ?
I am building an app which has several elaborate reports.
Here is what I need to be able to provide:
To PREVIEW any of these reports to my user, who may then elect to print it,
or SAVE is as a RTF, DOC, PDF, TXT, etc. file.
Crystal Reports has the ability to export/save a report to a variety of formats....
this is GREAT.
But the complexities of creating the report(s) in CR are just too much:
Depending on data extracted from the database,
text font name/size/italics/bold and color will be determined for
a portion of each line,
and can differ in all the above for each portion of text in a line, depending on the data contents.
More data MAY be extracted and reported, depending on the data contents.
Pictures MAY be displayed, depending on the data contents.
So I was wondering if I could somehow create a report using CR methods to
assign text properties and then send the text to the report at specified locations on the report,
and send pictures (extracted from the database) and/or created as separate VB images/pictures to the report at will.
This would all have to be done WITHOUT a template file.
Any thoughts, help, or whatever ???
I have thought of building my own report preview capability,
but the "Save as" RTF, DOC, PDF, TXT, etc., is giving me nightmares.
I have scoured the internet for 2 months trying to come up with a programmatical solution.
Thanks in Advance for ANY help.
Re: Can I Use Crystal Reports WITHOUT a Template (.rpt) file ?
Why does it "have to be done WITHOUT a template file" ????
-tg
Re: Can I Use Crystal Reports WITHOUT a Template (.rpt) file ?
Because the logic to build the report is so convoluted with
respect to database calls which MIGHT create other database calls,
and the formatting of the report data (text) is based on database results,
etc., etc., etc.
And pages MIGHT contain pictures or not, etc., etc.
No Template can be developed (that I am aware of) which can handle
all this dynamic logic.
By the way... there is a 3rd party control out there called PrintPreview,
which I have already installed in the program, which works GREAT !!!!
BUT (there had to be a BUT ......) .....
It does NOT play well with Vista, and the author of the product seems to be unable to fix it (over the past 3 months).
So I am searching for some alternate solution... even building my own Preview.
But my MANDATORY requirement of writing/saving to RTF, DOC, PDF, TXT, etc. is a real hurdle.
Thus this post.
Re: Can I Use Crystal Reports WITHOUT a Template (.rpt) file ?
Quote:
No Template can be developed (that I am aware of) which can handle all this dynamic logic.
Almost every object property can be changed based on a formula. Changing the font name/size/italics/bold/color based on some data condition is trivial but can also be accomplished via code.
Quote:
respect to database calls which MIGHT create other database calls,
Without knowing the report specs all I can suggest is to try sub-reports.
I believe the ability to "create reports" at runtime requires an extra license.
Re: Can I Use Crystal Reports WITHOUT a Template (.rpt) file ?
Yes, the dynamic creation or designing of a report is not in the standard license of Crystal Reports. You need to purchase a license for designing and distributing dynamic reporting.
See the http://businessobjects.com website for actual terms and conditions.
Re: Can I Use Crystal Reports WITHOUT a Template (.rpt) file ?
Quote:
Originally Posted by brucevde
Almost every object property can be changed based on a formula. Changing the font name/size/italics/bold/color based on some data condition is trivial but can also be accomplished via code.
Without knowing the report specs all I can suggest is to try sub-reports.
I believe the ability to "create reports" at runtime requires an extra license.
Adding to that... we even have a report that pulls images out of the database and optionally displays them, so it varies from client to client. Crystal is quite flexible... almost too much so sometimes...
-tg
Re: Can I Use Crystal Reports WITHOUT a Template (.rpt) file ?
Thanks people, for all the responses....
Brucevde
Quote:
Almost every object property can be changed based on a formula. Changing the font name/size/italics/bold/color based on some data condition is trivial but can also be accomplished via code.
I think this is precisely one of my problems
I do not know if a line will contain any text, some text, or various text items
which all might have different properties (font, size, italics, bold, underline, color), until the data is retrieved from the database.
Therefore I do not know what objects will exist until the data is retrieved,
therefore I cannot create a template with objects in it.
RobDog888
Thanks for the hint/tip. I'll pursue that.
Techgnome
Quote:
Adding to that... we even have a report that pulls images out of the database and optionally displays them, so it varies from client to client. Crystal is quite flexible... almost too much so sometimes...
Again, because I don't know if an image will be placed on a page of the report until I retrieve some data, I can't specify that object on a page. If no image is to be placed, then I want text to be in its place; otherwise the image will be there.
I just don't think templates can work.
Re: Can I Use Crystal Reports WITHOUT a Template (.rpt) file ?
I get that... we don't know if there will be an image either... Drop the image where it needs to go, pull up the properties of the item, find the "Suppress" option... click the button to pull up the formula editor, enter the criteria necessary so that True will suppress (hide) the image and false will show the image... save and close. Then drop a text field into the same spot (you can stack things ontop of each other), and repeat the process, reversing the logic used in the image suppression. When an image is shown, the textbecomes hidden. When the text is shown, the image is hidden. It's not really as difficult as it seems. heck, we've got a report that has 15 conditionally suppressable sections in it! Personally I think that generating the report from scratch through code is more effort than it's worth, but that could be just me.
good luck.
-tg
Re: Can I Use Crystal Reports WITHOUT a Template (.rpt) file ?
OK, let's suppose that CR CAN be used to specify the reports.
(I am not convinced that it can)
My client is the provider of this "Risk assessment" software I am the developing for them.
They market this software all around the world to their clients.
The application currently has 15 reports; probably to be expanded to 25.
I really don't want to have to deploy the app along with 15-25 CR template files to each of their customers.
Is there some way I can "bundle" the template files into the app, and have them
distributed as part of the app internally. and have CR use them as INTERNAL templates, rather than "xxx.rpt" external files?
OR
I am still considering building my own Build/Preview facility.
All I really need to know to make this happen, is how to export/save to DOC, RTF, PDF, TXT, etc.
Can anyone give me good solid help in this regard ?
Thanks
Re: Can I Use Crystal Reports WITHOUT a Template (.rpt) file ?
Search the Reporting forum as I have code as well as others on exporting a report data to pdf or ???
Many Enterprise software solutions use external rpt files as it makes you life so much easier when it comes to upgrades and patches. Do you really want to tell them they need to upgrade al their systems/server in order to implement a single report fix or update?
Re: Can I Use Crystal Reports WITHOUT a Template (.rpt) file ?
You could create a stand-alone DLL that contains the rpt files as Resources, then extract them when you need them. OR stuff them into the database, and extract them from there when needed.
-tg
Re: Can I Use Crystal Reports WITHOUT a Template (.rpt) file ?
Techgnome,
Great idea.
I like the thought of storing them in the database.
Thanks
So to do things "my way", I COULD somehow create templates,
store them in the database, then extract when needed to a "temp" folder/file,
use it, then remove.
Can I use CR and NOT have it make the calls to the database for the data?
I have to do this myself because of the convoluted logic in getting data.
If so, I might be able to make this work.
Thanks again
Re: Can I Use Crystal Reports WITHOUT a Template (.rpt) file ?
Depends on the version of CR, but yes... you can create a CR based on a Recordset (VB6) or a datatable(Vb.NET).... how exactly, I don't know... but I do know it's possible.
-tg