Pervasive database and Crystal Report

Posted on 2009-04-17
Last Modified: 2012-05-06
I have a question about Crystal Report running on Pervasive.SQL 9.50 database.
My client asked me to correct some Crystal Report 8.5 those are part or his application. Crystal reports are run on Pervasive.SQL 9.50& database that is seating on his server.
He wants to edit several reports. He needs to add additional fields on those reports. One of those new fields should show a picture in jpeg format.
On his test PC he installed Crystal Report 8.5 Light ( I assume that it is standard version of CR8.5).He told me that he can open reports in design view but can not trace report fields to tables in database.
As I am complete novice to Pervasive database I have some basic questions.
First if data source for these report in are not tables from Pervasive database is it possible that data source is created on fly and how I can see it or reach it to add new field to it.
Second how I can add table field in Pervasive database? Is it done through PCC tool or database has other tool for it?
And last is it good option to store picture in separate folder and have just path in table field pointing to that file so I can use that path in my report; or to store picture in table filed in pervasive database.

Any help will mean a lot to me.
Question by:Taras
    LVL 100

    Expert Comment

    In Crystal 8.5 you will have to store the picture in the database.  There is no capability to use the filename.

    I am not familiar with the LIGHT version.

    To get new fields to show in the list you need to VERIFY THE DATABASE.  It is under the DATABASE menu.


    Author Comment

    Thanks for your respond however I would appreciate if you have any answer on my questions first second and third.
    You touched third question partially.
    Anyway thanks a lot.
    LVL 100

    Expert Comment

    You can attach a dataset to a report.  Here is an example

    I don't know Pervasive so I don't know how to add a field to the table.

    The third one is as above.  You need to store the picture in the database.  CR8.5 can't use the filename from the database.  That was added with CR XI

    LVL 28

    Accepted Solution

    1) The data source CAN be created on the fly, which is very common for the application.  In PSQLv9, databases are comprised of the raw "Btrieve" data files accompanied by a set of DDF files, minimally FILE.DDF, FIELD.DDF, and INDEX.DDF.  The combination of the two creates a Named Database.  You can see the Named Databases that are defined by starting the Pervasive Control Center (PCC) on the server.  Open up the servername, then Databases.  To find the path to a DDF set and a file set, right-click on the database and select "Properties".  To create a new Named Database and Engine DSN on the server, right-click Databases and select New Database, then fill in the details.

    To access this Engine DSN from a workstation, you must configure a client DSN.  In the ODBC Administrator, create a new System DSN as a Pervasive Client DSN.  Provide the server name, and in the box on the bottom, refresh the names and select the server's Engine DSN that you want to link it to.  For consistency, it is good to keep the Client DSN with the same name as the Engine DSN, but this is not required.  You can now access the database from the workstation using just the DSN name.

    2) Adding fields to a table, or adding new tables, can be done several ways.  In the Pervasive Control Center, you can rght-click the table and select Edit Table Design.  Make sure that all users are OUT of the file when you are working on it, or it will fail.  Click the SAVE icon to save your changes.  Please note, though, that if you are modifying the database for an active application, adding or changing fields may completely trash the application, which may not be expecting the new layout.  You may be better off creating a new table of some kind and giving it a key value that relates to the primary key of the table that you want to modify.  This is a bit safer, since the original application won't see the change, but you can do whatever you want in your own private table.  Creating new tables can also be done from the GUI by right-clicking and selecting "Add Table".  If you are familiar with SQL, you can also fire the appropriate CREATE TABLE or ALTER TABLE statements -- just remember to have a backup before doing ANYTHING, just in case the application balks at what you are doing.

    3) PSQL does support the internal storage of any object via the BLOB field.  However, storing the data in the file may be the problematic part of all of this.  If you can create a table with a blob field and populate it, then I'd go for that.  If not, then I am guessing that moving to CR-XI and storing just the pathname makes a LOT more sense.

    Author Closing Comment

    Hi BillBach.

    Thanks for your answers. You gave me good starting point.
     I downloaded Pevasive.SQL 10 trial version and played a little with it to get used with functionalities and options.

    I can see that V10 support LONGVARBINARY data type I am not sure for 9.5 do you know it?

    If  I understood your suggestion right;
    Instead of adding new filed to table e.g. tblproduct you proposed to create new table.
    New table e.g. tblProdImages.
    This table will have two fields one field e.g. ImageID primary key related to primary key of table tblproduct and second field type LONGVARBINARY ProdImage where images will be stored.

    If you can answer just small clarification question?
    If Report is created on fly what is its data source in pervasive database?
    Can it be view, can it be stored procedure. And finally if report source is one of those mentioned can I see it in report design and can I change it?

    One time again Thanks a lot.
    LVL 28

    Expert Comment

    by:Bill Bach
    Yes, v9.5 supports BLOBs or LONGVARBINARY fields, too.
    Yes, use the ID and the image field -- that's it.
    As far as I know, you can source a CR report on a View -- that would be the easiest way to link the two tables and make it transparent to the person creating the reports.  Alternatively, you can link them with a JOIN in the source data definition for the report.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    I hate sub reports and always consider them the last resort in any reporting solution.  The negative effect on performance and maintainability is just not worth the easy ride they give the report writer.  Nine times out of ten reporting requirements…
    There have always been a lot of questions related to when Crystal Reports evaluates report components (such as formulas, summaries, cross-tabs, charts, to name a few examples). Crystal Reports uses a two-pass reporting process to provide greater …
    Internet Business Fax to Email Made Easy - With eFax Corporate (, you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
    In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

    737 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    22 Experts available now in Live!

    Get 1:1 Help Now